summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Iooss2017-08-11 13:56:40 +0200
committerNicolas Iooss2017-08-11 13:56:40 +0200
commit271ed425743b4b23e0c89d5070b61ecacd1fd5d1 (patch)
tree479890fc1745ea187191a7bcff3fc16f32993341
downloadaur-271ed425743b4b23e0c89d5070b61ecacd1fd5d1.tar.gz
Create selinux-python package
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD52
2 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fb257d512372
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = selinux-python
+ pkgdesc = SELinux python tools and libraries
+ pkgver = 2.7
+ pkgrel = 1
+ url = https://github.com/SELinuxProject/selinux/wiki
+ arch = i686
+ arch = x86_64
+ groups = selinux
+ license = GPL2
+ makedepends = python2
+ makedepends = python
+ makedepends = python-ipy
+ makedepends = libsemanage>=2.7
+ makedepends = setools>=4.0.0
+ provides = sepolgen=2.7-1
+ conflicts = sepolgen<2.7
+ conflicts = policycoreutils<2.7
+ source = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/selinux-python-2.7.tar.gz
+ sha256sums = 4217cb965ecda96c91e15ffcc2e7ddd13ecc2bf5631100f3cd072a7616f140ed
+
+pkgname = selinux-python
+ depends = python
+ depends = python-ipy
+ depends = libsemanage>=2.7
+ depends = setools>=4.0.0
+
+pkgname = selinux-python2
+ depends = python2
+ depends = libsemanage>=2.7
+ depends = setools>=4.0.0
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..5ea6b8cf182d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,52 @@
+# Maintainer: Nicolas Iooss (nicolas <dot> iooss <at> m4x <dot> org)
+
+pkgbase=selinux-python
+pkgname=(selinux-python selinux-python2)
+pkgver=2.7
+pkgrel=1
+pkgdesc="SELinux python tools and libraries"
+groups=('selinux')
+arch=('i686' 'x86_64')
+url='https://github.com/SELinuxProject/selinux/wiki'
+license=('GPL2')
+makedepends=('python2' 'python' 'python-ipy' 'libsemanage>=2.7' 'setools>=4.0.0')
+conflicts=('sepolgen<2.7' 'policycoreutils<2.7')
+provides=("sepolgen=${pkgver}-${pkgrel}")
+source=("https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/${pkgname}-${pkgver}.tar.gz")
+sha256sums=('4217cb965ecda96c91e15ffcc2e7ddd13ecc2bf5631100f3cd072a7616f140ed')
+
+build() {
+ cd "${pkgbase}-${pkgver}"
+ make PYTHON=/usr/bin/python2
+ make PYTHON=/usr/bin/python3
+}
+
+package_selinux-python() {
+ depends=('python' 'python-ipy' 'libsemanage>=2.7' 'setools>=4.0.0')
+
+ cd "${pkgbase}-${pkgver}"
+ make PYTHON=/usr/bin/python3 DESTDIR="${pkgdir}" \
+ LIBSEPOLA=/usr/lib/libsepol.a \
+ SBINDIR="${pkgdir}/usr/bin" \
+ install
+ /usr/bin/python3 -m compileall "${pkgdir}/$(/usr/bin/python3 -c 'import site; print(site.getsitepackages()[0])')"
+}
+
+package_selinux-python2() {
+ depends=('python2' 'libsemanage>=2.7' 'setools>=4.0.0')
+
+ cd "${pkgbase}-${pkgver}"
+ # Guide the files which would conflict with selinux-python package into a
+ # special directory, which would then be removed
+ make PYTHON=/usr/bin/python2 DESTDIR="${pkgdir}" \
+ BASHCOMPLETIONDIR="${pkgdir}/removed" \
+ BINDIR="${pkgdir}/removed" \
+ LIBDIR="${pkgdir}/removed" \
+ LIBSEPOLA=/usr/lib/libsepol.a \
+ MANDIR="${pkgdir}/removed" \
+ SBINDIR="${pkgdir}/removed" \
+ SHAREDIR="${pkgdir}/removed" \
+ install
+ rm -r "${pkgdir}/removed"
+ /usr/bin/python2 -m compileall "${pkgdir}/$(/usr/bin/python2 -c 'import site; print(site.getsitepackages()[0])')"
+}