summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5f7f3adccea666514bac05a41bc4c820e0c3acda (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
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gitname=yara-python
pkgbase=python-yara-git
pkgname=('python-yara-git' 'python2-yara-git')
pkgver=3.5.0.57.9fd9fd2
pkgrel=1
pkgdesc='Tool aimed at helping malware researchers to identify and classify malware samples'
url='https://github.com/VirusTotal/yara-python'
arch=('i686' 'x86_64')
license=('Apache')
makedepends=('git' 'yara' 'python-setuptools' 'python2-setuptools')
source=(${pkgbase}::git+https://github.com/VirusTotal/${_gitname})
sha512sums=('SKIP')

pkgver() {
  cd ${pkgbase}
  printf "%s.%s.%s" "$(git describe --tags --abbrev=0|cut -dv -f2|cut -d- -f1)" \
    "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cp -a ${pkgbase}{,-py2}
}

build() {
  (cd ${pkgbase}
    python setup.py build --dynamic-linking
  )
  (cd ${pkgbase}-py2
    python2 setup.py build --dynamic-linking
  )
}

package_python-yara-git() {
  depends=('python' 'yara')
  provides=('python-yara')
  conflicts=('python-yara')
  cd ${pkgbase}
  python setup.py install --root="${pkgdir}" -O1 --skip-build
  install -Dm 644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README"
  ln -s /usr/share/doc/yara/docs "${pkgdir}/usr/share/doc/${pkgname}/docs"
}

package_python2-yara-git() {
  depends=('python2' 'yara')
  provides=('python2-yara')
  conflicts=('python2-yara')
  cd ${pkgbase}-py2
  python2 setup.py install --root="${pkgdir}" -O1 --skip-build
  install -Dm 644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README"
  ln -s /usr/share/doc/yara/docs "${pkgdir}/usr/share/doc/${pkgname}/docs"
}

# vim: ts=2 sw=2 et: