summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 44e3caae3211e26e53b1bacdd276f82ecd958e8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Generated by Xyne::Arch::CPAN 0.07

pkgname=perl-webservice-nfsn
pkgver=1.04
pkgrel=3
pkgdesc="Client for the NearlyFreeSpeech.NET API"
arch=('any')
url="https://metacpan.org/pod/WebService::NFSN"
license=('PerlArtistic')
source=("https://cpan.metacpan.org/authors/Christopher_J_Madsen/WebService-NFSN-$pkgver.tar.gz")
_source_basename=("WebService-NFSN-$pkgver")
md5sums=('921cb763fa7f66dacd7ce50756d7256a')
sha256sums=('61139c1740eceb1a21bfe40095e1b69b18ec6d74d2776074301b13d37d27b494')
depends=('perl' 'perl-libwww' 'perl-exception-class' 'perl-uri' 'perl-try-tiny' 'perl-json-xs' 'perl-lwp-protocol-https' )
makedepends=()
options=(!emptydirs)

build() {
  _dir=$(find "$srcdir/$_source_basename" -maxdepth 2 -type f -name 'Makefile.PL')
  if [ ! -z "$_dir" ]; then
    cd $(dirname "$_dir")
    PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
    make

  else
    _dir=$(find "$srcdir/$_source_basename" -maxdepth 2 -type f -name 'Build.PL')
    if [ ! -z "$_dir" ]; then
      cd $(dirname "$_dir")
      export PERL5LIB="$srcdir/$_source_basename" # we need this because they have a custom package, inc::My_Build, needed for compilation.
      PERL_MM_USE_DEFAULT=1 perl Build.PL INSTALLDIRS=vendor
      ./Build

    else
      echo "error: failed to detect build method for $pkgname"
      echo "you may be able to fix this by editing the PKGBUILD"
      return 1
    fi
  fi

}

package() {
echo "pkg starts here"
  _dir=$(find "$srcdir/$_source_basename" -maxdepth 2 -type f -name 'Makefile.PL')
  if [ ! -z "$_dir" ]; then
    cd $(dirname "$_dir")
    make install DESTDIR="${pkgdir}"
  else
    _dir=$(find "$srcdir/$_source_basename" -maxdepth 2 -type f -name 'Build.PL')
    if [ ! -z "$_dir" ]; then
      cd $(dirname "$_dir")
      ./Build install destdir=${pkgdir}

    else
      echo "error: failed to detect build method for $pkgname"
      echo "you may be able to fix this by editing the PKGBUILD"
      return 1
    fi
  fi

  # remove perllocal.pod and .packlist
  find ${pkgdir} -name perllocal.pod -delete
  find ${pkgdir} -name .packlist -delete
}

# vim:set ts=2 sw=2 et: