blob: 2d5251809209bb05db98ccf4d0789f8fe0d967f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
# Contributor: Allan Garret <allan.garret@gmail.com>
# Maintainer: Allan Garret <allan.garret@gmail.com>
pkgname=apparmor
pkgver=2.11.0
_majorver=2.11
pkgrel=0
pkgdesc="Linux application security framework - mandatory access control for programs"
url="http://wiki.apparmor.net/index.php/Main_Page"
arch="all"
license="GPL"
depends="bash"
makedepends="bash sed python autoconf automake libtool bison flex swig gettext-dev python-dev linux-pam-dev linux-headers"
subpackages="
libapparmor:libapparmor
libapparmor-doc:libapparmor_doc
libapparmor-dev:libapparmor_dev
$pkgname-utils:apparmor_utils:noarch
$pkgname-utils-doc:apparmor_utils_doc
$pkgname-profiles:apparmor_profiles:noarch
$pkgname-pam:apparmor_pam
$pkgname-vim:apparmor_vim:noarch
$pkgname-doc
$pkgname-lang
"
source="
https://launchpad.net/$pkgname/$_majorver/$_majorver/+download/$pkgname-$pkgver.tar.gz
https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/apparmor/files/apparmor-init
0001-Remove-__BEGIN_DECLS-and-__END_DECLS-identifiers.patch
0002-Provide-missing-secure_getenv-and-scandirat-function.patch
0003-Added-missing-typedef-definitions-on-parser.patch
0004-Define-RLIMIT_OFILE-if-needed.patch
0005-Added-RLIMIT_RTTIME-option-conditionally.patch
0006-Use-gettext-and-remove-latex.patch
0007-Do-not-build-install-vim-file-with-utils-package.patch
0008-Add-missing-include-for-ppc64le.patch
"
builddir="$srcdir"/$pkgname-$pkgver
prepare() {
local i
cd "$builddir"
for i in "$srcdir"/*.patch; do
msg "Applying $i"
patch -p1 -i $i || return 1
done
}
build() {
cd "$builddir"/libraries/libapparmor
msg "Building: libapparmor"
./autogen.sh
./configure --prefix=/usr --with-python
make
cd "$builddir"
msg "Building: apparmor"
make -C parser
msg "Building: apparmor-utils"
make -C utils
msg "Building: apparmor-profiles"
make -C profiles
msg "Building: apparmor-pam"
make -C changehat/pam_apparmor
msg "Building: apparmor-vim"
make -C utils/vim
}
package() {
cd "$builddir"
make -C parser install DESTDIR="$pkgdir"
mv "$pkgdir"/lib "$pkgdir"/usr/lib
mv "$pkgdir"/sbin "$pkgdir"/usr/sbin
install -Dm755 "$srcdir"/apparmor-init \
"$pkgdir"/etc/init.d/apparmor
}
libapparmor() {
pkgdesc="AppArmor library"
makedepends="swig python-dev"
depends="bash sed python"
cd "$builddir"
make -C libraries/libapparmor install DESTDIR="$subpkgdir"
# Move development files
mkdir -p "$subpkgdir"-dev/usr
mv "$subpkgdir"/usr/include "$subpkgdir"-dev/usr/ || return 1
mkdir -p "$subpkgdir"-dev/usr/lib
mv "$subpkgdir"/usr/lib/libapparmor.a "$subpkgdir"-dev/usr/lib/ || return 1
mv "$subpkgdir"/usr/lib/pkgconfig "$subpkgdir"-dev/usr/lib/ || return 1
# Move doc files
mkdir -p "$subpkgdir-doc"/usr/share
mv "$subpkgdir"/usr/share/man "$subpkgdir-doc"/usr/share/
}
libapparmor_doc() {
pkgdesc="AppArmor Library (doc files)"
cd "$builddir"
for i in 2 3; do
find "$subpkgdir"/usr/share/man/man"$i" -type f -exec gzip -9v {} +
done
}
libapparmor_dev() {
pkgdesc="AppArmor Library (development files)"
}
apparmor_utils() {
pkgdesc="AppArmor userspace utilities"
depends="perl python bash"
cd "$builddir"
make -C utils install DESTDIR="$subpkgdir" BINDIR="$subpkgdir"/usr/bin
mkdir -p "$subpkgdir"-doc/usr/share
mv "$subpkgdir"/usr/share/man "$subpkgdir"-doc/usr/share/
}
apparmor_utils_doc() {
pkgdesc="AppArmor userspace utilites (doc files)"
cd "$builddir"
for i in 5 8; do
find "$subpkgdir"/usr/share/man/man"$i" -type f -exec gzip -9v {} +
done
cd "$subpkgdir"/usr/share/man/man8
rm apparmor_status.8 || return 1
ln -s aa-status.8.gz apparmor_status.8.gz || return 1
}
apparmor_profiles() {
pkgdesc="AppArmor sample pre-made profiles"
depends="apparmor"
cd "$builddir"
make -C profiles install DESTDIR="$subpkgdir"
}
apparmor_pam() {
pkgdesc="AppArmor PAM library"
depends="apparmor-libapparmor pam"
cd "$builddir"
make -C changehat/pam_apparmor install DESTDIR="$subpkgdir"/usr
}
apparmor_pam_doc() {
pkgdesc="AppArmor PAM library (doc files)"
cd "$builddir"
mkdir -p "$subpkgdir"/usr/share/doc/apparmor
install -Dm644 changehat/pam_apparmor/README \
"$subpkgdir"/usr/share/doc/apparmor/README.pam_apparmor
}
apparmor_vim() {
pkgdesc="AppArmor VIM support"
depends="vim"
cd "$builddir"/utils/vim
install -Dm644 apparmor.vim \
"$subpkgdir"/usr/share/vim/vimfiles/syntax/apparmor.vim
}
sha512sums="86b33c1cbbd256028dd5fdfaddc764c225845acd19c833223fce5cdd6164f997fe010d7b642791f834a3417b4ea847d77175fdfd89ea99ab2111933790d42b55 apparmor-2.11.0.tar.gz
4ee4747ec98a0828beb690bf5e01bc112d958bff4c68d60fc0cbb9f0707bd8daecc011dba3916aa6e6368f460eedce7f2ce42aad9ccea49a5d898dcae3d01148 apparmor-init
fbe93bfdc6469496aafddfe8f8c01d53adb5075a4547e40fb8fc5b5b972aa418a0a84e626e82602425ad48409fd078dabdf60132f5810f80aa3212e11cb7186e 0001-Remove-__BEGIN_DECLS-and-__END_DECLS-identifiers.patch
988f4f6c27089ca68ef122066123099477e2e1dc7c849f93e3d0a92c2aa9a38ccbcd9e4d212329edad4ac4bbb7ee32dfbaab8b0039a661e2af391b6c830e6b54 0002-Provide-missing-secure_getenv-and-scandirat-function.patch
029a94086ffa97b5eff55e23469ee199caf066761cad28a1f0d4b8c51c4ae927192651befc79505f0078cf81a79fa472c97bf8b0e5e4816fcd8f597ad129c431 0003-Added-missing-typedef-definitions-on-parser.patch
3da30be6f964135c1fd85368f17bd503682af6a5dc3d3d3964f87d74330debdddbb9ada705aad35999904539e29d46118a58af88084646bf2faa8413b65e857c 0004-Define-RLIMIT_OFILE-if-needed.patch
1606e18435ea8aec16546c9c15f1b4bdc9c15af0764b2f580c28b8597fbd3ea670a4fe6dcf16a6b97a340f4b6b52b578463b1359150141a37f668e7dc8f1b272 0005-Added-RLIMIT_RTTIME-option-conditionally.patch
0e94e33cc919a76e7d59da578f0166ac9e6c2021b55d1a92ae1512e51f05d45a099a83a57625905112cf25e460e6078ae57bf7ee66da7caf0bc87fccdd0589ce 0006-Use-gettext-and-remove-latex.patch
6d75ed791653457d58fea7ff29a8e8e52c4bf7e214daa1e1ad2dcd888521251c9a89279cecaed320d252b057f7db0c5440c0d8ca8f4e51af79f9511d44bbec16 0007-Do-not-build-install-vim-file-with-utils-package.patch
9c9748e2b472b1b204b8ce1ad2c714ae2e296c083f14750f042b77055ec6c321e5ab8df402d41d57eff1c52cfa9dfab0dcb890db0be49403907e688d616b0c8c 0008-Add-missing-include-for-ppc64le.patch"
|