summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO21
-rw-r--r--0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch37
-rw-r--r--0002-Revert-libselinux-support-new-python3-functions.patch82
-rw-r--r--PKGBUILD58
4 files changed, 40 insertions, 158 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fd7c3717c6a..6edf0e4ecda 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,34 +1,29 @@
pkgbase = libselinux
- pkgdesc = SELinux library and simple utilities
- pkgver = 2.6
- pkgrel = 2
+ pkgdesc = SELinux library and simple utilities and selabel patches
+ pkgver = 2.7
+ pkgrel = 1
url = http://userspace.selinuxproject.org
arch = i686
arch = x86_64
arch = armv6h
groups = selinux
- license = GPL
+ license = custom
makedepends = python2
makedepends = python
makedepends = ruby
makedepends = xz
makedepends = swig
- depends = libsepol
+ depends = libsepol>=2.7
depends = pcre
optdepends = python2: python2 bindings
optdepends = python: python bindings
optdepends = ruby: ruby bindings
- provides = selinux-usr-libselinux=2.6-2
+ provides = selinux-usr-libselinux=2.7-1
conflicts = selinux-usr-libselinux
- options = !emptydirs
- source = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014/libselinux-2.6.tar.gz
+ source = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/libselinux-2.7.tar.gz
source = libselinux.tmpfiles.d
- source = 0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch
- source = 0002-Revert-libselinux-support-new-python3-functions.patch
- sha256sums = 4ea2dde50665c202253ba5caac7738370ea0337c47b251ba981c60d24e1a118a
+ sha256sums = d0fec0769b3ad60aa7baf9b9a4b7a056827769dc2dadda0dc0eb59b3d1c18c57
sha256sums = afe23890fb2e12e6756e5d81bad3c3da33f38a95d072731c0422fbeb0b1fa1fc
- sha256sums = 4d7998c5368a6d13f5b730184b4e9ddb28dd42e1576f8daf12676ca468a935b3
- sha256sums = 82f598ab5c5d21b8b76e887fea43e5d8549f4e9a4047ba3a4cf1a6980ff22eec
pkgname = libselinux
diff --git a/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch b/0001-libselinux-fix-pointer-handling-in-realpath_not_fina.patch
deleted file mode 100644
index 28da417a2cb..00000000000
--- a/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/0002-Revert-libselinux-support-new-python3-functions.patch b/0002-Revert-libselinux-support-new-python3-functions.patch
deleted file mode 100644
index 4570a1074b6..00000000000
--- a/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/PKGBUILD b/PKGBUILD
index 715bc2c33fd..60d4e27f2ee 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,36 +5,24 @@
# Contributor: Zezadas
pkgname=libselinux
-pkgver=2.6
-pkgrel=2
-pkgdesc="SELinux library and simple utilities"
+pkgver=2.7
+pkgrel=1
+pkgdesc="SELinux library and simple utilities and selabel patches"
arch=('i686' 'x86_64' 'armv6h')
url='http://userspace.selinuxproject.org'
-license=('GPL')
+license=('custom')
groups=('selinux')
makedepends=('python2' 'python' 'ruby' 'xz' 'swig')
-depends=('libsepol' 'pcre')
+depends=('libsepol>=2.7' 'pcre')
optdepends=('python2: python2 bindings'
'python: python 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/20161014/${pkgname}-${pkgver}.tar.gz"
- "libselinux.tmpfiles.d"
- '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}"
@@ -49,17 +37,35 @@ build() {
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=/usr/bin/python2 install-pywrap
- make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib PYTHON=/usr/bin/python3 install-pywrap
- make DESTDIR="${pkgdir}" USRBINDIR="${pkgdir}"/usr/bin LIBDIR="${pkgdir}"/usr/lib SHLIBDIR="${pkgdir}"/usr/lib RUBY=/usr/bin/ruby install-rubywrap
+ 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 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}