summary refs log tree commit diff
path: root/pkgs/os-specific/linux/libselinux
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2013-02-24 13:25:53 +0100
committerVladimír Čunát <vcunat@gmail.com>2013-02-24 13:25:53 +0100
commitde70e3739d2e69806ddfd47efa8b21aa1864b15e (patch)
treea36cce23a53c3a9fd9b7b4e2331572ecbfb2b76c /pkgs/os-specific/linux/libselinux
parentf6b28fad730253d58a89776862cc12a000afbd20 (diff)
downloadnixpkgs-de70e3739d2e69806ddfd47efa8b21aa1864b15e.tar
nixpkgs-de70e3739d2e69806ddfd47efa8b21aa1864b15e.tar.gz
nixpkgs-de70e3739d2e69806ddfd47efa8b21aa1864b15e.tar.bz2
nixpkgs-de70e3739d2e69806ddfd47efa8b21aa1864b15e.tar.lz
nixpkgs-de70e3739d2e69806ddfd47efa8b21aa1864b15e.tar.xz
nixpkgs-de70e3739d2e69806ddfd47efa8b21aa1864b15e.tar.zst
nixpkgs-de70e3739d2e69806ddfd47efa8b21aa1864b15e.zip
SELinux fixes and updates to 2012-09-24
Diffstat (limited to 'pkgs/os-specific/linux/libselinux')
-rw-r--r--pkgs/os-specific/linux/libselinux/default.nix31
-rw-r--r--pkgs/os-specific/linux/libselinux/fPIC.patch13
2 files changed, 38 insertions, 6 deletions
diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix
index 4be88a20e24..873065d5424 100644
--- a/pkgs/os-specific/linux/libselinux/default.nix
+++ b/pkgs/os-specific/linux/libselinux/default.nix
@@ -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";
+  };
+
+  patches = [ ./fPIC.patch ]; # libsemanage seems to need -fPIC everywhere
+
+  buildInputs = [ pkgconfig libsepol pcre ];
 
-  preBuild = '' makeFlags="$makeFlags PREFIX=$out DESTDIR=$out" '';
+  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;
+  };
 }
diff --git a/pkgs/os-specific/linux/libselinux/fPIC.patch b/pkgs/os-specific/linux/libselinux/fPIC.patch
new file mode 100644
index 00000000000..fdc1fa41a33
--- /dev/null
+++ b/pkgs/os-specific/linux/libselinux/fPIC.patch
@@ -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 $@ $<