core/perl/PKGBUILD

110 lines
3.8 KiB
Bash
Raw Permalink Normal View History

2010-03-13 23:25:19 +08:00
pkgname=perl
2013-05-28 04:42:13 +08:00
pkgver=5.18.0
pkgrel=1
2011-03-26 18:53:39 +08:00
pkgdesc="A highly capable, feature-rich programming language"
2013-05-28 04:42:13 +08:00
arch=(i686 x86_64)
2010-03-13 23:25:19 +08:00
license=('GPL' 'PerlArtistic')
url="http://www.perl.org"
groups=('base')
2012-05-10 04:14:20 +08:00
depends=('gdbm' 'db' 'coreutils' 'glibc' 'sh')
2013-05-28 04:42:13 +08:00
source=(http://www.cpan.org/src/5.0/perl-${pkgver}.tar.bz2
perlbin.sh
perlbin.csh
provides.pl)
2010-03-13 23:25:19 +08:00
install=perl.install
2013-05-28 04:42:13 +08:00
options=('makeflags' '!purge')
md5sums=('a832e928adfd36d162d2a5d3b631265c'
'5ed2542fdb9a60682f215bd33701e61a'
2012-05-10 04:14:20 +08:00
'1f0cbbee783e8a6d32f01be5118e0d5e'
2013-05-28 04:42:13 +08:00
'999c3eea6464860704abbb055a0f0896')
# workaround to let the integrity check find the correct provides array
if [[ ${0##*/} = "parse_pkgbuilds.sh" ]]; then
true && provides=($(bsdtar -q -O -xf "/srv/ftp/pool/packages/$pkgname-$pkgver-$pkgrel-$CARCH.pkg.tar.xz" .PKGINFO | sed -rn 's#^provides = (.*)#\1#p'))
fi
2010-03-13 23:25:19 +08:00
build() {
cd ${srcdir}/${pkgname}-${pkgver}
2013-05-28 04:42:13 +08:00
if [ "${CARCH}" = "x86_64" ]; then
# for x86_64
arch_opts="-Dcccdlflags='-fPIC'"
else
# for i686
arch_opts=""
fi
2012-05-10 04:14:20 +08:00
2011-03-26 18:53:39 +08:00
./Configure -des -Dusethreads -Duseshrplib -Doptimize="${CFLAGS}" \
2013-05-28 04:42:13 +08:00
-Dprefix=/usr -Dvendorprefix=/usr \
2010-03-13 23:25:19 +08:00
-Dprivlib=/usr/share/perl5/core_perl \
-Darchlib=/usr/lib/perl5/core_perl \
2011-03-26 18:53:39 +08:00
-Dsitelib=/usr/share/perl5/site_perl \
-Dsitearch=/usr/lib/perl5/site_perl \
2010-03-13 23:25:19 +08:00
-Dvendorlib=/usr/share/perl5/vendor_perl \
-Dvendorarch=/usr/lib/perl5/vendor_perl \
2011-03-26 18:53:39 +08:00
-Dscriptdir=/usr/bin/core_perl \
-Dsitescript=/usr/bin/site_perl \
-Dvendorscript=/usr/bin/vendor_perl \
-Dinc_version_list=none \
2013-05-28 04:42:13 +08:00
-Dman1ext=1perl -Dman3ext=3perl ${arch_opts} \
2012-05-10 04:14:20 +08:00
-Dlddlflags="-shared ${LDFLAGS}" -Dldflags="${LDFLAGS}"
2011-03-26 18:53:39 +08:00
make
}
2012-05-10 04:14:20 +08:00
check() {
cd ${srcdir}/${pkgname}-${pkgver}
2013-05-28 04:42:13 +08:00
TEST_JOBS=$(echo $MAKEFLAGS | sed 's/.*-j\([0-9][0-9]*\).*/\1/') make test_harness || true
2012-05-10 04:14:20 +08:00
# make test
}
2011-03-26 18:53:39 +08:00
package() {
2013-05-28 04:42:13 +08:00
# hack to work around makepkg running the subshell in check_sanity()
2012-05-10 04:14:20 +08:00
new_provides=($(cd "$srcdir/perl-$pkgver"; LD_PRELOAD=./libperl.so ./perl -Ilib "$srcdir/provides.pl" .))
provides=(${new_provides[@]})
2011-03-26 18:53:39 +08:00
cd ${srcdir}/${pkgname}-${pkgver}
2013-05-28 04:42:13 +08:00
make DESTDIR="$pkgdir" install
2010-03-13 23:25:19 +08:00
### Perl Settings ###
# Change man page extensions for site and vendor module builds.
2013-05-28 04:42:13 +08:00
# Set no mail address since bug reports should go to the bug tracker
# and not someone's email.
2010-03-13 23:25:19 +08:00
sed -e '/^man1ext=/ s/1perl/1p/' -e '/^man3ext=/ s/3perl/3pm/' \
2013-05-28 04:42:13 +08:00
-e "/^cf_email=/ s/'.*'/''/" \
-e "/^perladmin=/ s/'.*'/''/" \
2010-03-13 23:25:19 +08:00
-i ${pkgdir}/usr/lib/perl5/core_perl/Config_heavy.pl
### CPAN Settings ###
# Set CPAN default config to use the site directories.
sed -e '/(makepl_arg =>/ s/""/"INSTALLDIRS=site"/' \
-e '/(mbuildpl_arg =>/ s/""/"installdirs=site"/' \
-i ${pkgdir}/usr/share/perl5/core_perl/CPAN/FirstTime.pm
### CPANPLUS Settings ###
# Set CPANPLUS default config to use the site directories.
sed -e "/{'makemakerflags'}/ s/'';/'INSTALLDIRS=site';/" \
-e "/{'buildflags'}/ s/'';/'installdirs=site';/" \
-i ${pkgdir}/usr/share/perl5/core_perl/CPANPLUS/Config.pm
2012-05-10 04:14:20 +08:00
# Profile script to set paths to perl scripts.
2010-03-13 23:25:19 +08:00
install -D -m755 ${srcdir}/perlbin.sh \
${pkgdir}/etc/profile.d/perlbin.sh
2013-05-28 04:42:13 +08:00
# Profile script to set paths to perl scripts on csh. (FS#22441)
2012-05-10 04:14:20 +08:00
install -D -m755 ${srcdir}/perlbin.csh \
${pkgdir}/etc/profile.d/perlbin.csh
2010-03-13 23:25:19 +08:00
(cd ${pkgdir}/usr/bin; mv perl${pkgver} perl)
2011-03-26 18:53:39 +08:00
(cd ${pkgdir}/usr/bin/core_perl; ln -sf c2ph pstruct; ln -sf s2p psed)
2010-03-13 23:25:19 +08:00
# Remove all pod files *except* those under /usr/share/perl5/core_perl/pod/
2013-05-28 04:42:13 +08:00
# (FS#16488)
2010-03-13 23:25:19 +08:00
rm -f $pkgdir/usr/share/perl5/core_perl/*.pod
for d in $pkgdir/usr/share/perl5/core_perl/*; do
if [ -d $d -a $(basename $d) != "pod" ]; then
find $d -name *.pod -delete
fi
done
find $pkgdir/usr/lib -name *.pod -delete
find $pkgdir -name .packlist -delete
}