void-packages/srcpkgs/apparmor/template

99 lines
2.6 KiB
Bash
Raw Normal View History

2017-03-13 21:53:43 +01:00
# Template file for 'apparmor'
pkgname=apparmor
2018-12-22 02:59:14 +01:00
version=2.13.2
revision=3
2019-01-01 06:00:24 +01:00
wrksrc="${pkgname}-v${version}"
build_wrksrc=libraries/libapparmor
2018-12-22 02:59:14 +01:00
build_style=gnu-configure
conf_files="/etc/apparmor.d/local/* /etc/apparmor/*"
2019-01-01 06:00:24 +01:00
make_dirs="/etc/apparmor.d/disable 0755 root root"
hostmakedepends="bison flex autoconf automake libtool swig python3"
makedepends="perl python3-devel"
2017-03-13 21:53:43 +01:00
depends="runit-void-apparmor python3 libapparmor"
checkdepends="dejagnu"
2017-03-13 21:53:43 +01:00
short_desc="Mandatory access control to restrict programs"
maintainer="Olivier Mauras <olivier@mauras.ch>"
license="GPL-2.0-only, LGPL-2.1-only"
homepage="https://gitlab.com/apparmor/apparmor"
2019-01-01 06:00:24 +01:00
distfiles="https://gitlab.com/apparmor/apparmor/-/archive/v${version}/apparmor-v${version}.tar.gz"
checksum=83edb98c729dc5388407aea23ea7aedb62c00db70131853f1eae15a27d71ca1d
patch_args="-Np1"
if [ -z "$CROSS_BUILD" ]; then
configure_args="--with-perl --with-python"
fi
pre_configure() {
autoreconf -if
}
2017-03-13 21:53:43 +01:00
pre_build() {
# Replace release profiles with our own
2017-03-13 21:53:43 +01:00
cd ${wrksrc}
# Put in place our own profiles
cp ${FILESDIR}/profiles/* profiles/apparmor.d/
2017-03-13 21:53:43 +01:00
}
post_build() {
cd ${wrksrc}
sed -i 's#$(DESTDIR)/sbin#$(DESTDIR)/usr/bin#g' parser/Makefile
make ${makejobs} -C binutils
make ${makejobs} -C utils
make ${makejobs} -C parser
make ${makejobs} -C profiles
2017-03-13 21:53:43 +01:00
}
post_install() {
cd ${wrksrc}
make DESTDIR=${DESTDIR} install -C binutils
make DESTDIR=${DESTDIR} BINDIR=${DESTDIR}/usr/bin install -C utils
make DESTDIR=${DESTDIR} APPARMOR_BIN_PREFIX=${DESTDIR}/usr/lib/apparmor \
SBINDIR=${DESTDIR}/usr/bin USR_SBINDIR=${DESTDIR}/usr/bin install -C parser
make DESTDIR=${DESTDIR} install -C profiles
2017-03-13 21:53:43 +01:00
# 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/
# 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() {
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*"
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"
vmove "usr/lib/*.so"
2017-03-13 21:53:43 +01:00
vmove usr/lib/pkgconfig
}
}