SELinux fixes and updates to 2012-09-24

This commit is contained in:
Vladimír Čunát
2013-02-24 13:25:53 +01:00
parent f6b28fad73
commit de70e3739d
10 changed files with 144 additions and 38 deletions
+25 -6
View File
@@ -1,15 +1,34 @@
{stdenv, fetchurl, libsepol}:
{ stdenv, fetchurl, pkgconfig, libsepol, pcre }:
stdenv.mkDerivation rec {
name = "libselinux-${version}";
version = "2.0.98";
version = "2.1.12";
inherit (libsepol) se_release se_url;
src = fetchurl {
url = "http://userspace.selinuxproject.org/releases/20101221/devel/${name}.tar.gz";
sha256 = "00irm7nyakgi4z8d6dlm6c70fkbl6rzk5w1w0ny2c564yw0d0dlz";
url = "${se_url}/${se_release}/libselinux-${version}.tar.gz";
sha256 = "17navgvljgq35bljzcdwjdj3khajc27s15binr51xkp0h29qgbcd";
};
buildInputs = [ libsepol ];
patch_src = fetchurl {
url = "http://dev.gentoo.org/~swift/patches/libselinux/patchbundle-${name}-r2.tar.gz";
sha256 = "08zaas8iwyf4w9ll1ylyv4gril1nfarckd5h1l53563sxzyf7dqh";
};
preBuild = '' makeFlags="$makeFlags PREFIX=$out DESTDIR=$out" '';
patches = [ ./fPIC.patch ]; # libsemanage seems to need -fPIC everywhere
buildInputs = [ pkgconfig libsepol pcre ];
prePatch = ''
tar xvf ${patch_src}
for p in gentoo-patches/*.patch; do
patch -p1 < "$p"
done
'';
preInstall = '' makeFlags="$makeFlags PREFIX=$out DESTDIR=$out" '';
meta = {
inherit (libsepol.meta) homepage platforms maintainers;
};
}
@@ -0,0 +1,13 @@
diff --git a/src/Makefile b/src/Makefile
index ac019df..00432b9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -132,7 +132,7 @@ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
%.o: %.c policy.h
- $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(TLSFLAGS) -fPIC -c -o $@ $<
%.lo: %.c policy.h
$(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<