--- PKGBUILD-perl.proto 2013-01-10 16:19:29.174032241 -0600 +++ PKGBUILD-perl.proto 2013-01-10 16:54:07.726735962 -0600 @@ -1,4 +1,11 @@ -# Contributor: Your Name +# This is an example PKGBUILD file. Use this as a start to creating your own, +# and remove these comments. For more information, see 'man PKGBUILD'. +# NOTE: Please fill out the license field for your package! If it is unknown, +# then please put 'unknown'. + +# Maintainer: Name +# Contributor: Your Name + pkgname=perl-foo-bar pkgver=VERSION pkgrel=1 @@ -14,28 +21,59 @@ backup=() options=('!emptydirs') install= -source=("http://search.cpan.org/CPAN/authors/id/***/***-$pkgver.tar.gz") -md5sums=() +source=("http://search.cpan.org/CPAN/authors/id/*/**/****/src_pkgname.tar.gz") +md5sums=('') # generate with makepkg -g +sha256sums=('') # generate with makepkg -g + +_distdir="src_pkgname-pkgver" # IE if the tar file is Class-Adapter-1.08.tar.gz this would be Class-Adapter-1.08 build() { - cd "$srcdir/***-$pkgver" - - # Setting these env variables overwrites any command-line-options we don't want... - export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \ - PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \ - PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \ - MODULEBUILDRC=/dev/null + ( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \ + PERL_AUTOINSTALL=--skipdeps \ + PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \ + PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \ + MODULEBUILDRC=/dev/null # If using Makefile.PL - { /usr/bin/perl Makefile.PL && - make && - make test && - make install; } || return 1 + cd "$_distdir" + /usr/bin/perl Makefile.PL + make + # If using Build.pl + cd "$_distdir" + /usr/bin/perl Build.PL + /usr/bin/perl Build + ) +} + +check() { + # If using Makefile.PL + cd "$_distdir" + ( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" + make test + ) # If using Build.PL - { /usr/bin/perl Build.PL && - ./Build && - ./Build test && - ./Build install; } || return 1 + cd "$_distdir" + ( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" + /usr/bin/perl Build test + ) + +} + +package() { + # If using Makefile.PL + cd "$_distdir" + make install + + # If using Build.PL + cd "$_distdir" + /usr/bin/perl Build install + + find "$pkgdir" -name .packlist -o -name perllocal.pod -delete } +# Local Variables: +# mode: shell-script +# sh-basic-offset: 2 +# End: +# vim:set ts=2 sw=2 et: