Date: Sunday, June 12, 2016 @ 17:47:41 Author: anthraxx Revision: 179722
upgpkg: ropper 1.9.5-1 split package to support py2+3 lib Modified: ropper/trunk/PKGBUILD ----------+ PKGBUILD | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 10 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2016-06-12 14:02:18 UTC (rev 179721) +++ PKGBUILD 2016-06-12 15:47:41 UTC (rev 179722) @@ -1,36 +1,68 @@ # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org> -pkgname=ropper +pkgbase=ropper +pkgname=('ropper' 'python-ropper' 'python2-ropper') _pkgname=Ropper -pkgver=1.9.1 -pkgrel=2 +pkgver=1.9.5 +pkgrel=1 pkgdesc="Show information about binary files and find gadgets to build rop chains for different architectures" url="https://github.com/sashs/Ropper" arch=('any') license=('GPL2') -depends=('python-capstone' 'python-filebytes') optdepends=('sqlite: gadgets database support' 'python-keystone: assemble command support') -makedepends=('python-setuptools') +makedepends=('python-setuptools' 'python-capstone' 'python-filebytes' 'python2-setuptools' 'python2-capstone' 'python2-filebytes') checkdepends=('sqlite') source=(${pkgname}-${pkgver}.tar.gz::https://github.com/sashs/${_pkgname}/archive/v${pkgver}.tar.gz) -sha512sums=('76db41f0a4cf432470ec40fc47fdbf2e076d61e44c42cde9131d901ab0308fe84e1c59bd69b00e1460af33637c24de424cb0460d4816527f0b3e26003d471cf2') +sha512sums=('cb14b763ab181c6e0e6ffb17a2fa533aef897d14775ea42037a66929e6d1992c69aa323693830a8e48510ffee48c84510d1fa7047d9fd6777c9549dbac8ac403') +prepare() { + cp -ra ${_pkgname}-${pkgver}{,-py2} + sed -r 's|(env python)|\12|' -i ${_pkgname}-${pkgver}-py2/sample.py +} + build() { - cd ${_pkgname}-${pkgver} - python setup.py build + (cd ${_pkgname}-${pkgver} + python setup.py build + ) + (cd ${_pkgname}-${pkgver}-py2 + python2 setup.py build + ) } check() { + (cd ${_pkgname}-${pkgver} + python test.py + ) + (cd ${_pkgname}-${pkgver}-py2 + python2 test.py + ) +} + +package_ropper() { + depends=('python' 'python-ropper') cd ${_pkgname}-${pkgver} - python test.py + python setup.py install -O1 --root="${pkgdir}" --skip-build + install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" + rm -r "${pkgdir}/usr/lib" } -package() { +package_python-ropper() { + depends=('python-capstone' 'python-filebytes') cd ${_pkgname}-${pkgver} python setup.py install -O1 --root="${pkgdir}" --skip-build install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" install -Dm 644 sample.py "${pkgdir}/usr/share/doc/${pkgname}/sample.py" + rm "${pkgdir}/usr/bin/ropper" } +package_python2-ropper() { + depends=('python2-capstone' 'python2-filebytes') + cd ${_pkgname}-${pkgver}-py2 + python2 setup.py install -O1 --root="${pkgdir}" --skip-build + install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" + install -Dm 644 sample.py "${pkgdir}/usr/share/doc/${pkgname}/sample.py" + rm "${pkgdir}/usr/bin/ropper" +} + # vim: ts=2 sw=2 et: