Skip to content

Instantly share code, notes, and snippets.

@igo95862
Created June 24, 2020 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igo95862/891b35353c11d5d66c330eaacab02775 to your computer and use it in GitHub Desktop.
Save igo95862/891b35353c11d5d66c330eaacab02775 to your computer and use it in GitHub Desktop.
Arch Linux libseccomp patch for python
--- PKGBUILD_old 2020-06-24 10:43:28.790287474 -0700
+++ PKGBUILD 2020-06-24 10:54:25.343958327 -0700
@@ -3,7 +3,8 @@
# Contributor: Daniel Micay <danielmicay@gmail.com>
# Contributor: Patryk Kowalczyk < patryk at kowalczyk dot ws>
-pkgname=libseccomp
+pkgbase=libseccomp
+pkgname=('libseccomp' 'python-libseccomp')
pkgver=2.4.2
pkgrel=1
pkgdesc='Enhanced seccomp library'
@@ -12,10 +13,9 @@
url="https://github.com/seccomp/libseccomp"
depends=('glibc')
checkdepends=('valgrind')
-makedepends=('git')
-provides=('libseccomp.so')
+makedepends=('git' 'cython' 'python-setuptools')
#source=(https://github.com/seccomp/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz{,.asc})
-source=("git+https://github.com/seccomp/${pkgname}?signed#tag=v${pkgver}")
+source=("${pkgbase}-${pkgver}::git+https://github.com/seccomp/${pkgname}?signed#tag=v${pkgver}")
sha256sums=('SKIP')
# XXX: do NOT trust this key as its not yet in the strong set, see linked issue
# XXX: https://github.com/seccomp/libseccomp/issues/187
@@ -24,12 +24,12 @@
validpgpkeys=('7100AADFAE6E6E940D2E0AD655E45A5AE8CA7C8A') # Paul Moore <paul@paul-moore.com>
pkgver() {
- cd ${pkgname}
+ cd ${pkgbase}-${pkgver}
git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
- cd ${pkgname}
+ cd ${pkgbase}-${pkgver}
# assert annotated tag doesn't change
test "$(git rev-parse HEAD)" = "1b6cfd1fc0b7499a28c24299a93a80bd18619563"
# backport: api: define __SNR_ppoll again
@@ -37,20 +37,29 @@
}
build() {
- cd ${pkgname}
+ cd ${pkgbase}-${pkgver}
autoreconf -fiv
./configure --prefix=/usr
make
}
check() {
- cd ${pkgname}
+ cd ${pkgbase}-${pkgver}
make check
}
-package() {
- cd ${pkgname}
- make DESTDIR="${pkgdir}" install
+package_python-libseccomp() {
+ depends=('libseccomp' 'cython')
+ cd ${pkgbase}-${pkgver}/src/python
+ # Environmental variable VERSION_RELEASE is used by setup.py to version python package
+ env VERSION_RELEASE=${pkgver} python ./setup.py build
+ env VERSION_RELEASE=${pkgver} python ./setup.py install --prefix=/usr --root=${pkgdir}
+}
+
+package_libseccomp() {
+ provides=('libseccomp.so')
+ cd ${pkgbase}-${pkgver}
+ make DESTDIR="${pkgdir}"/ install
install -Dm 644 CHANGELOG README.md SECURITY.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment