ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.sh
(Generate patch)

Comparing App-Staticperl/staticperl.sh (file contents):
Revision 1.6 by root, Tue Dec 7 10:40:39 2010 UTC vs.
Revision 1.10 by root, Tue Dec 7 21:22:12 2010 UTC

46 46
47# which extra modules you might want to install 47# which extra modules you might want to install
48EXTRA_MODULES="" 48EXTRA_MODULES=""
49 49
50# overridable functions 50# overridable functions
51preconfigure() { : ; }
51postconfigure() { : ; } 52postconfigure() { : ; }
52postbuild() { : ; } 53postbuild() { : ; }
53postinstall() { : ; } 54postinstall() { : ; }
54 55
55# now source user config, if any 56# now source user config, if any
60############################################################################# 61#############################################################################
61# support 62# support
62 63
63# set version in a way that Makefile.PL can extract 64# set version in a way that Makefile.PL can extract
64VERSION=VERSION; eval \ 65VERSION=VERSION; eval \
65$VERSION=0.1 66$VERSION=0.2
66 67
67BZ2=bz2 68BZ2=bz2
68BZIP2=bzip2 69BZIP2=bzip2
69 70
70fatal() { 71fatal() {
113 114
114############################################################################# 115#############################################################################
115# download/configure/compile/install perl 116# download/configure/compile/install perl
116 117
117clean() { 118clean() {
118 cd "$STATICPERL/src/perl-$PERL_VERSION" 2>/dev/null || return 119 rm -rf "$STATICPERL/src/perl-$PERL_VERSION"
119
120 rm -f staticstamp.configure
121 make distclean >/dev/null 2>&1
122} 120}
123 121
124fetch() { 122fetch() {
125 rcd "$STATICPERL" 123 rcd "$STATICPERL"
126 124
149 verblock <<EOF 147 verblock <<EOF
150unpacking perl 148unpacking perl
151EOF 149EOF
152 150
153 mkdir -p unpack 151 mkdir -p unpack
154 $BZIP2 -d <perl-$PERL_VERSION.tar.bz2 | tar xpC unpack \ 152 $BZIP2 -d <perl-$PERL_VERSION.tar.bz2 | tar xC unpack \
155 || fatal "perl-$PERL_VERSION.tar.bz2: error during unpacking" 153 || fatal "perl-$PERL_VERSION.tar.bz2: error during unpacking"
154 chmod -R u+w unpack/perl-$PERL_VERSION
156 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION 155 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION
157 rmdir -p unpack 156 rmdir -p unpack
158 fi 157 fi
159} 158}
160 159
173 172
174 verblock <<EOF 173 verblock <<EOF
175configuring $STATICPERL/src/perl-$PERL_VERSION 174configuring $STATICPERL/src/perl-$PERL_VERSION
176EOF 175EOF
177 176
178 clean
179
180 rm -f "$PERL_PREFIX/staticstamp.install" 177 rm -f "$PERL_PREFIX/staticstamp.install"
178
179 make distclean >/dev/null 2>&1
181 180
182 # I hate them 181 # I hate them
183 grep -q -- -fstack-protector Configure && \ 182 grep -q -- -fstack-protector Configure && \
184 sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure 183 sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure
184
185 preconfigure
185 186
186# trace configure \ 187# trace configure \
187 sh Configure -Duselargefiles \ 188 sh Configure -Duselargefiles \
188 -Uuse64bitint \ 189 -Uuse64bitint \
189 -Dusemymalloc=n \ 190 -Dusemymalloc=n \
245 246
246 postbuild || fatal "postbuild hook failed" 247 postbuild || fatal "postbuild hook failed"
247} 248}
248 249
249install() { 250install() {
250 [ -e "$PERL_PREFIX/staticstamp.install" ] && return 251 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
251
252 build 252 build
253 253
254 verblock <<EOF 254 verblock <<EOF
255installing $STATICPERL/src/perl-$PERL_VERSION 255installing $STATICPERL/src/perl-$PERL_VERSION
256to $PERL_PREFIX 256to $PERL_PREFIX
257EOF 257EOF
258 258
259 rm -rf "$PERL_PREFIX" 259 rm -rf "$PERL_PREFIX"
260 260
261 make install || fatal "make install: error while installing" 261 make install || fatal "make install: error while installing"
262 262
263 rcd "$PERL_PREFIX" 263 rcd "$PERL_PREFIX"
264 264
265 # create a "make install" replacement for CPAN 265 # create a "make install" replacement for CPAN
266 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF 266 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF
267make install UNINST=1 267make || exit
268
268if find blib/arch/auto -type f | grep -q -v .exists; then 269if find blib/arch/auto -type f | grep -q -v .exists; then
269 echo Probably an XS module, rebuilding perl 270 echo Probably an XS module, rebuilding perl
270 make perl 271 if make perl; then
271 rm -f "$PERL_PREFIX"/bin/perl 272 mv perl "$PERL_PREFIX"/bin/perl
272 make -f Makefile.aperl inst_perl
273 make -f Makefile.aperl map_clean 273 make -f Makefile.aperl map_clean
274 else
275 make -f Makefile.aperl map_clean
276 exit 1
277 fi
274fi 278fi
279
280make install UNINST=1
275EOF 281EOF
276 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install 282 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install
277 283
278 # trick CPAN into avoiding ~/.cpan completely 284 # trick CPAN into avoiding ~/.cpan completely
279 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" 285 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
280 286
281 "$PERL_PREFIX"/bin/perl -MCPAN -e ' 287 "$PERL_PREFIX"/bin/perl -MCPAN -e '
282 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); 288 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
283 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 289 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
284 CPAN::Shell->o (conf => q<init>); 290 CPAN::Shell->o (conf => q<init>);
285 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 291 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
286 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); 292 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build");
287 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs"); 293 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs");
288 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile"); 294 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile");
289 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources"); 295 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources");
290 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/cpan-make-install"); 296 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/cpan-make-install");
291 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); 297 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>);
292 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>); 298 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>);
293 CPAN::Shell->o (conf => q<commit>); 299 CPAN::Shell->o (conf => q<commit>);
294 ' || fatal "error while initialising CPAN" 300 ' || fatal "error while initialising CPAN"
295 301
302 touch "$PERL_PREFIX/staticstamp.install"
303 fi
304
305 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then
296 NOCHECK_INSTALL=+ 306 NOCHECK_INSTALL=+
297 instcpan $STATICPERL_MODULES 307 instcpan $STATICPERL_MODULES
298 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES 308 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES
299 309
300 postinstall || fatal "postinstall hook failed" 310 postinstall || fatal "postinstall hook failed"
301 311
302 touch "$PERL_PREFIX/staticstamp.install" 312 touch "$PERL_PREFIX/staticstamp.postinstall"
313 fi
303} 314}
304 315
305############################################################################# 316#############################################################################
306# install a module from CPAN 317# install a module from CPAN
307 318

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines