From ec37205a090590146c529842d6af94221f292e61 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Thu, 16 Mar 2017 20:56:06 +0000 Subject: testing/policycoreutils: initial import Two things to note here: * we drop restorecond because it has quite a few additional dependencies and it's unneeded at this time * The 0002 patch is obviously incorrect, but without it things don't compile, and there's no quick equivalent in musl libc. This will at least let people use some features. Signed-off-by: Tycho Andersen --- ...1-drop-some-binaries-from-policycoreutils.patch | 30 +++++++++++++++++++ .../0002-hack-around-GLOB-BRACE-TILDE.patch | 32 ++++++++++++++++++++ testing/policycoreutils/APKBUILD | 34 ++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 testing/policycoreutils/0001-drop-some-binaries-from-policycoreutils.patch create mode 100644 testing/policycoreutils/0002-hack-around-GLOB-BRACE-TILDE.patch create mode 100644 testing/policycoreutils/APKBUILD diff --git a/testing/policycoreutils/0001-drop-some-binaries-from-policycoreutils.patch b/testing/policycoreutils/0001-drop-some-binaries-from-policycoreutils.patch new file mode 100644 index 00000000000..d9afa92e671 --- /dev/null +++ b/testing/policycoreutils/0001-drop-some-binaries-from-policycoreutils.patch @@ -0,0 +1,30 @@ +From a72fed555a3d2698b3aebc7a429c9f038139308d Mon Sep 17 00:00:00 2001 +From: Tycho Andersen +Date: Thu, 16 Mar 2017 11:48:08 -0700 +Subject: [PATCH] drop some binaries from policycoreutils + +Signed-off-by: Tycho Andersen +--- + policycoreutils/Makefile | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/Makefile b/Makefile +index 962ac12..817fe36 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,11 +1,7 @@ +-SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll ++SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll + + INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null) + +-ifeq (${INOTIFYH}, /usr/include/sys/inotify.h) +- SUBDIRS += restorecond +-endif +- + all install relabel clean indent: + @for subdir in $(SUBDIRS); do \ + (cd $$subdir && $(MAKE) $@) || exit 1; \ +-- +2.11.1 + diff --git a/testing/policycoreutils/0002-hack-around-GLOB-BRACE-TILDE.patch b/testing/policycoreutils/0002-hack-around-GLOB-BRACE-TILDE.patch new file mode 100644 index 00000000000..37e5a8ba1a9 --- /dev/null +++ b/testing/policycoreutils/0002-hack-around-GLOB-BRACE-TILDE.patch @@ -0,0 +1,32 @@ +From e10015ee546c549f1eb93388b5aa9723f510bcdc Mon Sep 17 00:00:00 2001 +From: Tycho Andersen +Date: Tue, 14 Mar 2017 20:53:52 -0700 +Subject: [PATCH 1/2] policycoreutils: hack around GLOB_{BRACE,TILDE} + +Signed-off-by: Tycho Andersen +--- + setfiles/restore.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/setfiles/restore.c b/setfiles/restore.c +index 50d192a..3bc3c39 100644 +--- a/setfiles/restore.c ++++ b/setfiles/restore.c +@@ -6,6 +6,14 @@ + #include "restore.h" + #include + ++#ifndef GLOB_TILDE ++#define GLOB_TILDE 0 ++#endif ++ ++#ifndef GLOB_BRACE ++#define GLOB_BRACE 0 ++#endif ++ + char **exclude_list; + int exclude_count; + +-- +2.11.1 + diff --git a/testing/policycoreutils/APKBUILD b/testing/policycoreutils/APKBUILD new file mode 100644 index 00000000000..c1dd807d5ac --- /dev/null +++ b/testing/policycoreutils/APKBUILD @@ -0,0 +1,34 @@ +# Maintainer: Tycho Andersen +pkgname=policycoreutils +pkgver=2.6 +pkgrel=0 +pkgdesc="SELinux policy core utilities" +url="http://www.selinuxproject.org" +arch="all" +license="GPLv2" +depends="libsepol libselinux libsemanage gettext linux-pam python audit-libs" +depends_dev="" +makedepends="$depends_dev fts-dev libsepol-dev libselinux-dev libsemanage-dev gawk bsd-compat-headers linux-headers gettext-dev linux-pam-dev libcap-ng-dev coreutils python audit-dev" +install="" +subpackages="$pkgname-doc $pkgname-lang" +source="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20161014/policycoreutils-$pkgver.tar.gz + 0001-drop-some-binaries-from-policycoreutils.patch + 0002-hack-around-GLOB-BRACE-TILDE.patch +" +builddir="$srcdir/policycoreutils-$pkgver" +options="suid" + +build() { + cd "$builddir" + # we use the static library for libsepol because it's the only one that exports hasthab_ symbols; the .so doesn't + make LDLIBS="-lintl -lselinux -laudit -lcap-ng -lpam -lpam_misc -lsemanage /usr/lib/libsepol.a" LSPP_PRIV=y || return 1 +} + +package() { + cd "$builddir" + make LSPP_PRIV=y DESTDIR="$pkgdir" install || return 1 +} + +sha512sums="ba289060bc348f9315bce84a5e5daf145600274289fdd2206edc10bb0ee03f9b02a9e40e9c118809961ddfe7844dee7d8952d8c9a239af7282f4fc1614c21e9d policycoreutils-2.6.tar.gz +50fe8865c13a2d05827bc639ce7f04f0754f8b04419cf8580611da5c97857da777183b3643f98c53beab480edfcee3d2b444b7b882d1553b98a899670b6dee03 0001-drop-some-binaries-from-policycoreutils.patch +d611ca3107439fbdb9618a72f55cb66e299fa71392821b223343aa314c65af3e67d6e79ff40e93eca9a20dd0e90c660393c604a18048fcf293374cf2bc61e918 0002-hack-around-GLOB-BRACE-TILDE.patch" -- cgit v1.2.3