updated on Thu Jan 5 13:17:10 UTC 2012
[aur-mirror.git] / perl-text-findindent / PKGBUILD
blob34a33927ebdbe3b77a80e37451c2c232e4ca112a
1 # PKGBUILD generated by pacpan
2 # Modified by Jonathas Rodrigues
3 pkgname=perl-text-findindent
4 _realname=Text-FindIndent
5 pkgver=0.10
6 pkgrel=1
7 pkgdesc="'Heuristically determine the indent style'"
8 arch=(i686 x86_64)
9 license=('perl')
10 url="http://search.cpan.org/~smueller/Text-FindIndent"
11 options=(!emptydirs)
13 depends=('perl>=5.10.1')
14 makedepends=('perl')
16 #provides=('Text-FindIndent')
17 provides=('text-findindent=0.10' 'Text::FindIndent=0.10' 'perl-text-findindent=0.10')
19 source=('http://search.cpan.org/CPAN/authors/id/S/SM/SMUELLER/Text-FindIndent-0.10.tar.gz')
21 md5sums=('765d619fc84e07b3c1e3ac6841e6a6b8')
23 build() {
24   _expected_dir="${srcdir}/${_realname}-${pkgver}"
25   if [ -d "$_expected_dir" ]; then
26     cd "$_expected_dir"
27   else
28     _expected_dir="${srcdir}/$(bsdtar -t -f $(basename $source) | head -n1)"
29     if [ -d "$_expected_dir" ]; then
30       cd "$_expected_dir"
31     else
32       _makefile=$(find $srcdir -iname Makefile.PL)
33       if [ ! -z "$_makefile" ]; then
34         _expected_dir=$(dirname $_makefile)
35         if [ -d "$_expected_dir" ]; then
36           cd "$_expected_dir"
37         else
38           echo "\e[1;31mERROR\e[0m unable to detect source directory"
39           echo "\e[1;34m-->\e[0m this is often due to CPAN's lack of standard naming conventions"
40           echo "\e[1;34m-->\e[0m it may be possible to fix this by adjusting the build function in the PKGBUILD"
41         fi
42       fi
43     fi
44   fi
45   # install module in vendor directories.
46   PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
47   make  || return 1
48   make install DESTDIR=${pkgdir} || return 1
50   # remove perllocal.pod and .packlist
51   find ${pkgdir} -name perllocal.pod -delete
52   find ${pkgdir} -name .packlist -delete
55 # vim:set ts=2 sw=2 et: