summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 27b399e0d4ce0842e83cb28ffca5e560bec186bc (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
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Christian Rebischke <echo Q2hyaXMuUmViaXNjaGtlQGdtYWlsLmNvbQo= | base64 -d>

pkgname=peda-git
_gitname=peda
pkgver=1.1.82.b7c7d7a
pkgrel=1
epoch=1
pkgdesc='Python Exploit Development Assistance for GDB'
url='https://github.com/longld/peda'
arch=('any')
license=('custom:Creative Commons')
depends=('gdb' 'binutils' 'nasm' 'python-six')
makedepends=('git')
provides=('peda')
conflicts=('peda')
source=(${pkgname}::git+https://github.com/longld/peda)
sha512sums=('SKIP')

pkgver() {
  cd ${pkgname}
  printf "%s.%s.%s" "$(git describe --tags --abbrev=0|sed -r 's|v?(.+)|\1|')" \
    "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd ${pkgname}
  rm lib/six.py
  sed '/git clone/d' -i README.md
  sed 's|~/peda/peda.py|/usr/share/peda/peda.py|g' -i README.md
}

build() {
  cd ${pkgname}
  msg2 'Compiling python objects...'
  python -m compileall . >/dev/null
  python -O -m compileall . >/dev/null
}

package() {
  cd ${pkgname}
  install -Dm 644 *.py -t "${pkgdir}/usr/share/${_gitname}"
  install -Dm 644 __pycache__/* -t "${pkgdir}/usr/share/${_gitname}/__pycache__"
  install -Dm 644 lib/*.py -t "${pkgdir}/usr/share/${_gitname}/lib"
  install -Dm 644 lib/__pycache__/* -t "${pkgdir}/usr/share/${_gitname}/lib/__pycache__"
  install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}

# vim: ts=2 sw=2 et: