Created
December 6, 2012 19:39
-
-
Save kentfredric/4227633 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url="https://metacpan.org/release/$_perl_distname" | |
license=('PerlArtistic' 'GPL') | |
source=( | |
"http://cpan.metacpan.org/authors/id/${_perl_author:0:1}/${_perl_author:0:2}/${_perl_author}/${_perl_distname}-${_perl_version}.tar.gz" | |
"perlmod.sh" | |
) | |
_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"; | |
} | |
perlmod_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 | |
} | |
build() { | |
perlmod_build; | |
} | |
perlmod_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 | |
} | |
check() { | |
perlmod_check; | |
} | |
perlmod_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 | |
} | |
package(){ | |
perlmod_package; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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') | |
source ./perlmod.sh; | |
pkgver=0.05 | |
pkgrel=1 | |
arch=('i686' 'x86_64') | |
options=(!emptydirs) | |
sha1sums=('5eb4bb27642ed12d8219362cf9027694d631ef3c' | |
'042648d8fb8a1a783ad7455d3301b95a4a592b48') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment