summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Julien Pivotto <roidelapluie@inuits.eu> 2016-05-16 23:02:22 +0200
committerAvatar Wulf C. Krueger <philantrop@exherbo.org> 2016-05-21 09:32:16 +0200
commit74d42d92cc6f0687c96c655a5468604fd06e4793 (patch)
treef0707f1792dabf85b17319f15c35471895e4173a
parentd23fb47a7366319e1bbddf753d6fe00787584304 (diff)
downloadselinux-74d42d92cc6f0687c96c655a5468604fd06e4793.tar.gz
selinux-74d42d92cc6f0687c96c655a5468604fd06e4793.tar.xz
Add libsemanage
Change-Id: I7fa1fbd2724afae047f10cad988ddb5baa293285 Reviewed-on: https://galileo.mailstation.de/gerrit/5971 Retest: Julien Pivotto <roidelapluie@inuits.eu> Reviewed-by: Jenkins <wk@mailstation.de> Reviewed-by: Wulf C. Krueger <philantrop@exherbo.org>
-rw-r--r--packages/security/libsemanage/files/libsemanage-respect-prefixed-tools.patch56
-rw-r--r--packages/security/libsemanage/files/libsemanage-support-overriding-randlib.patch26
-rw-r--r--packages/security/libsemanage/libsemanage-2.5.exheres-039
3 files changed, 121 insertions, 0 deletions
diff --git a/packages/security/libsemanage/files/libsemanage-respect-prefixed-tools.patch b/packages/security/libsemanage/files/libsemanage-respect-prefixed-tools.patch
new file mode 100644
index 0000000..1cc5dd4
--- /dev/null
+++ b/packages/security/libsemanage/files/libsemanage-respect-prefixed-tools.patch
@@ -0,0 +1,56 @@
+From 93cf6aa5218f7d78e61e340cee8318cc44381964 Mon Sep 17 00:00:00 2001
+From: Julien Pivotto <roidelapluie@inuits.eu>
+Date: Mon, 16 May 2016 20:50:59 +0200
+Subject: [PATCH] libselinux, libsemanage: respect CC and PKG_CONFIG
+ environment variable
+Upstream: yes
+Source: exherbo
+
+
+Compilation tools respects certain environment variables, like CC.
+However, in libselinux and libsemanage, they are not respected
+everywhere. This command fixes respect for those variables, falling back
+to the previous hardcoded values if not specified.
+---
+ libsemanage/src/Makefile | 5 +++--
+ libsemanage/src/exception.sh | 2 +-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index d1fcc0b..b0711a7 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -5,6 +5,7 @@ PYTHON ?= python
+ PYPREFIX ?= $(notdir $(PYTHON))
+ RUBY ?= ruby
+ RUBYPREFIX ?= $(notdir $(RUBY))
++PKG_CONFIG ?= pkg-config
+
+ # Installation directories.
+ PREFIX ?= $(DESTDIR)/usr
+@@ -12,11 +13,11 @@ LIBDIR ?= $(PREFIX)/lib
+ SHLIBDIR ?= $(DESTDIR)/lib
+ INCLUDEDIR ?= $(PREFIX)/include
+ PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])')
+-PYINC ?= $(shell pkg-config --cflags $(PYPREFIX))
++PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
+ PYLIBDIR ?= $(LIBDIR)/$(PYLIBVER)
+ RUBYLIBVER ?= $(shell $(RUBY) -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
+ RUBYPLATFORM ?= $(shell $(RUBY) -e 'print RUBY_PLATFORM')
+-RUBYINC ?= $(shell pkg-config --cflags ruby-$(RUBYLIBVER))
++RUBYINC ?= $(shell $(PKG_CONFIG) --cflags ruby-$(RUBYLIBVER))
+ RUBYINSTALL ?= $(LIBDIR)/ruby/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
+
+ LIBBASE=$(shell basename $(LIBDIR))
+diff --git a/src/exception.sh b/src/exception.sh
+index 94619d2..d18959c 100644
+--- a/src/exception.sh
++++ b/src/exception.sh
+@@ -9,6 +9,6 @@ echo "
+ }
+ "
+ }
+-gcc -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
++${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
+ for i in `awk '/extern int/ { print $6 }' temp.aux`; do except $i ; done
+ rm -f -- temp.aux -.o
diff --git a/packages/security/libsemanage/files/libsemanage-support-overriding-randlib.patch b/packages/security/libsemanage/files/libsemanage-support-overriding-randlib.patch
new file mode 100644
index 0000000..aa5fcf1
--- /dev/null
+++ b/packages/security/libsemanage/files/libsemanage-support-overriding-randlib.patch
@@ -0,0 +1,26 @@
+From: Julien Pivotto <roidelapluie@inuits.eu>
+Date: Thu, 12 May 2016 21:57:26 +0200
+Subject: [PATCH] libsemanage: Support overriding Makefile RANLIB
+Upstream: yes
+Source: exherbo
+
+---
+ libsemanage/src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/libsemanage/src/Makefile
+index d1fcc0b..71eadd6 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -61,7 +61,7 @@ SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable -Wno
+ -Wno-unused-parameter
+
+ override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE
+-RANLIB=ranlib
++RANLIB ?= ranlib
+
+ SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+
+--
+2.6.1
+
diff --git a/packages/security/libsemanage/libsemanage-2.5.exheres-0 b/packages/security/libsemanage/libsemanage-2.5.exheres-0
new file mode 100644
index 0000000..69a88bd
--- /dev/null
+++ b/packages/security/libsemanage/libsemanage-2.5.exheres-0
@@ -0,0 +1,39 @@
+# Copyright 2016 Julien Pivotto <roidelapluie@inuits.eu>
+# Distributed under the terms of the GNU General Public License v2
+
+require github [ user=SELinuxProject tag="${PNV}" pn=selinux ]
+
+SUMMARY="SELinux Policy management library"
+DESCRIPTION="libsemanage contains shared libraries for SELinux policy management."
+
+BUGS_TO="roidelapluie@inuits.eu"
+
+LICENCES="LGPL-2.1"
+SLOT="0"
+PLATFORMS="~amd64"
+MYOPTIONS=""
+
+DEPENDENCIES="
+ build+run:
+ app-admin/audit
+ dev-libs/ustr
+ security/libselinux[~${PV}]
+ security/libsepol[~${PV}]
+ test:
+ dev-util/cunit
+"
+
+DEFAULT_SRC_PREPARE_PATCHES=(
+ "${FILES}/${PN}-support-overriding-randlib.patch"
+ "${FILES}/${PN}-respect-prefixed-tools.patch"
+)
+
+DEFAULT_SRC_TEST_PARAMS=(
+ CC="${CC}"
+ LIBS="../src/libsemanage.a /usr/$(exhost --target)/lib/libselinux.a /usr/$(exhost --target)/lib/libsepol.a"
+)
+
+DEFAULT_SRC_INSTALL_PARAMS=( PREFIX=${IMAGE}/usr/$(exhost --target) )
+
+WORK="${WORKBASE}/selinux-${PNV}/${PN}"
+