summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b8601e94b6a901c2cbaf0a3a845c296c7ec81e28 (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
# Contributor: Ari Mizrahi <codemunchies at debugsecurity dot com>
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=peepdf
pkgver=0.3
pkgrel=2
epoch=1
pkgdesc="A python tool to explore PDF files in order to find out if the file can be harmful or not"
arch=('any')
url=https://github.com/jesparza/peepdf
license=('GPL3')
makedepends=('git')
depends=('python2')
source=("$url/archive/$pkgname-$pkgver.tar.gz")
sha256sums=('e2038bf3379f93b5b62faaf39f47c6a096fc7655705e7edd808acb25e55c43a2')

prepare() {
  cd $pkgname-$pkgname-$pkgver
  find -name '*.py' -exec sed -i 's/env python$/env python2/' '{}' \;
}

package() {
  cd $pkgname-$pkgname-$pkgver

  # Base directories.
  install -dm755 "$pkgdir"/usr/share/peepdf
  install -dm755 "$pkgdir"/usr/bin

  cp --no-preserve=ownership -R * "$pkgdir"/usr/share/peepdf

  cat > "$pkgdir"/usr/bin/peepdf <<EOF
#!/bin/sh
exec python2 /usr/share/peepdf/peepdf.py "\$@"
EOF

  chmod +x "$pkgdir"/usr/bin/peepdf
}