summaryrefslogtreecommitdiff
path: root/pcr/pdftk/PKGBUILD
blob: 5fde660186075705ece6d03963b6120f204c1c0c (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
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Maintainer (AUR): Joey Dumont <joey.dumont@gmail.com>
# Contributor (AUR): osc
# Contributor (AUR): StefanHusmann
# Contributor (AUR): larsrh <hupel@in.tum.de>

pkgname=pdftk

pkgver=2.02
pkgrel=18.parabola1
arch=(i686 x86_64)

pkgdesc="Pdftk is a simple tool for doing everyday things with PDF documents"
url="http://www.pdfhacks.com/pdftk"
license=(GPL)

depends=(gcc6-gcj gcc-gcj-ecj)
options=('!makeflags')

source=("http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/$pkgname-$pkgver-src.zip"
        "Makefile.Parabola"
        "pdftk"
)
sha256sums=('118f6a25fd3acaafb58824dce6f97cdc07e56050e666b90e4c4ef426ea37b8c1'
            '4451a807817b5e40755b79686bce5751c70758c83302a4214c23c4f361168620'
            '9c49337ed05759e986f24ac4173f727567c617e5f160e4c9ec7e089e120af3c3')

prepare() {
  cd "$srcdir/$pkgname-$pkgver-dist/$pkgname"

  cp "$srcdir/Makefile.Parabola" .
}

build() {
  cd "$srcdir/$pkgname-$pkgver-dist/$pkgname"

  make -f Makefile.Parabola
}

package() {
  cd "$srcdir/$pkgname-$pkgver-dist/$pkgname"

  # Install binary
  install -D -m 755 pdftk $pkgdir/usr/bin/pdftk-bin

  # Install licenses and adjust permissions
  cd ..
  LICENSE_DIR="$pkgdir/usr/share/licenses/$pkgname"
  mkdir -p "$LICENSE_DIR"
  cp -R license_gpl_pdftk/* "$LICENSE_DIR"
  chmod -R 0755 "$LICENSE_DIR"
  find "$LICENSE_DIR" -type f -exec chmod -x {} \;

  # Install manpage
  install -D -m 644 "pdftk.1" "$pkgdir/usr/share/man/man1/pdftk.1"

  # Install wrapper that sets the proper environment variables.
  sed -i "s/CARCH/${CARCH}/" ${srcdir}/pdftk
  sed -i "s/GCCVER/`gcc-6 -dumpversion`/" ${srcdir}/pdftk
  install -D -m 755 ${srcdir}/pdftk ${pkgdir}/usr/bin/pdftk
}