summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/os-specific/linux/audit/default.nix58
-rw-r--r--pkgs/os-specific/linux/libsemanage/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix8
3 files changed, 54 insertions, 16 deletions
diff --git a/pkgs/os-specific/linux/audit/default.nix b/pkgs/os-specific/linux/audit/default.nix
index 05b9eb9e56f..8365017d13b 100644
--- a/pkgs/os-specific/linux/audit/default.nix
+++ b/pkgs/os-specific/linux/audit/default.nix
@@ -1,29 +1,61 @@
-{ stdenv, fetchurl, openldap
-, enablePython ? false, python ? null
+{ stdenv, fetchurl
+, libcap_ng
+
+# Optional Dependencies
+, openldap ? null, python ? null, go ? null, krb5 ? null, tcp_wrappers ? null
+
+# Extra arguments
+, prefix ? ""
 }:
 
-assert enablePython -> python != null;
+with stdenv;
+let
+  libOnly = prefix == "lib";
 
+  optOpenldap = if libOnly then null else shouldUsePkg openldap;
+  optPython = shouldUsePkg python;
+  optGo = shouldUsePkg go;
+  optKrb5 = if libOnly then null else shouldUsePkg krb5;
+  optTcp_wrappers = if libOnly then null else shouldUsePkg tcp_wrappers;
+in
+with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "audit-2.4.1";
+  name = "${prefix}audit-${version}";
+  version = "2.4.2";
 
   src = fetchurl {
-    url = "http://people.redhat.com/sgrubb/audit/${name}.tar.gz";
-    sha256 = "09ihn392pmac1pyjrs22966csia83yr84hq5ri6sybwj1vx4d4q5";
+    url = "http://people.redhat.com/sgrubb/audit/audit-${version}.tar.gz";
+    sha256 = "08j134s4509rxfi3hwsp8yyxzlqqxl8kqgv2rfv6p3qng5pjd80j";
   };
 
-  buildInputs = [ openldap ]
-            ++ stdenv.lib.optional enablePython python;
+  buildInputs = [ libcap_ng optOpenldap optPython optGo optKrb5 optTcp_wrappers ];
 
-  configureFlags = ''
-    ${if enablePython then "--with-python" else "--without-python"}
+  # For libs only build and install the lib portion
+  preBuild = optionalString libOnly ''
+    cd lib
   '';
 
+  configureFlags = [
+    (mkWith   (optPython != null)       "python"      null)
+    (mkWith   (optGo != null)           "golang"      null)
+    (mkEnable (!libOnly)                "listener"    null)
+    (mkEnable (optKrb5 != null)         "gssapi-krb5" null)
+    (mkEnable false                     "systemd"     null)
+    (mkWith   false                     "debug"       null)
+    (mkWith   false                     "warn"        null)
+    (mkWith   false                     "alpha"       null)  # TODO: Support
+    (mkWith   false                     "arm"         null)  # TODO: Support
+    (mkWith   false                     "aarch64"     null)  # TODO: Support
+    (mkWith   (!libOnly)                "apparmor"    null)
+    (mkWith   false                     "prelude"     null)
+    (mkWith   (optTcp_wrappers != null) "libwrap"     optTcp_wrappers)
+  ];
+
   meta = {
     description = "Audit Library";
     homepage = "http://people.redhat.com/sgrubb/audit/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ fuuzetsu wkennington ];
   };
 }
diff --git a/pkgs/os-specific/linux/libsemanage/default.nix b/pkgs/os-specific/linux/libsemanage/default.nix
index 599da9e4b3c..fbb4be53211 100644
--- a/pkgs/os-specific/linux/libsemanage/default.nix
+++ b/pkgs/os-specific/linux/libsemanage/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libsepol, libselinux, ustr, bzip2, bison, flex, audit }:
+{ stdenv, fetchurl, libsepol, libselinux, ustr, bzip2, bison, flex, libaudit }:
 stdenv.mkDerivation rec {
 
   name = "libsemanage-${version}";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-fstack-protector-all";
   NIX_CFLAGS_LINK = "-lsepol";
 
-  buildInputs = [ libsepol libselinux ustr bzip2 bison flex audit ];
+  buildInputs = [ libsepol libselinux ustr bzip2 bison flex libaudit ];
 
   meta = with stdenv.lib; {
     inherit (libsepol.meta) homepage platforms maintainers;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index b55ab8ae927..f68a7cd6137 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9177,7 +9177,13 @@ let
 
   atop = callPackage ../os-specific/linux/atop { };
 
-  audit = callPackage ../os-specific/linux/audit { };
+  audit = callPackage ../os-specific/linux/audit {
+    python = null;
+    go = null;
+  };
+  libaudit = audit.override {
+    prefix = "lib";
+  };
 
   b43Firmware_5_1_138 = callPackage ../os-specific/linux/firmware/b43-firmware/5.1.138.nix { };