2017-03-13 21:53:43 +01:00
|
|
|
# Template file for 'apparmor'
|
|
|
|
pkgname=apparmor
|
2018-05-09 06:54:15 +02:00
|
|
|
version=2.13.0
|
2018-09-04 12:00:17 +02:00
|
|
|
revision=7
|
|
|
|
build_style=gnu-configure
|
2017-03-13 21:53:43 +01:00
|
|
|
_short_ver=${version%\.*}
|
2018-05-09 06:54:15 +02:00
|
|
|
wrksrc="${pkgname}-v${_short_ver}"
|
2018-09-04 12:00:17 +02:00
|
|
|
build_wrksrc="libraries/libapparmor"
|
2017-03-13 21:53:43 +01:00
|
|
|
patch_args="-Np1"
|
2018-09-04 12:00:17 +02:00
|
|
|
hostmakedepends="bison flex autoconf automake libtool swig python3"
|
2018-07-07 02:27:48 +02:00
|
|
|
makedepends="perl python3-devel"
|
2017-03-13 21:53:43 +01:00
|
|
|
depends="runit-void-apparmor python3 libapparmor"
|
|
|
|
short_desc="Mandatory access control to restrict programs"
|
|
|
|
maintainer="Olivier Mauras <olivier@mauras.ch>"
|
2018-07-07 02:27:48 +02:00
|
|
|
license="GPL-2.0-only, LGPL-2.1-only"
|
2018-05-09 06:54:15 +02:00
|
|
|
homepage="https://gitlab.com/apparmor/apparmor"
|
|
|
|
distfiles="https://gitlab.com/apparmor/apparmor/-/archive/v${_short_ver}/apparmor-v${_short_ver}.tar.gz"
|
2018-07-07 02:27:48 +02:00
|
|
|
checksum=fdafa0b71cbf574cce76a1ea1542b4540fa1c1040f80d0f0866fc0056ec37747
|
2018-07-12 08:05:33 +02:00
|
|
|
conf_files="/etc/apparmor.d/local/*"
|
2018-09-04 12:00:17 +02:00
|
|
|
make_dirs="/etc/apparmor.d/disable 0755 root root"
|
|
|
|
|
|
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
|
|
configure_args="--with-perl --with-python"
|
|
|
|
fi
|
|
|
|
|
|
|
|
pre_configure() {
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
|
|
|
}
|
2017-03-13 21:53:43 +01:00
|
|
|
|
|
|
|
pre_build() {
|
2018-09-04 12:00:17 +02:00
|
|
|
# Replace release profiles with our own
|
2017-03-13 21:53:43 +01:00
|
|
|
cd ${wrksrc}
|
2018-05-09 06:54:15 +02:00
|
|
|
|
|
|
|
# Put in place our own profiles
|
|
|
|
cp ${FILESDIR}/profiles/* profiles/apparmor.d/
|
|
|
|
mv profiles/apparmor.d/bin.ping profiles/apparmor/profiles/extras/
|
2017-03-13 21:53:43 +01:00
|
|
|
}
|
|
|
|
|
2018-09-04 12:00:17 +02:00
|
|
|
post_build() {
|
2017-03-13 21:53:43 +01:00
|
|
|
cd ${wrksrc}/binutils
|
|
|
|
make ${makejobs}
|
|
|
|
|
|
|
|
cd ${wrksrc}/utils
|
|
|
|
make ${makejobs}
|
|
|
|
|
|
|
|
cd ${wrksrc}/parser
|
|
|
|
sed -i 's#$(DESTDIR)/sbin#$(DESTDIR)/usr/bin#g' Makefile
|
|
|
|
sed -i 's#${DESTDIR}/lib#${DESTDIR}/usr/lib#g' Makefile
|
|
|
|
make ${makejobs}
|
|
|
|
|
|
|
|
cd ${wrksrc}/profiles
|
|
|
|
make ${makejobs}
|
|
|
|
}
|
|
|
|
|
2018-09-04 12:00:17 +02:00
|
|
|
post_install() {
|
2017-03-13 21:53:43 +01:00
|
|
|
cd ${wrksrc}/binutils
|
|
|
|
make DESTDIR=${DESTDIR} install
|
|
|
|
|
|
|
|
cd ${wrksrc}/utils
|
|
|
|
make DESTDIR=${DESTDIR} BINDIR=${DESTDIR}/usr/bin install
|
|
|
|
|
|
|
|
cd ${wrksrc}/parser
|
|
|
|
make DESTDIR=${DESTDIR} install
|
|
|
|
|
|
|
|
cd ${wrksrc}/profiles
|
|
|
|
make DESTDIR=${DESTDIR} install
|
|
|
|
|
|
|
|
# Put Vim syntax in the correct place
|
|
|
|
mkdir -p ${DESTDIR}/usr/share/vim/vim80/syntax/
|
|
|
|
mv ${DESTDIR}/usr/share/apparmor/apparmor.vim ${DESTDIR}/usr/share/vim/vim80/syntax/
|
|
|
|
|
2018-09-04 12:00:17 +02:00
|
|
|
# requires perl bindings not generated when cross-compiling
|
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
|
|
rm -f ${DESTDIR}/usr/bin/aa-notify
|
|
|
|
fi
|
2017-03-13 21:53:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
apparmor-vim_package() {
|
2018-07-07 02:27:48 +02:00
|
|
|
noarch=yes
|
2017-03-13 21:53:43 +01:00
|
|
|
short_desc+=" - Vim syntax"
|
|
|
|
depends="vim"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/share/vim/vim80/syntax/apparmor.vim
|
|
|
|
vmove usr/share/man/man5/apparmor.vim.5
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
libapparmor_package() {
|
|
|
|
short_desc+=" - Library"
|
|
|
|
pkg_install() {
|
|
|
|
vmove "usr/lib/libapparmor.so*"
|
2018-09-04 12:00:17 +02:00
|
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
|
|
vmove usr/lib/perl5
|
|
|
|
vmove "${py3_sitelib}/LibAppArmor*"
|
|
|
|
fi
|
2017-03-13 21:53:43 +01:00
|
|
|
vmove usr/share/man/man2
|
|
|
|
vmove usr/share/man/man3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
libapparmor-devel_package() {
|
|
|
|
short_desc+=" - Library development files"
|
|
|
|
depends="${sourcepkg}-${version}_${revision}"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/include/
|
|
|
|
vmove "usr/lib/*.a"
|
2018-09-04 12:00:17 +02:00
|
|
|
vmove "usr/lib/*.so"
|
2017-03-13 21:53:43 +01:00
|
|
|
vmove usr/lib/pkgconfig
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|