summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9faf1e0101755affd542fb1426aca3c1d5036bb4 (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
# Maintainer: Luca D'Amico <damico.luca91[at]live.it>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Brad Ackerman <brad[at]facefault.org>
# Contributor: Christian Rebischke <chris.rebischke[at]archlinux[dot]org>

pkgname=python-oletools
_pkg="${pkgname#python-}"
pkgver=0.60.1
pkgrel=1
pkgdesc="Python tools to analyze security characteristics of MS Office and OLE files"
arch=('any')
url="https://github.com/decalage2/oletools"
license=('BSD')
depends=('python-colorclass' 'python-easygui' 'python-pyparsing' 'python-msoffcrypto-tool')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("$pkgname-$pkgver.zip::https://files.pythonhosted.org/packages/source/o/$_pkg/$_pkg-$pkgver.zip")
sha256sums=('67a796da4c4b8e2feb9a6b2495bef8798a3323a75512de4e5669d9dc9d1fae31')

prepare() {
  cd "$_pkg-$pkgver"
  sed -i '167,193c\package_data = {}' setup.py
}

build() {
  cd "$_pkg-$pkgver"
  python -m build --wheel --no-isolation
}

package() {
  cd "$_pkg-$pkgver"
  PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 \
    "$_pkg/LICENSE.txt" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 \
    "$_pkg/thirdparty/xglob/LICENSE.txt" \
    "$pkgdir/usr/share/licenses/$pkgname/thirdparty/xglob/LICENSE"
  install -Dm644 \
    "$_pkg/thirdparty/xxxswf/LICENSE.txt" \
    "$pkgdir/usr/share/licenses/$pkgname/thirdparty/xxxswf/LICENSE"
  install -Dm644 \
    "$_pkg/thirdparty/prettytable/COPYING" \
    "$pkgdir/usr/share/licenses/$pkgname/thirdparty/prettytable/LICENSE"
}

# Checks are currently broken upstream for version 0.60.1
# but they are working in master branch: uncomment in the next release!
# check() {
#   cd "${srcdir}/${_pyname}-${pkgver}"
#   python setup.py test
# }