Changeset 32462

Show
Ignore:
Timestamp:
17.09.2018 16:09:44 (7 months ago)
Author:
ak19
Message:

File comments and renaming TMPDIR to TEMP_DIR, since the former is a C env var name also used when compiling perl.

Files:
1 modified

Legend:

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

    r32461 r32462  
    1 # A basic cascade-make to install the Crypt::LE perl package required for ZeroSSL, used to get an https certificate on Mac 
     1################################################### 
     2# A basic cascade-make to install the Crypt::LE perl package required for ZeroSSL, to be used to get an https certificate on Mac 
     3# 
     4# Crypt::LE depends on the following packages: 
     5# - Crypt::OpenSSL::Bignum, which needs openssl/err.h 
     6#   for which we need to set C_INCLUDE_PATH=$GSDL3SRCHOME/bin/darwin/openssl/include 
     7#   see https://www.perlmonks.org/?node_id=1181472 
     8#      "If includes arent in default compiler findable directories, let the user add any extra directories, like he is supposed to 
     9#       http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html like C_INCLUDE_PATH/LIBRARY_PATH... " 
     10# - JSON::MaybeXS, which depends on 
     11#     - JSON::PP 
     12# - Time::Piece 
     13# - HTTP::Tiny 
     14# - Module::Load 
     15# - Log::Log4perl 
     16# 
     17# 
     18# Compiling AND INSTALLING of all packages takes place in the temporary cpan/tmp folder. A select subset of the compiled/installed 
     19# products are then copied into their final destinations: 
     20# - For regular packages, need to put the relevant products (the package folder inside the lib folder) into cpan, maintaining any 
     21# existing folder structure. 
     22# - 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). 
     24# In this case, both Crypt::OpenSSL and Time::Piece once compiled up require this second treatment. 
     25# 
     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 
     27# subdirectory included in env var PERL5LIB. 
     28# 
     29################################################### 
    230 
    331if [ "x$1" = "x--help" ] || [ "x$1" = "x-h" ]; then 
     
    3462 
    3563WGET_FLAGS=--no-check-certificate 
    36 TMPDIR=$CPAN_DIR/tmp 
     64TEMP_DIR=$CPAN_DIR/tmp 
    3765 
    3866OLD_C_INCLUDE_PATH=$C_INCLUDE_PATH 
     
    4472    mv JSON/PP.old JSON/PP 
    4573    mv JSON/PP.pm_old JSON/PP.pm 
    46     rm -rf $TMPDIR 
     74    rm -rf $TEMP_DIR 
    4775    echo "Done cleaning Crypt::LE related packages" 
    4876    exit 0 
    4977fi 
    5078 
    51 mkdir -p $TMPDIR 
    52 # We'll download, unpack and compile (Makefile.PL, make and make install) packages into TMPDIR 
     79mkdir -p $TEMP_DIR 
     80# We'll download, unpack and compile (Makefile.PL, make and make install) packages into TEMP_DIR 
    5381# before copying the necessary components to their final locations 
    54 cd $TMPDIR 
     82cd $TEMP_DIR 
    5583 
    5684 
     
    6795    export C_INCLUDE_PATH=$GSDL3SRCHOME/bin/darwin/openssl/include 
    6896    cd $CRYPT_OPENSSL_BIGNUM_VER 
    69     perl Makefile.PL PREFIX=$TMPDIR/$CRYPT_OPENSSL_BIGNUM 
    70     make 
    71     make install 
    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/. 
     97    perl Makefile.PL PREFIX=$TEMP_DIR/$CRYPT_OPENSSL_BIGNUM 
     98    make 
     99    make install 
     100    #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/. 
    75103 
    76104    C_INCLUDE_PATH= 
    77     cd $TMPDIR 
     105    cd $TEMP_DIR 
    78106else 
    79107    echo "*** $CPAN_DIR/Crypt/OpenSSL/Bignum already exists, not installing" 
     
    95123 
    96124    cd $JSON_PP_VER 
    97     perl Makefile.PL PREFIX=$TMPDIR/$JSON_PP 
    98     make 
    99     make install 
    100     cp -r $TMPDIR/$JSON_PP/lib/perl5/site_perl/JSON/* JSON $CPAN_DIR/JSON/. 
    101  
    102     cd $TMPDIR 
     125    perl Makefile.PL PREFIX=$TEMP_DIR/$JSON_PP 
     126    make 
     127    make install 
     128    cp -r $TEMP_DIR/$JSON_PP/lib/perl5/site_perl/JSON/* JSON $CPAN_DIR/JSON/. 
     129 
     130    cd $TEMP_DIR 
    103131else 
    104132    echo "*** The new $CPAN_DIR/JSON/PP.pm already exists, not installing" 
     
    116144 
    117145    cd $JSON_MAYBEXS_VER 
    118     perl Makefile.PL PREFIX=$TMPDIR/$JSON_MAYBEXS 
    119     make 
    120     make install 
    121     cp $TMPDIR/$JSON_MAYBEXS/lib/perl5/site_perl/JSON/MaybeXS.pm $CPAN_DIR/JSON/. 
    122  
    123     cd $TMPDIR 
     146    perl Makefile.PL PREFIX=$TEMP_DIR/$JSON_MAYBEXS 
     147    make 
     148    make install 
     149    cp $TEMP_DIR/$JSON_MAYBEXS/lib/perl5/site_perl/JSON/MaybeXS.pm $CPAN_DIR/JSON/. 
     150 
     151    cd $TEMP_DIR 
    124152else 
    125153    echo "*** $CPAN_DIR/JSON/MaybeXS.pm already exists, not installing" 
     
    137165 
    138166    cd $LOG4PERL_VER 
    139     perl Makefile.PL PREFIX=$TMPDIR/$LOG4PERL 
    140     make 
    141     make install 
    142     cp -r $TMPDIR/$LOG4PERL/lib/perl5/site_perl/Log $CPAN_DIR/. 
    143  
    144     cd $TMPDIR 
     167    perl Makefile.PL PREFIX=$TEMP_DIR/$LOG4PERL 
     168    make 
     169    make install 
     170    cp -r $TEMP_DIR/$LOG4PERL/lib/perl5/site_perl/Log $CPAN_DIR/. 
     171 
     172    cd $TEMP_DIR 
    145173else 
    146174    echo "*** $CPAN_DIR/Log/Log4Perl already exists, not installing" 
     
    157185 
    158186    cd $HTTP_TINY_VER 
    159     perl Makefile.PL PREFIX=$TMPDIR/$HTTP_TINY 
    160     make 
    161     make install 
    162  
    163     cp -r $TMPDIR/$HTTP_TINY/lib/perl5/site_perl/HTTP/* $CPAN_DIR/HTTP/. 
    164  
    165     cd $TMPDIR 
     187    perl Makefile.PL PREFIX=$TEMP_DIR/$HTTP_TINY 
     188    make 
     189    make install 
     190 
     191    cp -r $TEMP_DIR/$HTTP_TINY/lib/perl5/site_perl/HTTP/* $CPAN_DIR/HTTP/. 
     192 
     193    cd $TEMP_DIR 
    166194else 
    167195    echo "*** $CPAN_DIR/$HTTP_TINY already exists, not installing" 
     
    179207 
    180208    cd $MODULE_LOAD_VER 
    181     perl Makefile.PL PREFIX=$TMPDIR/$MODULE_LOAD 
    182     make 
    183     make install 
    184     cp -r $TMPDIR/$MODULE_LOAD/lib/perl5/site_perl/Module $CPAN_DIR/. 
    185  
    186     cd $TMPDIR 
     209    perl Makefile.PL PREFIX=$TEMP_DIR/$MODULE_LOAD 
     210    make 
     211    make install 
     212    cp -r $TEMP_DIR/$MODULE_LOAD/lib/perl5/site_perl/Module $CPAN_DIR/. 
     213 
     214    cd $TEMP_DIR 
    187215else 
    188216    echo "*** $CPAN_DIR/$MODULE_LOAD already exists, not installing" 
     
    200228 
    201229    cd $TIME_PIECE_VER 
    202     perl Makefile.PL PREFIX=$TMPDIR/$TIME_PIECE 
    203     make 
    204     make install 
    205  
    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/. 
    209  
    210     cd $TMPDIR 
     230    perl Makefile.PL PREFIX=$TEMP_DIR/$TIME_PIECE 
     231    make 
     232    make install 
     233 
     234    #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/. 
     237 
     238    cd $TEMP_DIR 
    211239else 
    212240    echo "*** $CPAN_DIR/$TIME_PIECE already exists, not installing" 
     
    226254 
    227255    cd $CRYPT_LE_VER 
    228     perl Makefile.PL PREFIX=$TMPDIR/$CRYPT_LE 
    229     make 
    230     make install 
    231  
    232     cp -r $TMPDIR/$CRYPT_LE/lib/perl5/site_perl/Crypt/* $CPAN_DIR/Crypt/. 
     256    perl Makefile.PL PREFIX=$TEMP_DIR/$CRYPT_LE 
     257    make 
     258    make install 
     259 
     260    cp -r $TEMP_DIR/$CRYPT_LE/lib/perl5/site_perl/Crypt/* $CPAN_DIR/Crypt/. 
    233261    # the most important step: we need the le.pl binary 
    234     cp -r $TMPDIR/$CRYPT_LE/bin $CPAN_DIR/Crypt/LE/. 
     262    cp -r $TEMP_DIR/$CRYPT_LE/bin $CPAN_DIR/Crypt/LE/. 
    235263 
    236264    cd $CPAN_DIR 
     
    248276    rm -rf tmp 
    249277else 
    250     echo "   Not deleting the $TMPDIR" 
     278    echo "   Not deleting the $TEMP_DIR" 
    251279fi 
    252280