diff options
author | Henry-Joseph Audéoud | 2021-12-13 10:38:59 +0100 |
---|---|---|
committer | Henry-Joseph Audéoud | 2021-12-13 14:53:31 +0100 |
commit | 8e66a412e0bb60c77a1710f5955f9967e0cb9ae9 (patch) | |
tree | 8dbf3e7ee997c7915aa3b318002970f3e3250520 | |
parent | ecbe0ed2bf1b03c96f8c76d8d9cdcf159f1edf09 (diff) | |
download | aur-8e66a412e0bb60c77a1710f5955f9967e0cb9ae9.tar.gz |
upgpkg: python-ebtables 0.2.0-2
Split patch in two dedicated subpatches, backport one of them from upstream
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | PKGBUILD | 25 | ||||
-rw-r--r-- | commit_f7956b4_partial.patch | 30 | ||||
-rw-r--r-- | ebtables.py_python2to3.patch | 16 | ||||
-rw-r--r-- | fix_library_path_for_arch_linux.patch | 20 |
5 files changed, 73 insertions, 31 deletions
@@ -1,16 +1,19 @@ pkgbase = python-ebtables pkgdesc = A simple Python binding for Ebtables pkgver = 0.2.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/ldx/python-ebtables - arch = any + arch = x86_64 license = GPL2 makedepends = python-setuptools depends = python depends = python-cffi>=0.5.0 depends = ebtables - source = https://github.com/ldx/python-ebtables/archive/v0.2.0.tar.gz - md5sums = be4c50c78c4c932761cf0586fe755f20 + source = python-ebtables-0.2.0.tar.gz::https://github.com/ldx/python-ebtables/archive/v0.2.0.tar.gz + source = commit_f7956b4_partial.patch + source = fix_library_path_for_arch_linux.patch + sha256sums = 5d5cc3b84dd7ce3bd3299fa276e71bc2dece4b2cb8a388828b54bd92a5c549b3 + sha256sums = 4eaf163ce7fad84ec7ab369c96126dfe274834cdb99d73edf437be21bb78e701 + sha256sums = 9e652ed354283c76b7bf310df07287f67eb0d65ef397e7a03919489a88821b06 pkgname = python-ebtables - @@ -1,33 +1,38 @@ # Maintainer: Henry-Joseph Audéoud <h.audeoud at gmail dot com> -_pkgname='python-ebtables' -pkgname="${_pkgname}" +pkgname=python-ebtables pkgver=0.2.0 -pkgrel=1 +pkgrel=2 pkgdesc='A simple Python binding for Ebtables' -arch=('any') +arch=('x86_64') url='https://github.com/ldx/python-ebtables' license=('GPL2') depends=('python' 'python-cffi>=0.5.0' 'ebtables') makedepends=('python-setuptools') -source=("https://github.com/ldx/${_pkgname}/archive/v${pkgver}.tar.gz") -md5sums=('be4c50c78c4c932761cf0586fe755f20') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ldx/${pkgname}/archive/v${pkgver}.tar.gz" + commit_f7956b4_partial.patch + fix_library_path_for_arch_linux.patch) +sha256sums=('5d5cc3b84dd7ce3bd3299fa276e71bc2dece4b2cb8a388828b54bd92a5c549b3' + '4eaf163ce7fad84ec7ab369c96126dfe274834cdb99d73edf437be21bb78e701' + '9e652ed354283c76b7bf310df07287f67eb0d65ef397e7a03919489a88821b06') prepare() { - patch "${srcdir}/${_pkgname}-${pkgver}"/ebtables.py ../ebtables.py_python2to3.patch + cd "${pkgname}-${pkgver}" + patch -p1 < "${srcdir}/${source[1]}" + patch -p1 < "${srcdir}/${source[2]}" } build() { - cd "${srcdir}/${_pkgname}-${pkgver}" + cd "${pkgname}-${pkgver}" python setup.py build } check() { - cd "${srcdir}/${_pkgname}-${pkgver}" + cd "${pkgname}-${pkgver}" python setup.py check } package() { - cd "${srcdir}/${_pkgname}-${pkgver}" + cd "${pkgname}-${pkgver}" python setup.py install --root "${pkgdir}" --optimize=1 } diff --git a/commit_f7956b4_partial.patch b/commit_f7956b4_partial.patch new file mode 100644 index 000000000000..5aa01ebe40a4 --- /dev/null +++ b/commit_f7956b4_partial.patch @@ -0,0 +1,30 @@ +commit f7956b47ac1ffd209bafd8b20ff19bedaa6d0cad +Author: Gabriele Fariello <gabriele.fariello@gmail.com> +Date: Fri Mar 1 18:51:23 2019 +0000 + + Updated to make python3 compatible + +diff --git a/ebtables.py b/ebtables.py +index e5903d8..eb562e3 100644 +--- a/ebtables.py ++++ b/ebtables.py +@@ -85,7 +85,8 @@ _verify = """ + void ebt_early_init_once(void); + """ + +-_hash = hashlib.sha1('\0'.join([_cdef, _verify])).hexdigest() ++# Changed this to be python3 compatible which requires string encoding ++_hash = hashlib.sha1(_cdef.encode('utf-8') + _verify.encode('utf-8')).hexdigest() + + ffi.cdef(_cdef) + +@@ -99,7 +100,8 @@ _ebtc = ffi.verify(_verify, + _ebtc.ebt_early_init_once() + + _ebtc.ebt_silent = 1 +-_ebtc.ebt_errormsg[0] = '\0' ++# Changed this to be python3 compatible which requires string encoding ++_ebtc.ebt_errormsg[0] = '\0'.encode("ascii") + + + def _get_errormsg(): diff --git a/ebtables.py_python2to3.patch b/ebtables.py_python2to3.patch deleted file mode 100644 index c7c36ae8fa02..000000000000 --- a/ebtables.py_python2to3.patch +++ /dev/null @@ -1,16 +0,0 @@ -9c9 -< EBTABLES_LIBRARY_PATH = os.getenv('EBTABLES_LIBRARY_PATH') or '/lib/ebtables' ---- -> EBTABLES_LIBRARY_PATH = os.getenv('EBTABLES_LIBRARY_PATH') or '/usr/lib' -27c27 -< return [_get_libname(f) for f in files if f.endswith('.so')] ---- -> return [_get_libname(f) for f in files if f.startswith("libebt") and f.endswith('.so')] -88c88 -< _hash = hashlib.sha1('\0'.join([_cdef, _verify])).hexdigest() ---- -> _hash = hashlib.sha1('\0'.join([_cdef, _verify]).encode('ascii')).hexdigest() -102c102 -< _ebtc.ebt_errormsg[0] = '\0' ---- -> _ebtc.ebt_errormsg[0] = '\0'.encode('ascii') diff --git a/fix_library_path_for_arch_linux.patch b/fix_library_path_for_arch_linux.patch new file mode 100644 index 000000000000..d2b5ffa0a1e1 --- /dev/null +++ b/fix_library_path_for_arch_linux.patch @@ -0,0 +1,20 @@ +--- a/ebtables.py 2016-08-14 23:38:16.000000000 +0000 ++++ b/ebtables.py 2021-12-13 13:44:55.332479081 +0000 +@@ -6,7 +6,7 @@ + + __version__ = '0.2.0' + +-EBTABLES_LIBRARY_PATH = os.getenv('EBTABLES_LIBRARY_PATH') or '/lib/ebtables' ++EBTABLES_LIBRARY_PATH = os.getenv('EBTABLES_LIBRARY_PATH') or '/usr/lib' + + + class EbtablesException(Exception): +@@ -24,7 +24,7 @@ + + def _get_libraries(): + files = os.listdir(EBTABLES_LIBRARY_PATH) +- return [_get_libname(f) for f in files if f.endswith('.so')] ++ return [_get_libname(f) for f in files if f.startswith("libebt") and f.endswith('.so')] + + + ffi = FFI() |