cookutils rev 1115
cook: add cook_perl()
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Dec 11 23:15:30 2018 +0200 (2018-12-11) |
parents | e027dbdf061e |
children | f77e48e58ac0 |
files | cook |
line diff
1.1 --- a/cook Sun Dec 09 23:24:05 2018 +0200 1.2 +++ b/cook Tue Dec 11 23:15:30 2018 +0200 1.3 @@ -89,7 +89,7 @@ 1.4 # for example, libpcreposix -> pcre 1.5 1.6 find_pkg_in_wok() { 1.7 - awk -F$'\t' -vi="$1" '{ 1.8 + awk -F$'\t' -vi=" $1 " '{ 1.9 if (index(" " $2 " ", i)) {print $1; exit} 1.10 }' $cache/split.db 1.11 } 1.12 @@ -683,6 +683,25 @@ 1.13 } 1.14 1.15 1.16 +# Typical function used in compile_rules() to make perl modules packages 1.17 + 1.18 +cook_perl() { 1.19 + if [ -e "Makefile.PL" ]; then 1.20 + # Up to 3 optional parameters supported 1.21 + PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor $1 && 1.22 + make $2 && 1.23 + make $3 PERL_MM_USE_DEFAULT=1 DESTDIR=$install install && 1.24 + chmod -R u+w $install 1.25 + elif [ -e "Build.PL" ]; then 1.26 + echo "Not implemented yet" 1.27 + return 1 1.28 + else 1.29 + echo "Unable to cook Perl module" 1.30 + return 1 1.31 + fi 1.32 +} 1.33 + 1.34 + 1.35 # Store timestamps, log jobs length 1.36 1.37 timestamp() {