Changeset 32461 for main

Show
Ignore:
Timestamp:
17.09.2018 15:18:13 (9 months ago)
Author:
ak19
Message:

1. Changes to get le.pl to finally work: the bootstrap files of the dynamic/native packages Crypt::OpenSSL::Bignum and Time::Piece need to be in cpan/perl-5.18 and its auto subfolder (the .bs and .bundle files for mac need to be present in their correct locations). 2. The final step to get le.pl to work, pointed out by Dr Bainbridge, is to include not just cpan but also cpan/perl-5.18 in PERL5LIB

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cpan/compile-zerossl.sh

    r32456 r32461  
    11# A basic cascade-make to install the Crypt::LE perl package required for ZeroSSL, used to get an https certificate on Mac 
     2 
     3if [ "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 
     10fi 
    211 
    312if [ "x$GSDL3SRCHOME" = "x" ] ; then 
     
    918fi 
    1019 
     20echo "" 
     21echo "**************************" 
     22 
    1123CPAN_DIR=$GSDLHOME/perllib/cpan 
    1224OLD_PERL5LIB=$PERL5LIB 
     25 
     26# make the dirs cpan/perl-5.18 and its subdir auto if they don't already exist 
     27mkdir -p $CPAN_DIR/perl-5.18/auto 
     28 
    1329# 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" 
     30export PERL5LIB=$CPAN_DIR:$CPAN_DIR/perl-5.18:$PERL5LIB 
     31 
     32#echo "**** PERL5LIB is $PERL5LIB" 
    1733 
    1834 
     
    2339 
    2440# if clean was passed in 
    25 if [ "x$1" = "xclean" ] ; then 
     41if [ "x$1" = "x--clean" ] ; then 
    2642    cd $CPAN_DIR 
    27     rm -rf Crypt/OpenSSL Log JSON/MaybeXS.pm Log Time Module JSON/PP.pm JSON/PP Crypt/LE Crypt/LE.pm 
     43    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 
    2844    mv JSON/PP.old JSON/PP 
    2945    mv JSON/PP.pm_old JSON/PP.pm 
    3046    rm -rf $TMPDIR 
    31     echo "Done cleaning" 
     47    echo "Done cleaning Crypt::LE related packages" 
    3248    exit 0 
    3349fi 
    3450 
    35  
    36  
    3751mkdir -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 
    4354cd $TMPDIR 
    4455 
     
    4758 
    4859# 1 https://metacpan.org/pod/Crypt::OpenSSL::Bignum 
    49 if [ ! -d "$CPAN_DIR/Crypt/OpenSSL/Bignum" ]; then 
     60if [ ! -d "$CPAN_DIR/perl-5.18/Crypt/OpenSSL/Bignum" ]; then 
    5061    CRYPT_OPENSSL_BIGNUM=Crypt-OpenSSL-Bignum 
    5162    CRYPT_OPENSSL_BIGNUM_VER=$CRYPT_OPENSSL_BIGNUM-0.09 
     
    5970    make 
    6071    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 
    6376    C_INCLUDE_PATH= 
    6477    cd $TMPDIR 
     
    179192# 6 https://metacpan.org/pod/Time::Piece 
    180193 
    181 if [ ! -f "$CPAN_DIR/Time/Piece.pm" ]; then 
     194if [ ! -f "$CPAN_DIR/perl-5.18/Time/Piece.pm" ]; then 
    182195    TIME_PIECE=Time-Piece 
    183196    TIME_PIECE_VER=$TIME_PIECE-1.33 
     
    191204    make install 
    192205 
    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/. 
    194209 
    195210    cd $TMPDIR 
     
    226241 
    227242# DONE 
     243 
     244echo "*****************************" 
     245echo "*** Done compiling Crypt::LE." 
     246if [ "x$1" != "x--keep" ] ; then 
     247    echo "    Will now delete tmp subdir" 
     248    rm -rf tmp 
     249else 
     250    echo "   Not deleting the $TMPDIR" 
     251fi 
     252 
    228253# restore env vars 
    229254C_INCLUDE_PATH=$OLD_C_INCLUDE_PATH 
    230255PERL5LIB=$OLD_PERL5LIB 
     256 
     257export PERL5LIB=$CPAN_DIR:$CPAN_DIR/perl-5.18:$PERL5LIB 
     258 
     259echo "Restored environment and updated PERL5LIB to $PERL5LIB necessary to run Crypt::LE." 
     260echo "You can now run $CPAN_DIR/Crypt/LE/bin/le.pl"