aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libselinux
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-02-07 20:00:04 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-02-07 20:02:33 +0000
commit44f8646a925c3c7070e7e0f1cb5811c54b1c105c (patch)
tree3f2d87bcb00b102c27a74e666ba4fcd270354f80 /testing/libselinux
parent9a8f66b0a2f615085618750f15f8259c7357cefa (diff)
downloadaports-44f8646a925c3c7070e7e0f1cb5811c54b1c105c.tar.bz2
aports-44f8646a925c3c7070e7e0f1cb5811c54b1c105c.tar.xz
testing/libselinux: new aport
SELinux library and simple utilities https://github.com/SELinuxProject/selinux/wiki
Diffstat (limited to 'testing/libselinux')
-rw-r--r--testing/libselinux/APKBUILD49
-rw-r--r--testing/libselinux/fts.patch11
-rw-r--r--testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch18
-rw-r--r--testing/libselinux/symlink.patch11
4 files changed, 89 insertions, 0 deletions
diff --git a/testing/libselinux/APKBUILD b/testing/libselinux/APKBUILD
new file mode 100644
index 0000000000..7998aac4a7
--- /dev/null
+++ b/testing/libselinux/APKBUILD
@@ -0,0 +1,49 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=libselinux
+pkgver=2.5
+pkgrel=0
+pkgdesc="SELinux library and simple utilities"
+url="https://github.com/SELinuxProject/selinux/wiki"
+arch="all"
+license="Public Domain"
+depends=""
+depends_dev=""
+makedepends="$depends_dev pcre-dev linux-headers libsepol-dev fts-dev"
+install=""
+subpackages="$pkgname-dev $pkgname-doc $pkgname-utils"
+source="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160223/libselinux-$pkgver.tar.gz
+ libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
+ symlink.patch
+ fts.patch
+ "
+
+builddir="$srcdir/libselinux-$pkgver"
+
+build() {
+ cd "$builddir"
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install || return 1
+}
+
+utils() {
+ pkgdesc="SELinux libselinux utilies"
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/
+}
+
+md5sums="d1399f5c2fd2fbe0e9603d5143b30367 libselinux-2.5.tar.gz
+04b40a63466aa62a99e74cebc2ccc074 libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
+55b8ac1062b9e95e28d1803525a4c3b9 symlink.patch
+de426b7922c739e49c32ff0274e820ff fts.patch"
+sha256sums="94c9e97706280bedcc288f784f67f2b9d3d6136c192b2c9f812115edba58514f libselinux-2.5.tar.gz
+225c9c2dfefc0fa976d829910bc88fcd00744165dad971929d32cbd093904aff libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
+b1db0ab90341417ac43dc75cf615b492685f7ebadb71eaac151e06b333e8d4ce symlink.patch
+759fd63af3a0176e937925604abb5f8f1a687442f9fa3daa449d7ddb387c5190 fts.patch"
+sha512sums="1c6718aa6fa05c8635427cd6f5a89ce47fb6bb9bd2fec417293122826695d1ebb0e0b86e83711abb5c4fe71c67dce6f2e18745592833d1711f0ab2d01246b8c7 libselinux-2.5.tar.gz
+957dac83abb87b004eb1d2b89a1584c91b0939cb8a94b69fce8586a014a38806ee3068336d56b9e99658f6b9d2ffb5292805088e3f522661f0b584e44d096424 libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
+3a4cefdcdd32df7430b38c961e9e20cebf1bdea9fa2fdba9680269426c07b6766d0f4e2f6a0b938c5d6d90110f71729413fe00877740ef592f96c706657b21f1 symlink.patch
+3cd0bc14fad5b6fdbbcbf34070b65eb93c04aef8a7f714a97b27805ec9c384afd04fa0f487562b5f8001a70fb062e440334223e6c04ee977b2102fd71ab4075d fts.patch"
diff --git a/testing/libselinux/fts.patch b/testing/libselinux/fts.patch
new file mode 100644
index 0000000000..aae13c8edd
--- /dev/null
+++ b/testing/libselinux/fts.patch
@@ -0,0 +1,11 @@
+--- ./src/Makefile.orig
++++ ./src/Makefile
+@@ -112,7 +112,7 @@
+ $(RANLIB) $@
+
+ $(LIBSO): $(LOBJS)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -lpcre -ldl $(LDFLAGS) -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
++ $(CC) $(CFLAGS) -shared -o $@ $^ -lpcre -ldl -lfts $(LDFLAGS) -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
+ ln -sf $@ $(TARGET)
+
+ $(LIBPC): $(LIBPC).in ../VERSION
diff --git a/testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch b/testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
new file mode 100644
index 0000000000..5fbfce1136
--- /dev/null
+++ b/testing/libselinux/libselinux-drop-usage-of-_D_ALLOC_NAMLEN.patch
@@ -0,0 +1,18 @@
+diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c
+index 4b39a28..c438af1 100644
+--- a/src/booleans.c
++++ b/src/booleans.c
+@@ -63,12 +63,11 @@ int security_get_boolean_names(char ***names, int *len)
+ }
+
+ for (i = 0; i < *len; i++) {
+- n[i] = (char *)malloc(_D_ALLOC_NAMLEN(namelist[i]));
++ n[i] = strdup(namelist[i]->d_name);
+ if (!n[i]) {
+ rc = -1;
+ goto bad_freen;
+ }
+- strcpy(n[i], namelist[i]->d_name);
+ }
+ rc = 0;
+ *names = n;
diff --git a/testing/libselinux/symlink.patch b/testing/libselinux/symlink.patch
new file mode 100644
index 0000000000..b77264f2f9
--- /dev/null
+++ b/testing/libselinux/symlink.patch
@@ -0,0 +1,11 @@
+--- ./src/Makefile.orig
++++ ./src/Makefile
+@@ -151,7 +151,7 @@
+ install -m 755 $(LIBSO) $(SHLIBDIR)
+ test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
+ install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
+- ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
++ ln -sf $(LIBSO) $(LIBDIR)/$(TARGET)
+
+ install-pywrap: pywrap
+ test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux