summaryrefslogtreecommitdiff
path: root/pcr/libselinux
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-02-03 18:54:42 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-02-03 18:54:42 +0100
commit91ad913037120c0dd477547660062da7cbc1177b (patch)
treeb49afeba4b10b92878a28ce1a1d2e24b19ef0c9a /pcr/libselinux
parentbae780d04999a6452e01693690c555df51c9aaf1 (diff)
downloadabslibre-91ad913037120c0dd477547660062da7cbc1177b.tar.gz
abslibre-91ad913037120c0dd477547660062da7cbc1177b.tar.bz2
abslibre-91ad913037120c0dd477547660062da7cbc1177b.zip
pcr/libselinux: updated to 2.7
Diffstat (limited to 'pcr/libselinux')
-rw-r--r--pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch37
-rw-r--r--pcr/libselinux/0002-Revert-libselinux-support-new-python3-functions.patch82
-rw-r--r--pcr/libselinux/PKGBUILD80
-rw-r--r--pcr/libselinux/libselinux.tmpfiles.d (renamed from pcr/libselinux/libselinux.tmpfiles)0
4 files changed, 44 insertions, 155 deletions
diff --git a/pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch b/pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch
deleted file mode 100644
index 28da417a2..000000000
--- a/pcr/libselinux/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 550c0122ee22c5c41bba6cd1ddd5a71529610ada Mon Sep 17 00:00:00 2001
-From: vmojzis <vmojzis@redhat.com>
-Date: Thu, 27 Oct 2016 13:52:36 +0200
-Subject: [PATCH] libselinux: fix pointer handling in realpath_not_final
-
-Loop designed for stripping leading "//" was changing
-the only pointer referencing block of memory allocated
-by "strdup", resulting in "free()" failure. The loop
-had no effect because "realpath" is used later on.
-
-Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1376598
-
-Signed-off-by: vmojzis <vmojzis@redhat.com>
----
- libselinux/src/matchpathcon.c | 6 ------
- 1 file changed, 6 deletions(-)
-
-diff --git a/libselinux/src/matchpathcon.c b/libselinux/src/matchpathcon.c
-index 724eb65097d6..58b4144ac0bf 100644
---- a/libselinux/src/matchpathcon.c
-+++ b/libselinux/src/matchpathcon.c
-@@ -389,12 +389,6 @@ int realpath_not_final(const char *name, char *resolved_path)
- goto out;
- }
-
-- /* strip leading // */
-- while (tmp_path[len] && tmp_path[len] == '/' &&
-- tmp_path[len+1] && tmp_path[len+1] == '/') {
-- tmp_path++;
-- len++;
-- }
- last_component = strrchr(tmp_path, '/');
-
- if (last_component == tmp_path) {
---
-2.10.2
-
diff --git a/pcr/libselinux/0002-Revert-libselinux-support-new-python3-functions.patch b/pcr/libselinux/0002-Revert-libselinux-support-new-python3-functions.patch
deleted file mode 100644
index 4570a1074..000000000
--- a/pcr/libselinux/0002-Revert-libselinux-support-new-python3-functions.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From cc550202c358286c488aba45be2009d6f2d2746d Mon Sep 17 00:00:00 2001
-From: Laurent Bigonville <bigon@bigon.be>
-Date: Wed, 2 Nov 2016 16:24:31 +0100
-Subject: [PATCH] Revert "libselinux: support new python3 functions"
-
-With the reverted commit applied, some functions were returning arrays
-of bytes instead of python strings under python3 this was causing issues
-with string manipulation functions like split().
-
-Swig (checked with 3.0.7) is adding compatibility macros that take care
-of the differences between python2 and python3.
-
-This reverts commit 63df0f7ef12844b9b86cc293299671da772fcf84.
-
-Signed-off-by: Laurent Bigonville <bigon@bigon.be>
----
- libselinux/src/selinuxswig_python.i | 22 +++++++---------------
- 1 file changed, 7 insertions(+), 15 deletions(-)
-
-diff --git a/libselinux/src/selinuxswig_python.i b/libselinux/src/selinuxswig_python.i
-index 8cea18d25dba..43df29153d7c 100644
---- a/libselinux/src/selinuxswig_python.i
-+++ b/libselinux/src/selinuxswig_python.i
-@@ -64,7 +64,7 @@ def install(src, dest):
- PyObject* list = PyList_New(*$2);
- int i;
- for (i = 0; i < *$2; i++) {
-- PyList_SetItem(list, i, PyBytes_FromString((*$1)[i]));
-+ PyList_SetItem(list, i, PyString_FromString((*$1)[i]));
- }
- $result = SWIG_Python_AppendOutput($result, list);
- }
-@@ -97,9 +97,7 @@ def install(src, dest):
- len++;
- plist = PyList_New(len);
- for (i = 0; i < len; i++) {
-- PyList_SetItem(plist, i,
-- PyBytes_FromString((*$1)[i])
-- );
-+ PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
- }
- } else {
- plist = PyList_New(0);
-@@ -116,9 +114,7 @@ def install(src, dest):
- if (*$1) {
- plist = PyList_New(result);
- for (i = 0; i < result; i++) {
-- PyList_SetItem(plist, i,
-- PyBytes_FromString((*$1)[i])
-- );
-+ PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
- }
- } else {
- plist = PyList_New(0);
-@@ -171,20 +167,16 @@ def install(src, dest):
- $1 = (char**) malloc(size + 1);
-
- for(i = 0; i < size; i++) {
-- if (!PyBytes_Check(PySequence_GetItem($input, i))) {
-- PyErr_SetString(PyExc_ValueError, "Sequence must contain only bytes");
--
-+ if (!PyString_Check(PySequence_GetItem($input, i))) {
-+ PyErr_SetString(PyExc_ValueError, "Sequence must contain only strings");
- return NULL;
- }
--
- }
-
- for(i = 0; i < size; i++) {
- s = PySequence_GetItem($input, i);
--
-- $1[i] = (char*) malloc(PyBytes_Size(s) + 1);
-- strcpy($1[i], PyBytes_AsString(s));
--
-+ $1[i] = (char*) malloc(PyString_Size(s) + 1);
-+ strcpy($1[i], PyString_AsString(s));
- }
- $1[size] = NULL;
- }
---
-2.10.2
-
diff --git a/pcr/libselinux/PKGBUILD b/pcr/libselinux/PKGBUILD
index 6db0a0641..d974a108a 100644
--- a/pcr/libselinux/PKGBUILD
+++ b/pcr/libselinux/PKGBUILD
@@ -1,18 +1,20 @@
-# Maintainer: Luke Shumaker <lukeshu@parabola.nu>
-# Maintainer (AUR): Nicolas Iooss <nicolas.iooss@m4x.org>
+# Maintainer (AUR): Nicolas Iooss (nicolas <dot> iooss <at> m4x <dot> org)
# Contributor (AUR): Timothée Ravier <tim@siosm.fr>
-# Contributor (AUR): Nicky726 <Nicky726@gmail.com>
-# Contributor (AUR): Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor (AUR): Nicky726 (Nicky726 <at> gmail <dot> com)
+# Contributor (AUR): Sergej Pupykin (pupykin <dot> s+arch <at> gmail <dot> com)
# Contributor (AUR): Zezadas
+# Maintainer: Luke Shumaker <lukeshu@parabola.nu>
+
+# parabola changes and rationale:
+# - corrected license
pkgname=libselinux
-_reldate=20161014
-pkgver=2.6
-pkgrel=2
+pkgver=2.7
+pkgrel=1
pkgdesc="SELinux library and simple utilities"
arch=('i686' 'x86_64' 'armv7h')
-url='https://github.com/SELinuxProject/selinux/wiki/Userspace-Packages'
-license=('GPL')
+url='http://userspace.selinuxproject.org'
+license=('GPL2')
groups=('selinux')
makedepends=('python2' 'python' 'ruby' 'xz' 'swig')
depends=('libsepol' 'pcre')
@@ -21,22 +23,10 @@ optdepends=('python2: python2 bindings'
'ruby: ruby bindings')
conflicts=("selinux-usr-${pkgname}")
provides=("selinux-usr-${pkgname}=${pkgver}-${pkgrel}")
-options=(!emptydirs)
-source=("https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${_reldate}/${pkgname}-${pkgver}.tar.gz"
- "libselinux.tmpfiles"
- '0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch'
- '0002-Revert-libselinux-support-new-python3-functions.patch')
-sha256sums=('4ea2dde50665c202253ba5caac7738370ea0337c47b251ba981c60d24e1a118a'
- 'afe23890fb2e12e6756e5d81bad3c3da33f38a95d072731c0422fbeb0b1fa1fc'
- '4d7998c5368a6d13f5b730184b4e9ddb28dd42e1576f8daf12676ca468a935b3'
- '82f598ab5c5d21b8b76e887fea43e5d8549f4e9a4047ba3a4cf1a6980ff22eec')
-
-prepare() {
- cd "${pkgname}-${pkgver}"
-
- patch -Np2 -i '../0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch'
- patch -Np2 -i '../0002-Revert-libselinux-support-new-python3-functions.patch'
-}
+source=("https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/${pkgname}-${pkgver}.tar.gz"
+ "libselinux.tmpfiles.d")
+sha256sums=('d0fec0769b3ad60aa7baf9b9a4b7a056827769dc2dadda0dc0eb59b3d1c18c57'
+ 'afe23890fb2e12e6756e5d81bad3c3da33f38a95d072731c0422fbeb0b1fa1fc')
build() {
cd "${pkgname}-${pkgver}"
@@ -46,22 +36,40 @@ build() {
make swigify
make all
- make PYTHON=python2 pywrap
- make PYTHON=python3 pywrap
- make rubywrap
+ make PYTHON=/usr/bin/python2 pywrap
+ make PYTHON=/usr/bin/python3 pywrap
+ make RUBY=/usr/bin/ruby rubywrap
}
-package(){
+package() {
cd "${pkgname}-${pkgver}"
export DISABLE_RPM=y
- make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib install
- make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib PYTHON=python2 install-pywrap
- make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib PYTHON=python3 install-pywrap
- make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib install-rubywrap
- python2 -m compileall "${pkgdir}/$(python2 -c 'import site; print(site.getsitepackages()[0])')"
- python3 -m compileall "${pkgdir}/$(python3 -c 'import site; print(site.getsitepackages()[0])')"
+ make DESTDIR="${pkgdir}" \
+ LIBSEPOLA=/usr/lib/libsepol.a \
+ SBINDIR="${pkgdir}/usr/bin" \
+ SHLIBDIR="${pkgdir}/usr/lib" \
+ install
+ make DESTDIR="${pkgdir}" PYTHON=/usr/bin/python2 \
+ LIBSEPOLA=/usr/lib/libsepol.a \
+ SBINDIR="${pkgdir}/usr/bin" \
+ SHLIBDIR="${pkgdir}/usr/lib" \
+ install-pywrap
+ make DESTDIR="${pkgdir}" PYTHON=/usr/bin/python3 \
+ LIBSEPOLA=/usr/lib/libsepol.a \
+ SBINDIR="${pkgdir}/usr/bin" \
+ SHLIBDIR="${pkgdir}/usr/lib" \
+ install-pywrap
+ make DESTDIR="${pkgdir}" RUBY=/usr/bin/ruby \
+ LIBSEPOLA=/usr/lib/libsepol.a \
+ SBINDIR="${pkgdir}/usr/bin" \
+ SHLIBDIR="${pkgdir}/usr/lib" \
+ install-rubywrap
+ /usr/bin/python2 -m compileall "${pkgdir}/$(/usr/bin/python2 -c 'import site; print(site.getsitepackages()[0])')"
+ /usr/bin/python3 -m compileall "${pkgdir}/$(/usr/bin/python3 -c 'import site; print(site.getsitepackages()[0])')"
+
+ install -Dm 0644 "${srcdir}"/libselinux.tmpfiles.d "${pkgdir}"/usr/lib/tmpfiles.d/libselinux.conf
- install -Dm 0644 "${srcdir}"/libselinux.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/libselinux.conf
+ install -Dm 0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/pcr/libselinux/libselinux.tmpfiles b/pcr/libselinux/libselinux.tmpfiles.d
index b2aaf2e4c..b2aaf2e4c 100644
--- a/pcr/libselinux/libselinux.tmpfiles
+++ b/pcr/libselinux/libselinux.tmpfiles.d