Diff apparmor-4.1.7 with a apparmor-5.0.2

/usr/portage/sys-apps/apparmor/apparmor-5.0.2.ebuild 2026-10-28 20:01:05.233079355 +0300
3 3

  
4 4
EAPI=8
5 5

  
6
inherit flag-o-matic systemd toolchain-funcs linux-info
6
inherit flag-o-matic systemd toolchain-funcs linux-info verify-sig
7 7

  
8 8
MY_PV="$(ver_cut 1-2)"
9 9

  
10 10
DESCRIPTION="Userspace utils and init scripts for the AppArmor application security system"
11 11
HOMEPAGE="https://gitlab.com/apparmor/apparmor/wikis/home"
12
SRC_URI="https://gitlab.com/apparmor/apparmor/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
12
SRC_URI="
13
	https://gitlab.com/apparmor/apparmor/-/archive/v${PV}/apparmor-v${PV}.tar.bz2
14
	verify-sig? (
15
		https://gitlab.com/api/v4/projects/4484878/packages/generic/signatures/${PV}/apparmor-v${PV}.tar.bz2.asc
16
	)
17
"
13 18

  
14
S=${WORKDIR}/apparmor-v${PV}/parser
19
S=${WORKDIR}/apparmor-v${PV}
15 20

  
16 21
LICENSE="GPL-2"
17 22
SLOT="0"
18 23
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv"
19
IUSE="doc"
24
IUSE="doc test verify-sig"
20 25

  
21
# Was restricted previously b/c needs apparmor support in kernel
22
# TODO: add check to ebuild
23
#RESTRICT="test" # bug 675854
26
RESTRICT="!test? ( test )"
24 27

  
25 28
RDEPEND="~sys-libs/libapparmor-${PV}"
26 29
DEPEND="${RDEPEND}"
27 30
BDEPEND="
28
	dev-lang/perl
29 31
	sys-apps/which
30 32
	app-alternatives/yacc
31 33
	sys-devel/gettext
32 34
	app-alternatives/lex
33 35
	doc? ( dev-tex/latex2html )
36
	test? ( dev-lang/perl )
37
	verify-sig? ( sec-keys/openpgp-keys-apparmor )
34 38
"
35 39
CONFIG_CHECK="SECURITY_APPARMOR"
36 40

  
41
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/apparmor.asc
42

  
37 43
src_prepare() {
38 44
	default
39 45

  
40
	sed -e '/^AALIB =/ s/-Bstatic/-Bdynamic/' -i Makefile || die
41

  
42 46
	# Install rc.apparmor.functions to Gentoo-appropriate location
43
	sed -e '/install-indep: indep/a\\tinstall -m 755 -d ${DESTDIR}/usr/libexec' -i Makefile || die
47
	sed -e '/install-indep: indep/a\\tinstall -m 755 -d ${DESTDIR}/usr/libexec' -i init/Makefile || die
44 48
	sed -e 's:rc.apparmor.functions $(APPARMOR_BIN_PREFIX):rc.apparmor.functions ${DESTDIR}/usr/libexec:' \
45
		-i Makefile || die
46
	sed -e ':^APPARMOR_FUNCTIONS=: s:/lib/apparmor/:/usr/libexec/:' -i apparmor.systemd || die
47
	sed -e 's:\. /lib/apparmor/rc.apparmor.functions:\. /usr/libexec/rc.apparmor.functions:' -i profile-load || die
49
		-i init/Makefile || die
50
	sed -e ':^APPARMOR_FUNCTIONS=: s:/lib/apparmor/:/usr/libexec/:' -i init/apparmor.systemd || die
51
	sed -e 's:\. /lib/apparmor/rc.apparmor.functions:\. /usr/libexec/rc.apparmor.functions:' -i init/profile-load || die
48 52

  
49 53
	# remove warning about missing file that controls features
50 54
	# we don't currently support
51
	sed -e "/installation problem/ctrue" -i rc.apparmor.functions || die
55
	sed -e "/installation problem/ctrue" -i init/rc.apparmor.functions || die
52 56

  
53 57
	# bug 634782
54 58
	sed -e "s/cpp/$(tc-getCPP) -/" \
55
		-i ../common/list_capabilities.sh \
56
		-i ../common/list_af_names.sh || die
59
		-i common/list_capabilities.sh \
60
		-i common/list_af_names.sh || die
57 61
}
58 62

  
59 63
src_configure() {
......
64 68
}
65 69

  
66 70
src_compile() {
71
	pushd parser || die
67 72
	emake \
68 73
		AR="$(tc-getAR)" \
69 74
		CC="$(tc-getCC)" \
......
72 77
		USE_SYSTEM=1 \
73 78
		arch manpages
74 79
	use doc && emake pdf
80
	popd || die
75 81
}
76 82

  
77 83
src_test() {
......
79 85
}
80 86

  
81 87
src_install() {
88
	pushd parser || die
82 89
	emake \
83 90
		CPP="$(tc-getCPP) -" \
84 91
		DESTDIR="${D}" \
......
86 93
		USE_SYSTEM=1 \
87 94
		install
88 95

  
96
	use doc && dodoc techdoc.pdf
97
	popd || die
98

  
99
	pushd init || die
100
	emake \
101
		CPP="$(tc-getCPP) -" \
102
		DESTDIR="${D}" \
103
		DISTRO="unknown" \
104
		USE_SYSTEM=1 \
105
		install;
106
	systemd_dounit apparmor.service
107

  
89 108
	dodir /etc/apparmor.d/disable
90 109

  
91 110
	newinitd "${FILESDIR}/${PN}-init-1" ${PN}
92
	systemd_newunit "${FILESDIR}/apparmor.service" apparmor.service
93

  
94
	use doc && dodoc techdoc.pdf
95 111

  
96 112
	exeinto /usr/share/apparmor
97 113
	doexe "${FILESDIR}/apparmor_load.sh"
98 114
	doexe "${FILESDIR}/apparmor_unload.sh"
115

  
99 116
}
Thank you!