updated on Mon Jan 16 20:00:43 UTC 2012
[aur-mirror.git] / perl-class-adapter / PKGBUILD
blob1c2cc3053d50200288a2ef878558b37b2e5e1de8
1 # PKGBUILD generated by pacpan
2 # Modified by Jonathas Rodrigues
3 pkgname=perl-class-adapter
4 _realname=Class-Adapter
5 pkgver=1.08
6 pkgrel=1
7 pkgdesc="Perl implementation of the \"Adapter\" Design Pattern"
8 arch=(i686 x86_64)
9 license=('perl')
10 url="http://search.cpan.org/~adamk/Class-Adapter"
11 options=(!emptydirs)
13 depends=('perl>=5.10.1')
14 makedepends=('perl')
16 #provides=('Class-Adapter')
17 provides=('class-adapter=1.08' 'Class::Adapter::Clear=1.08' 'perl-class-adapter-clear=1.08' 'Class::Adapter=1.08' 'perl-class-adapter=1.08' 'Class::Adapter::Builder=1.08' 'perl-class-adapter-builder=1.08')
19 source=('http://search.cpan.org/CPAN/authors/id/A/AD/ADAMK/Class-Adapter-1.08.tar.gz')
20 md5sums=('4a1dbb281eac71f666d2eeccf4cc8b99')
22 build() {
23   _expected_dir="${srcdir}/${_realname}-${pkgver}"
24   if [ -d "$_expected_dir" ]; then
25     cd "$_expected_dir"
26   else
27     _expected_dir="${srcdir}/$(bsdtar -t -f $(basename $source) | head -n1)"
28     if [ -d "$_expected_dir" ]; then
29       cd "$_expected_dir"
30     else
31       _makefile=$(find $srcdir -iname Makefile.PL)
32       if [ ! -z "$_makefile" ]; then
33         _expected_dir=$(dirname $_makefile)
34         if [ -d "$_expected_dir" ]; then
35           cd "$_expected_dir"
36         else
37           echo "\e[1;31mERROR\e[0m unable to detect source directory"
38           echo "\e[1;34m-->\e[0m this is often due to CPAN's lack of standard naming conventions"
39           echo "\e[1;34m-->\e[0m it may be possible to fix this by adjusting the build function in the PKGBUILD"
40         fi
41       fi
42     fi
43   fi
44   # install module in vendor directories.
45   PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
46   make  || return 1
47   make install DESTDIR=${pkgdir} || return 1
49   # remove perllocal.pod and .packlist
50   find ${pkgdir} -name perllocal.pod -delete
51   find ${pkgdir} -name .packlist -delete
54 # vim:set ts=2 sw=2 et: