updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / perl-file-modified / PKGBUILD
blob3d75aa887386f4737860924caee48fd226d965ce
1 # PKGBUILD generated by pacpan
2 pkgname=perl-file-modified
3 _realname=File-Modified
4 pkgver=0.07
5 pkgrel=1
6 pkgdesc="no description available"
7 arch=(i686 x86_64)
8 license=('unknown: check http://search.cpan.org/src/CORION/File-Modified-0.07/README.txt')
9 url="http://search.cpan.org/~corion/File-Modified"
10 options=(!emptydirs)
13 #provides=('File-Modified')
14 provides=('file-modified=0.07' 'File::Modified=0.07' 'perl-file-modified=0.07')
16 source=(http://search.cpan.org/CPAN/authors/id/C/CO/CORION/File-Modified-0.07.tar.gz)
17 md5sums=('271a991b96ccbdaeb7098272c9f97d51')
19 build() {
20   _expected_dir="${srcdir}/${_realname}-${pkgver}"
21   if [ -d "$_expected_dir" ]; then
22     cd "$_expected_dir"
23   else
24     _expected_dir="${srcdir}/$(bsdtar -t -f $(basename $source) | head -n1)"
25     if [ -d "$_expected_dir" ]; then
26       cd "$_expected_dir"
27     else
28       _makefile=$(find $srcdir -iname Makefile.PL)
29       if [ ! -z "$_makefile" ]; then
30         _expected_dir=$(dirname $_makefile)
31         if [ -d "$_expected_dir" ]; then
32           cd "$_expected_dir"
33         else
34           echo "\e[1;31mERROR\e[0m unable to detect source directory"
35           echo "\e[1;34m-->\e[0m this is often due to CPAN's lack of standard naming conventions"
36           echo "\e[1;34m-->\e[0m it may be possible to fix this by adjusting the build function in the PKGBUILD"
37         fi
38       fi
39     fi
40   fi
41   # install module in vendor directories.
42   PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
43   make  || return 1
44   make install DESTDIR=${pkgdir} || return 1
46   # remove perllocal.pod and .packlist
47   find ${pkgdir} -name perllocal.pod -delete
48   find ${pkgdir} -name .packlist -delete