Changeset 32479


Ignore:
Timestamp:
2018-09-24T15:27:24+12:00 (6 years ago)
Author:
ak19
Message:

Rename tmp folder to something more sensible and now works out what the perl version is using Dr Bainbridge's one-line assignment and uses this in the perl folder name

File:
1 edited

Legend:

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

    r32462 r32479  
    2121# existing folder structure.
    2222# - However, for all packages that contain .bundle (mac, or .so for linux) and .xs or .bs bootstrap files, need to put the relevant
    23 # products (both the "auto" and package folder inside the lib folder) into cpan/perl-<version> (perl-5.18).
     23# products (both the "auto" and package folder inside the lib folder) into cpan/perl-<version> ($PERL_FOLDER, e.g. "perl-5.18").
    2424# In this case, both Crypt::OpenSSL and Time::Piece once compiled up require this second treatment.
    2525#
    26 # Compiling as well as RUNNING the final Crypt::LE's le.pl executable requires PERL5LIB to have both the cpan and its perl-5.18
     26# Compiling as well as RUNNING the final Crypt::LE's le.pl executable requires PERL5LIB to have both the cpan and its $PERL_FOLDER
    2727# subdirectory included in env var PERL5LIB.
    2828#
     
    5252OLD_PERL5LIB=$PERL5LIB
    5353
    54 # make the dirs cpan/perl-5.18 and its subdir auto if they don't already exist
    55 mkdir -p $CPAN_DIR/perl-5.18/auto
     54# PERL_FOLDER is something like "$PERL_FOLDER" (even if the full version number is 5.18.2)
     55PERL_FOLDER=`perl -e 'print "perl-5.".substr($],3,2);'`
     56
     57# make the dirs cpan/$PERL_FOLDER and its subdir auto if they don't already exist
     58mkdir -p $CPAN_DIR/$PERL_FOLDER/auto
    5659
    5760# dependencies are not found if PERL5LIB is simply set to cpan. PERL5LIB Needs to specifically be exported
    58 export PERL5LIB=$CPAN_DIR:$CPAN_DIR/perl-5.18:$PERL5LIB
     61export PERL5LIB=$CPAN_DIR:$CPAN_DIR/$PERL_FOLDER:$PERL5LIB
    5962
    6063#echo "**** PERL5LIB is $PERL5LIB"
     
    6265
    6366WGET_FLAGS=--no-check-certificate
    64 TEMP_DIR=$CPAN_DIR/tmp
     67# folder where we'll put the downloaded files, the compile products and the temporary install products
     68# after everything is installed there, we copy just the relevant installed files to their final locations
     69# then the tmp file gets deleted
     70TEMP_DIR=$CPAN_DIR/tmp-crypt-le
     71
    6572
    6673OLD_C_INCLUDE_PATH=$C_INCLUDE_PATH
     
    6976if [ "x$1" = "x--clean" ] ; then
    7077    cd $CPAN_DIR
    71     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
     78    rm -rf $PERL_FOLDER/Crypt $PERL_FOLDER/Time $PERL_FOLDER/auto/Crypt $PERL_FOLDER/auto/Time Log JSON/MaybeXS.pm Log Module JSON/PP.pm JSON/PP Crypt/LE Crypt/LE.pm
    7279    mv JSON/PP.old JSON/PP
    7380    mv JSON/PP.pm_old JSON/PP.pm
     
    8693
    8794# 1 https://metacpan.org/pod/Crypt::OpenSSL::Bignum
    88 if [ ! -d "$CPAN_DIR/perl-5.18/Crypt/OpenSSL/Bignum" ]; then
     95if [ ! -d "$CPAN_DIR/$PERL_FOLDER/Crypt/OpenSSL/Bignum" ]; then
    8996    CRYPT_OPENSSL_BIGNUM=Crypt-OpenSSL-Bignum
    9097    CRYPT_OPENSSL_BIGNUM_VER=$CRYPT_OPENSSL_BIGNUM-0.09
     
    99106    make install
    100107    #cp -r $TEMP_DIR/$CRYPT_OPENSSL_BIGNUM/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Crypt/OpenSSL $CPAN_DIR/Crypt/.
    101     cp -r $TEMP_DIR/Crypt-OpenSSL-Bignum/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Crypt $CPAN_DIR/perl-5.18/.
    102     cp -r $TEMP_DIR/Crypt-OpenSSL-Bignum/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/auto/Crypt $CPAN_DIR/perl-5.18/auto/.
     108    cp -r $TEMP_DIR/Crypt-OpenSSL-Bignum/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Crypt $CPAN_DIR/$PERL_FOLDER/.
     109    cp -r $TEMP_DIR/Crypt-OpenSSL-Bignum/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/auto/Crypt $CPAN_DIR/$PERL_FOLDER/auto/.
    103110
    104111    C_INCLUDE_PATH=
     
    220227# 6 https://metacpan.org/pod/Time::Piece
    221228
    222 if [ ! -f "$CPAN_DIR/perl-5.18/Time/Piece.pm" ]; then
     229if [ ! -f "$CPAN_DIR/$PERL_FOLDER/Time/Piece.pm" ]; then
    223230    TIME_PIECE=Time-Piece
    224231    TIME_PIECE_VER=$TIME_PIECE-1.33
     
    233240
    234241    #cp -r $TEMP_DIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Time $CPAN_DIR/.
    235     cp -r $TEMP_DIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Time $CPAN_DIR/perl-5.18
    236     cp -r $TEMP_DIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/auto/Time $CPAN_DIR/perl-5.18/auto/.
     242    cp -r $TEMP_DIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/Time $CPAN_DIR/$PERL_FOLDER
     243    cp -r $TEMP_DIR/$TIME_PIECE/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level/auto/Time $CPAN_DIR/$PERL_FOLDER/auto/.
    237244
    238245    cd $TEMP_DIR
     
    283290PERL5LIB=$OLD_PERL5LIB
    284291
    285 export PERL5LIB=$CPAN_DIR:$CPAN_DIR/perl-5.18:$PERL5LIB
    286 
    287 echo "Restored environment and updated PERL5LIB to $PERL5LIB necessary to run Crypt::LE."
    288 echo "You can now run $CPAN_DIR/Crypt/LE/bin/le.pl"
     292# for this export line to work, would need to source ./compile-zerossl.sh
     293#export PERL5LIB=$CPAN_DIR:$CPAN_DIR/$PERL_FOLDER:$PERL5LIB
     294
     295echo "Restored environment"
     296echo "You can now run $CPAN_DIR/Crypt/LE/bin/le.pl after exporting PERL5LIB to contain both cpan and cpan/$PERL_FOLDER. Do:"
     297echo "   export PERL5LIB=$CPAN_DIR:$CPAN_DIR/$PERL_FOLDER:$PERL5LIB"
Note: See TracChangeset for help on using the changeset viewer.