# Maintainer: Natanael Copa # Contributor: Leonardo Arena # Contributor: Valery Kartel pkgname=perl pkgver=5.26.2 pkgrel=0 pkgdesc="Larry Wall's Practical Extraction and Report Language" url="http://www.perl.org/" arch="all" license="Artistic GPL-2.0" options="!check !fhs" # Tests require more musl locale support depends="" depends_dev="perl-utils" makedepends="bzip2-dev zlib-dev" subpackages="$pkgname-doc $pkgname-dev $pkgname-utils::noarch miniperl" source="http://www.cpan.org/src/5.0/perl-$pkgver.tar.gz " # secfixes: # 5.26.2-r0: # - CVE-2018-6797 # - CVE-2018-6798 # - CVE-2018-6913 # 5.26.1-r0: # - CVE-2017-12837 # - CVE-2017-12883 builddir="$srcdir/$pkgname-$pkgver" _privlib=/usr/share/perl5/core_perl _archlib=/usr/lib/perl5/core_perl prepare() { chmod +w "$builddir"/*.c default_prepare || return 1 cd "$builddir" sed -e 's/less -R/less/g' \ -e 's/libswanted="\(.*\) nsl\(.*\)"/libswanted="\1\2"/g' \ -i ./Configure || return 1 # Ensure that we never accidentally bundle zlib or bzip2 rm -rf cpan/Compress-Raw-Zlib/zlib-src rm -rf cpan/Compress-Raw-Bzip2/bzip2-src sed -i '/\(bzip2\|zlib\)-src/d' MANIFEST } build() { cd "$builddir" BUILD_ZLIB=0 BUILD_BZIP2=0 BZIP2_LIB=/usr/lib BZIP2_INCLUDE=/usr/inculde export BUILD_ZLIB BUILD_BZIP2 BZIP2_LIB BZIP2_INCLUDE ./Configure -des \ -Dcccdlflags='-fPIC' \ -Dcccdlflags='-fPIC' \ -Dccdlflags='-rdynamic' \ -Dprefix=/usr \ -Dprivlib=$_privlib \ -Darchlib=$_archlib \ -Dvendorprefix=/usr \ -Dvendorlib=/usr/share/perl5/vendor_perl \ -Dvendorarch=/usr/lib/perl5/vendor_perl \ -Dsiteprefix=/usr/local \ -Dsitelib=/usr/local/share/perl5/site_perl \ -Dsitearch=/usr/local/lib/perl5/site_perl \ -Dlocincpth=' ' \ -Doptimize="$CFLAGS" \ -Duselargefiles \ -Dusethreads \ -Duseshrplib \ -Dd_semctl_semun \ -Dman1dir=/usr/share/man/man1 \ -Dman3dir=/usr/share/man/man3 \ -Dinstallman1dir=/usr/share/man/man1 \ -Dinstallman3dir=/usr/share/man/man3 \ -Dman1ext='1' \ -Dman3ext='3pm' \ -Dcf_by='Alpine' \ -Ud_csh \ -Dusenm \ || return 1 make libperl.so && make || return 1 } package() { cd "$builddir" make DESTDIR="$pkgdir" install if [ -n "$(find $pkgdir/usr/local -type f)" ]; then error "files found under /usr/local" return 1 fi find "$pkgdir" -name '.*' -delete } miniperl() { install -Dm755 "$builddir"/$subpkgname \ "$subpkgdir"/usr/bin/$subpkgname || return 1 } doc() { default_doc local file; for file in $(find "$pkgdir" -name "*.pod"); do file=${file#$pkgdir/} mkdir -p "$subpkgdir"/${file%/*} || return 1 mv "$pkgdir"/$file "$subpkgdir"/$file || return 1 done } dev() { mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/$_archlib "$subpkgdir"/$_privlib mv "$pkgdir"/$_archlib/Devel "$subpkgdir"/$_archlib/ mv "$pkgdir"/$_privlib/Encode "$subpkgdir"/$_privlib/ mv "$pkgdir"/usr/bin/h2xs \ "$pkgdir"/usr/bin/perlivp \ "$pkgdir"/usr/bin/enc2xs \ "$pkgdir"/usr/bin/xsubpp \ "$subpkgdir"/usr/bin/ default_dev } utils() { pkgdesc="$pkgdesc (misc utilities)" depends="$pkgname" mkdir -p "$subpkgdir"/usr/bin local file for file in \ corelist \ cpan \ encguess \ libnetcfg \ h2ph \ instmodsh \ json_pp \ perlbug \ perlthanks \ piconv \ pl2pm \ prove \ ptar \ ptardiff \ ptargrep \ shasum \ splain \ zipdetails do mv "$pkgdir"/usr/bin/$file "$subpkgdir"/usr/bin/ || return 1 done } sha512sums="166d767f748a911b969fc8008069f087927cbdd9ee21b375b31e5feb5afc2be8d80d68f8c291accee6fdf3be90e9dc2fc870cb9c0bd1cc68c6e001e4ed38d564 perl-5.26.2.tar.gz"