Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Maintainer: Kent Fredric <kentnl@cpan.org>
# Previous Maintainer: yugrotavele <yugrotavele at archlinux dot us>
_perl_distname=Acme-Damn
_perl_author=IBB
_perl_version=0.05
pkgdesc="'Unbless' Perl objects"
depends=('perl')
checkdepends=('perl-test-exception' 'perl-test-simple')
pkgver=0.05
pkgrel=3
arch=('i686' 'x86_64')
options=(!emptydirs)
#<<perl-module:sha1=feedbeefdeadbeefc0ffeeb00b135:v=0.01>>
pkgname=perl-acme-damn
url="https://metacpan.org/release/Acme-Damn"
license=('PerlArtistic' 'GPL')
source=("http://cpan.metacpan.org/authors/id/I/IB/IBB/Acme-Damn-0.05.tar.gz")
sha1sums=('5eb4bb27642ed12d8219362cf9027694d631ef3c')
_bm() {
_dir=$(find $srcdir -maxdepth 2 -type f -name 'Makefile.PL')
if [ ! -z "$_dir" ]; then
echo "EUMM";
return 0;
fi
_dir=$(find $srcdir -maxdepth 2 -type f -name 'Build.PL')
if [ ! -z "$_dir" ]; then
echo "MB";
return 0;
fi
error "failed to detect build method for $pkgname";
error "you may be able to fix this by editing the PKGBUILD"
exit 1;
}
_bdir() {
_dir=$(find $srcdir -maxdepth 2 -type f -name $1 );
dirname "$_dir";
}
build() {
_build_method=$(_bm);
if [ $_build_method = 'EUMM' ]; then
cd $(_bdir Makefile.PL);
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
make || return 1
else if [ $_build_method = 'MB' ]; then
cd $(_bdir Build.PL);
PERL_MM_USE_DEFAULT=1 perl Build.PL INSTALLDIRS=vendor || return 1
./Build || return 1
fi fi
}
check() {
_build_method=$(_bm);
if [ $_build_method = 'EUMM' ]; then
cd $(_bdir Makefile.PL);
make test || return 1
else if [ $_build_method = 'MB' ]; then
cd $(_bdir Build.PL);
./Build test || return 1
fi fi
}
package() {
_build_method=$(_bm);
if [ $_build_method = 'EUMM' ]; then
cd $(_bdir Makefile.PL);
make install DESTDIR="${pkgdir}" || return 1
else if [ $_build_method = 'MB' ]; then
cd $(_bdir Build.PL);
./Build install destdir=${pkgdir} || return 1
fi fi
}
#<<-perl-module>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment