1 |
commit: 514bb9c90fb2641b7af156c4d504185dc10db795 |
2 |
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 10 09:33:24 2020 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 10 09:44:03 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=514bb9c9 |
7 |
|
8 |
sys-apps/apparmor: version bump 3.0.0 |
9 |
|
10 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
11 |
Signed-off-by: Michael Palimaka <kensington <AT> gentoo.org> |
12 |
|
13 |
sys-apps/apparmor/Manifest | 1 + |
14 |
sys-apps/apparmor/apparmor-3.0.0.ebuild | 67 ++++++++++++++++ |
15 |
.../apparmor/files/apparmor-3.0.0-makefile.patch | 18 +++++ |
16 |
sys-apps/apparmor/files/apparmor-init-1 | 88 ++++++++++++++++++++++ |
17 |
4 files changed, 174 insertions(+) |
18 |
|
19 |
diff --git a/sys-apps/apparmor/Manifest b/sys-apps/apparmor/Manifest |
20 |
index 6a8b5e50bbe..89bb054ab20 100644 |
21 |
--- a/sys-apps/apparmor/Manifest |
22 |
+++ b/sys-apps/apparmor/Manifest |
23 |
@@ -1 +1,2 @@ |
24 |
DIST apparmor-2.13.4.tar.gz 7390179 BLAKE2B 49818a010d5e5757dd43710f2af925fbb62a9f8f9be74556ff31a9a8834bebac010762fc6bef3da8d295e487b65d0e0135f4be25bcb01a834846c5e5d65d92a4 SHA512 d42748bf36ae66849f79653a62d499e9d17a97c4d680fb653eb1c379d0593aaa09f7ddfc6f2fa0d2fb468bce05fb25444976f60a5ec24778fdd7ec20d1c13651 |
25 |
+DIST apparmor-3.0.0.tar.gz 7780686 BLAKE2B a9d9edb4fd2cb32b3db322a3f145aac7cea40fac3401b82947b2c5183598cc326d70859466823e3ac0a2227483c7ed7ba0b2f727e9fb7fbf532468716ef8d18f SHA512 2465a8bc400e24e548b0589b7b022fb8325c53858429b9c54204f989d5589d7bd99c9507bde88a48f9965a55edcbac98efeeb6b93aeefe6a27afa0b7e851aea6 |
26 |
|
27 |
diff --git a/sys-apps/apparmor/apparmor-3.0.0.ebuild b/sys-apps/apparmor/apparmor-3.0.0.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..662a23505d2 |
30 |
--- /dev/null |
31 |
+++ b/sys-apps/apparmor/apparmor-3.0.0.ebuild |
32 |
@@ -0,0 +1,67 @@ |
33 |
+# Copyright 1999-2020 Gentoo Authors |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI=7 |
37 |
+ |
38 |
+inherit systemd toolchain-funcs |
39 |
+ |
40 |
+MY_PV="$(ver_cut 1-2)" |
41 |
+ |
42 |
+DESCRIPTION="Userspace utils and init scripts for the AppArmor application security system" |
43 |
+HOMEPAGE="https://gitlab.com/apparmor/apparmor/wikis/home" |
44 |
+SRC_URI="https://launchpad.net/${PN}/${MY_PV}/${MY_PV}/+download/${PN}-${PV}.tar.gz" |
45 |
+ |
46 |
+LICENSE="GPL-2" |
47 |
+SLOT="0" |
48 |
+KEYWORDS="~amd64" |
49 |
+IUSE="doc" |
50 |
+ |
51 |
+RESTRICT="test" # bug 675854 |
52 |
+ |
53 |
+RDEPEND="~sys-libs/libapparmor-${PV}" |
54 |
+DEPEND="${RDEPEND} |
55 |
+ dev-lang/perl |
56 |
+ sys-devel/bison |
57 |
+ sys-devel/gettext |
58 |
+ sys-devel/flex |
59 |
+ doc? ( dev-tex/latex2html ) |
60 |
+" |
61 |
+ |
62 |
+S=${WORKDIR}/apparmor-${PV}/parser |
63 |
+ |
64 |
+PATCHES=( |
65 |
+ "${FILESDIR}/${PN}-3.0.0-makefile.patch" |
66 |
+ "${FILESDIR}/${PN}-2.11.1-dynamic-link.patch" |
67 |
+) |
68 |
+ |
69 |
+src_prepare() { |
70 |
+ default |
71 |
+ |
72 |
+ # remove warning about missing file that controls features |
73 |
+ # we don't currently support |
74 |
+ sed -e "/installation problem/ctrue" -i rc.apparmor.functions || die |
75 |
+} |
76 |
+ |
77 |
+src_compile() { |
78 |
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" USE_SYSTEM=1 arch manpages |
79 |
+ use doc && emake pdf |
80 |
+} |
81 |
+ |
82 |
+src_test() { |
83 |
+ emake CXX="$(tc-getCXX)" USE_SYSTEM=1 check |
84 |
+} |
85 |
+ |
86 |
+src_install() { |
87 |
+ emake DESTDIR="${D}" DISTRO="unknown" USE_SYSTEM=1 install |
88 |
+ |
89 |
+ dodir /etc/apparmor.d/disable |
90 |
+ |
91 |
+ newinitd "${FILESDIR}/${PN}-init-1" ${PN} |
92 |
+ systemd_newunit "${FILESDIR}/apparmor.service" apparmor.service |
93 |
+ |
94 |
+ use doc && dodoc techdoc.pdf |
95 |
+ |
96 |
+ exeinto /usr/share/apparmor |
97 |
+ doexe "${FILESDIR}/apparmor_load.sh" |
98 |
+ doexe "${FILESDIR}/apparmor_unload.sh" |
99 |
+} |
100 |
|
101 |
diff --git a/sys-apps/apparmor/files/apparmor-3.0.0-makefile.patch b/sys-apps/apparmor/files/apparmor-3.0.0-makefile.patch |
102 |
new file mode 100644 |
103 |
index 00000000000..9c03a4465c3 |
104 |
--- /dev/null |
105 |
+++ b/sys-apps/apparmor/files/apparmor-3.0.0-makefile.patch |
106 |
@@ -0,0 +1,18 @@ |
107 |
+* Avoid installing empty /var/lib/apparmor |
108 |
+* Install rc.apparmor.functions to Gentoo-appropriate location |
109 |
+ |
110 |
+--- a/Makefile |
111 |
++++ b/Makefile |
112 |
+@@ -407,10 +407,10 @@ |
113 |
+ .PHONY: install-indep |
114 |
+ install-indep: indep |
115 |
+ install -m 755 -d $(INSTALL_CONFDIR) |
116 |
++ install -m 755 -d ${DESTDIR}/usr/libexec |
117 |
+ install -m 644 parser.conf $(INSTALL_CONFDIR) |
118 |
+- install -m 755 -d ${DESTDIR}/var/lib/apparmor |
119 |
+ install -m 755 -d $(APPARMOR_BIN_PREFIX) |
120 |
+- install -m 755 rc.apparmor.functions $(APPARMOR_BIN_PREFIX) |
121 |
++ install -m 755 rc.apparmor.functions ${DESTDIR}/usr/libexec |
122 |
+ $(MAKE) -C po install NAME=${NAME} DESTDIR=${DESTDIR} |
123 |
+ $(MAKE) install_manpages DESTDIR=${DESTDIR} |
124 |
+ |
125 |
|
126 |
diff --git a/sys-apps/apparmor/files/apparmor-init-1 b/sys-apps/apparmor/files/apparmor-init-1 |
127 |
new file mode 100644 |
128 |
index 00000000000..4addaee294b |
129 |
--- /dev/null |
130 |
+++ b/sys-apps/apparmor/files/apparmor-init-1 |
131 |
@@ -0,0 +1,88 @@ |
132 |
+#!/sbin/openrc-run |
133 |
+# Copyright 1999-2013 Gentoo Foundation |
134 |
+# Distributed under the terms of the GNU General Public License v2 |
135 |
+ |
136 |
+description="Load all configured profiles for the AppArmor security module." |
137 |
+description_reload="Reload all profiles" |
138 |
+ |
139 |
+extra_started_commands="reload" |
140 |
+ |
141 |
+aa_action() { |
142 |
+ local arg=$1 |
143 |
+ local return |
144 |
+ |
145 |
+ shift |
146 |
+ $* |
147 |
+ return=$? |
148 |
+ |
149 |
+ if [ ${return} -eq 0 ]; then |
150 |
+ aa_log_success_msg $arg |
151 |
+ else |
152 |
+ aa_log_failure_msg arg |
153 |
+ fi |
154 |
+ |
155 |
+ return $return |
156 |
+} |
157 |
+ |
158 |
+aa_log_action_start() { |
159 |
+ ebegin $1 |
160 |
+} |
161 |
+ |
162 |
+aa_log_action_end() { |
163 |
+ eend $1 |
164 |
+} |
165 |
+ |
166 |
+aa_log_success_msg() { |
167 |
+ einfo $1 |
168 |
+} |
169 |
+ |
170 |
+aa_log_warning_msg() { |
171 |
+ ewarn $1 |
172 |
+} |
173 |
+ |
174 |
+aa_log_failure_msg() { |
175 |
+ eerror $1 |
176 |
+} |
177 |
+ |
178 |
+aa_log_skipped_msg() { |
179 |
+ einfo $1 |
180 |
+} |
181 |
+ |
182 |
+aa_log_daemon_msg() { |
183 |
+ einfo $1 |
184 |
+} |
185 |
+ |
186 |
+aa_log_end_msg() { |
187 |
+ eend $1 |
188 |
+} |
189 |
+ |
190 |
+. /usr/libexec/rc.apparmor.functions |
191 |
+ |
192 |
+start() { |
193 |
+ ebegin "Starting AppArmor" |
194 |
+ eindent |
195 |
+ |
196 |
+ if ! is_apparmor_loaded ; then |
197 |
+ eerror "AppArmor kernel support is not present" |
198 |
+ eend 1 |
199 |
+ return 1 |
200 |
+ fi |
201 |
+ |
202 |
+ parse_profiles load |
203 |
+ |
204 |
+ eoutdent |
205 |
+} |
206 |
+ |
207 |
+stop() { |
208 |
+ ebegin "Stopping AppArmor" |
209 |
+ eindent |
210 |
+ apparmor_stop |
211 |
+ eoutdent |
212 |
+} |
213 |
+ |
214 |
+reload() { |
215 |
+ # todo: split out clean_profiles into its own function upstream |
216 |
+ # so we can do parse_profiles reload && clean_profiles |
217 |
+ # and do a proper reload instead of restart |
218 |
+ apparmor_restart |
219 |
+} |