tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
Apparmor: update to 2.8.1
Evgeny Egorochkin
12 years ago
0ef509b1
5c95ebf3
+37
-5
2 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
apparmor
capability.patch
default.nix
+16
pkgs/os-specific/linux/apparmor/capability.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
Description: allow parser to build even when not on Linux.
2
+
Author: Kees Cook <kees@debian.org>
3
+
4
+
Index: apparmor-debian/common/Make.rules
5
+
===================================================================
6
+
--- apparmor-debian.orig/common/Make.rules 2012-05-05 14:41:25.967259523 -0700
7
+
+++ apparmor-debian/common/Make.rules 2012-05-05 14:41:28.451291053 -0700
8
+
@@ -160,7 +160,7 @@
9
+
CAPABILITIES=$(shell echo "\#include <linux/capability.h>" | cpp -dM | LC_ALL=C sed -n -e '/CAP_EMPTY_SET/d' -e 's/^\#define[ \t]\+CAP_\([A-Z0-9_]\+\)[ \t]\+\([0-9xa-f]\+\)\(.*\)$$/CAP_\1/p' | sort)
10
+
11
+
.PHONY: list_capabilities
12
+
-list_capabilities: /usr/include/linux/capability.h
13
+
+list_capabilities:
14
+
@echo "$(CAPABILITIES)"
15
+
16
+
# =====================
+21
-5
pkgs/os-specific/linux/apparmor/default.nix
···
1
{ stdenv, fetchurl
2
, autoconf, automake, libtool, makeWrapper
3
-
, perl, bison, flex, glibc, gettext, which, rpm, tetex, LocaleGettext, bash, pam, TermReadKey, RpcXML, swig}:
0
4
stdenv.mkDerivation rec {
5
6
name = "apparmor-${version}";
7
-
version = "2.6.1";
8
9
src = fetchurl {
10
-
url = "http://launchpad.net/apparmor/2.6/2.6.1/+download/${name}.tar.gz";
11
-
sha256 = "1x7225xgzyc5agbn41xsip236anr1kmaw70xc94pag82q7c1bc4w";
12
};
13
14
-
buildInputs = [ autoconf automake libtool perl bison flex gettext which rpm tetex LocaleGettext pam TermReadKey RpcXML swig makeWrapper ];
0
0
15
16
prePatch = ''
17
substituteInPlace libraries/libapparmor/src/Makefile.in --replace "/usr/include" "${glibc}/include"
···
24
substituteInPlace parser/Makefile --replace "/usr/include/bits/socket.h" "${glibc}/include/bits/socket.h"
25
substituteInPlace parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
26
0
0
0
27
substituteInPlace parser/tst/gen-xtrans.pl --replace "/usr/bin/perl" "${perl}/bin/perl"
28
substituteInPlace parser/tst/Makefile --replace "/usr/bin/prove" "${perl}/bin/prove"
29
substituteInPlace parser/tst/Makefile --replace "./caching.sh" "${bash}/bin/bash ./caching.sh"
30
'';
0
0
31
32
buildPhase =''
33
PERL5LIB=$PERL5LIB:$out/lib/perl5/site_perl:$out/lib
···
78
"${src}/kernel-patches/2.6.37/0001-AppArmor-compatibility-patch-for-v5-network-controll.patch"
79
"${src}/kernel-patches/2.6.37/0002-AppArmor-compatibility-patch-for-v5-interface.patch"
80
"${src}/kernel-patches/2.6.37/0003-AppArmor-Allow-dfa-backward-compatibility-with-broke.patch"
0
0
0
0
0
0
0
0
81
];
82
};
83
};
···
1
{ stdenv, fetchurl
2
, autoconf, automake, libtool, makeWrapper
3
+
, perl, bison, flex, glibc, gettext, which, rpm, tetex, LocaleGettext
4
+
, bash, pam, TermReadKey, RpcXML, swig, python }:
5
stdenv.mkDerivation rec {
6
7
name = "apparmor-${version}";
8
+
version = "2.8.1";
9
10
src = fetchurl {
11
+
url = "http://launchpad.net/apparmor/2.8/${version}/+download/${name}.tar.gz";
12
+
sha256 = "1r0a5k14jbiik28m5gql0f3dbxl252jya7i120rrsbzqqnvw6nw7";
13
};
14
15
+
buildInputs = [
16
+
autoconf automake libtool perl bison flex gettext which rpm tetex
17
+
LocaleGettext pam TermReadKey RpcXML swig makeWrapper python ];
18
19
prePatch = ''
20
substituteInPlace libraries/libapparmor/src/Makefile.in --replace "/usr/include" "${glibc}/include"
···
27
substituteInPlace parser/Makefile --replace "/usr/include/bits/socket.h" "${glibc}/include/bits/socket.h"
28
substituteInPlace parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
29
30
+
# for some reason pdf documentation doesn't build
31
+
substituteInPlace parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages"
32
+
33
substituteInPlace parser/tst/gen-xtrans.pl --replace "/usr/bin/perl" "${perl}/bin/perl"
34
substituteInPlace parser/tst/Makefile --replace "/usr/bin/prove" "${perl}/bin/prove"
35
substituteInPlace parser/tst/Makefile --replace "./caching.sh" "${bash}/bin/bash ./caching.sh"
36
'';
37
+
38
+
patches = ./capability.patch;
39
40
buildPhase =''
41
PERL5LIB=$PERL5LIB:$out/lib/perl5/site_perl:$out/lib
···
86
"${src}/kernel-patches/2.6.37/0001-AppArmor-compatibility-patch-for-v5-network-controll.patch"
87
"${src}/kernel-patches/2.6.37/0002-AppArmor-compatibility-patch-for-v5-interface.patch"
88
"${src}/kernel-patches/2.6.37/0003-AppArmor-Allow-dfa-backward-compatibility-with-broke.patch"
89
+
];
90
+
};
91
+
linux_3_2_patch = {
92
+
features.apparmor = true;
93
+
patch = [
94
+
"${src}/kernel-patches/3.2/0001-AppArmor-compatibility-patch-for-v5-network-controll.patch"
95
+
"${src}/kernel-patches/3.2/0002-AppArmor-compatibility-patch-for-v5-interface.patch"
96
+
"${src}/kernel-patches/3.2/0003-AppArmor-Allow-dfa-backward-compatibility-with-broke.patch"
97
];
98
};
99
};