summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2015-07-15 09:31:40 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2015-08-26 22:58:12 +0200
commited5f6be317176d9a9eeeb2081744050027d77410 (patch)
tree871a94ffba1122c7456f0e1718ad8eeccf5dd6cc /pkgs/os-specific
parent1dd8dd4ca8c86f9b3b8b14783dd3390e6b239ef5 (diff)
downloadnixpkgs-ed5f6be317176d9a9eeeb2081744050027d77410.tar
nixpkgs-ed5f6be317176d9a9eeeb2081744050027d77410.tar.gz
nixpkgs-ed5f6be317176d9a9eeeb2081744050027d77410.tar.bz2
nixpkgs-ed5f6be317176d9a9eeeb2081744050027d77410.tar.lz
nixpkgs-ed5f6be317176d9a9eeeb2081744050027d77410.tar.xz
nixpkgs-ed5f6be317176d9a9eeeb2081744050027d77410.tar.zst
nixpkgs-ed5f6be317176d9a9eeeb2081744050027d77410.zip
apparmor: use standard phase hooks
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/apparmor/default.nix63
1 files changed, 18 insertions, 45 deletions
diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix
index d770314ee68..33625cc3681 100644
--- a/pkgs/os-specific/linux/apparmor/default.nix
+++ b/pkgs/os-specific/linux/apparmor/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, perl, which
+{ stdenv, fetchurl, autoconf, autoreconfHook, automake, libtool, pkgconfig, perl, which
 , glibc, flex, bison, python27, swig, pam
 }:
 
@@ -33,6 +33,7 @@ let
     buildInputs = [
       autoconf
       automake
+      autoreconfHook
       bison
       flex
       glibc
@@ -44,21 +45,16 @@ let
       which
     ];
 
+    # required to build apparmor-parser
+    dontDisableStatic = true;
+
     prePatch = prePatchCommon + ''
       substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h"
       substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h"
       '';
 
-    buildPhase = ''
-      cd ./libraries/libapparmor
-      ./autogen.sh
-      ./configure --prefix="$out" --with-python --with-perl
-      make
-      '';
-
-    installPhase = ''
-      make install
-    '';
+    postPatch = "cd ./libraries/libapparmor";
+    configureFlags = "--with-python --with-perl";
 
     meta = apparmor-meta "library";
   };
@@ -74,15 +70,9 @@ let
     ];
 
     prePatch = prePatchCommon;
-
-    buildPhase = ''
-      cd ./utils
-      make LANGS=""
-    '';
-
-    installPhase = ''
-      make install LANGS="" DESTDIR="$out" BINDIR="$out/bin" VIM_INSTALL_PATH="$out/share" PYPREFIX=""
-    '';
+    postPatch = "cd ./utils";
+    makeFlags = ''LANGS='';
+    installFlags = ''DESTDIR=$(out) BINDIR=$(out)/bin VIM_INSTALL_PATH=$(out)/share PYPREFIX='';
 
     meta = apparmor-meta "user-land utilities";
   };
@@ -105,15 +95,9 @@ let
       ## techdoc.pdf still doesn't build ...
       substituteInPlace ./parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages"
     '';
-
-    buildPhase = ''
-      cd ./parser
-      make LANGS="" USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include
-    '';
-
-    installPhase = ''
-      make install LANGS="" USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include DESTDIR="$out" DISTRO="unknown"
-    '';
+    postPatch = "cd ./parser";
+    makeFlags = ''LANGS= USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include'';
+    installFlags = ''DESTDIR=$(out) DISTRO=unknown'';
 
     meta = apparmor-meta "rule parser";
   };
@@ -129,14 +113,9 @@ let
       which
     ];
 
-    buildPhase = ''
-      cd ./changehat/pam_apparmor
-      make USE_SYSTEM=1
-    '';
-
-    installPhase = ''
-      make install DESTDIR="$out"
-    '';
+    postPatch = "cd ./changehat/pam_apparmor";
+    makeFlags = ''USE_SYSTEM=1'';
+    installFlags = ''DESTDIR=$(out)'';
 
     meta = apparmor-meta "PAM service";
   };
@@ -147,14 +126,8 @@ let
 
     buildInputs = [ which ];
 
-    buildPhase = ''
-      cd ./profiles
-      make
-    '';
-
-    installPhase = ''
-      make install DESTDIR="$out" EXTRAS_DEST="$out/share/apparmor/extra-profiles"
-    '';
+    postPatch = "cd ./profiles";
+    installFlags = ''DESTDIR=$(out) EXTRAS_DEST=$(out)/share/apparmor/extra-profiles'';
 
     meta = apparmor-meta "profiles";
   };