- Timestamp:
- 2018-09-17T15:18:13+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cpan/compile-zerossl.sh
r32456 r32461 1 1 # A basic cascade-make to install the Crypt::LE perl package required for ZeroSSL, used to get an https certificate on Mac 2 3 if [ "x$1" = "x--help" ] || [ "x$1" = "x-h" ]; then 4 echo "Usage: $0 [--clean|--keep|--help|-h]" 5 echo " Run without flags to compile and remove unnecessary stuff at the end." 6 echo " Run with --keep to retain the cpan/tmp subdir at compilation's end." 7 echo " Run with --clean to remove all traces of compilation completely so you can recompile from scratch" 8 echo " Run with --help/-h to see this Usage statement again" 9 exit 0 10 fi 2 11 3 12 if [ "x$GSDL3SRCHOME" = "x" ] ; then … … 9 18 fi 10 19 20 echo "" 21 echo "**************************" 22 11 23 CPAN_DIR=$GSDLHOME/perllib/cpan 12 24 OLD_PERL5LIB=$PERL5LIB 25 26 # make the dirs cpan/perl-5.18 and its subdir auto if they don't already exist 27 mkdir -p $CPAN_DIR/perl-5.18/auto 28 13 29 # dependencies are not found if PERL5LIB is simply set to cpan. PERL5LIB Needs to specifically be exported 14 export PERL5LIB=$CPAN_DIR 15 16 echo "**** PERL5LIB is $PERL5LIB"30 export PERL5LIB=$CPAN_DIR:$CPAN_DIR/perl-5.18:$PERL5LIB 31 32 #echo "**** PERL5LIB is $PERL5LIB" 17 33 18 34 … … 23 39 24 40 # if clean was passed in 25 if [ "x$1" = "x clean" ] ; then41 if [ "x$1" = "x--clean" ] ; then 26 42 cd $CPAN_DIR 27 rm -rf Crypt/OpenSSL Log JSON/MaybeXS.pm Log TimeModule JSON/PP.pm JSON/PP Crypt/LE Crypt/LE.pm43 rm -rf perl-5.18/Crypt perl-5.18/Time perl-5.18/auto/Crypt perl-5.18/auto/Time Log JSON/MaybeXS.pm Log Module JSON/PP.pm JSON/PP Crypt/LE Crypt/LE.pm 28 44 mv JSON/PP.old JSON/PP 29 45 mv JSON/PP.pm_old JSON/PP.pm 30 46 rm -rf $TMPDIR 31 echo "Done cleaning "47 echo "Done cleaning Crypt::LE related packages" 32 48 exit 0 33 49 fi 34 50 35 36 37 51 mkdir -p $TMPDIR 38 39 40 41 42 # We'll download, unpack and compile stuff into TMPDIR 52 # We'll download, unpack and compile (Makefile.PL, make and make install) packages into TMPDIR 53 # before copying the necessary components to their final locations 43 54 cd $TMPDIR 44 55 … … 47 58 48 59 # 1 https://metacpan.org/pod/Crypt::OpenSSL::Bignum 49 if [ ! -d "$CPAN_DIR/ Crypt/OpenSSL/Bignum" ]; then60 if [ ! -d "$CPAN_DIR/perl-5.18/Crypt/OpenSSL/Bignum" ]; then 50 61 CRYPT_OPENSSL_BIGNUM=Crypt-OpenSSL-Bignum 51 62 CRYPT_OPENSSL_BIGNUM_VER=$CRYPT_OPENSSL_BIGNUM-0.09 … … 59 70 make 60 71 make install 61 cp -r $TMPDIR/$CRYPT_OPENSSL_BIGNUM/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Crypt/OpenSSL $CPAN_DIR/Crypt/. 62 72 #cp -r $TMPDIR/$CRYPT_OPENSSL_BIGNUM/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Crypt/OpenSSL $CPAN_DIR/Crypt/. 73 cp -r $TMPDIR/Crypt-OpenSSL-Bignum/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Crypt $CPAN_DIR/perl-5.18/. 74 cp -r $TMPDIR/Crypt-OpenSSL-Bignum/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/auto/Crypt $CPAN_DIR/perl-5.18/auto/. 75 63 76 C_INCLUDE_PATH= 64 77 cd $TMPDIR … … 179 192 # 6 https://metacpan.org/pod/Time::Piece 180 193 181 if [ ! -f "$CPAN_DIR/ Time/Piece.pm" ]; then194 if [ ! -f "$CPAN_DIR/perl-5.18/Time/Piece.pm" ]; then 182 195 TIME_PIECE=Time-Piece 183 196 TIME_PIECE_VER=$TIME_PIECE-1.33 … … 191 204 make install 192 205 193 cp -r $TMPDIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Time $CPAN_DIR/. 206 #cp -r $TMPDIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Time $CPAN_DIR/. 207 cp -r $TMPDIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Time $CPAN_DIR/perl-5.18 208 cp -r $TMPDIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/auto/Time $CPAN_DIR/perl-5.18/auto/. 194 209 195 210 cd $TMPDIR … … 226 241 227 242 # DONE 243 244 echo "*****************************" 245 echo "*** Done compiling Crypt::LE." 246 if [ "x$1" != "x--keep" ] ; then 247 echo " Will now delete tmp subdir" 248 rm -rf tmp 249 else 250 echo " Not deleting the $TMPDIR" 251 fi 252 228 253 # restore env vars 229 254 C_INCLUDE_PATH=$OLD_C_INCLUDE_PATH 230 255 PERL5LIB=$OLD_PERL5LIB 256 257 export PERL5LIB=$CPAN_DIR:$CPAN_DIR/perl-5.18:$PERL5LIB 258 259 echo "Restored environment and updated PERL5LIB to $PERL5LIB necessary to run Crypt::LE." 260 echo "You can now run $CPAN_DIR/Crypt/LE/bin/le.pl"
Note:
See TracChangeset
for help on using the changeset viewer.