mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-21 10:37:22 -08:00
125 lines
3.1 KiB
Bash
125 lines
3.1 KiB
Bash
# Copyright 1999-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
DISTUTILS_USE_PEP517=setuptools
|
|
PYTHON_COMPAT=( python3_{12..14} )
|
|
|
|
inherit desktop distutils-r1 toolchain-funcs verify-sig
|
|
|
|
DESCRIPTION="Additional userspace utils to assist with AppArmor profile management"
|
|
HOMEPAGE="https://gitlab.com/apparmor/apparmor/-/wikis/home"
|
|
SRC_URI="
|
|
https://gitlab.com/apparmor/apparmor/-/archive/v${PV}/apparmor-v${PV}.tar.bz2
|
|
verify-sig? (
|
|
https://gitlab.com/api/v4/projects/4484878/packages/generic/signatures/${PV}/apparmor-v${PV}.tar.bz2.asc
|
|
)
|
|
"
|
|
|
|
S=${WORKDIR}/apparmor-v${PV}
|
|
|
|
LICENSE="GPL-2"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv"
|
|
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
|
|
|
COMMON_DEPEND="
|
|
~sys-libs/libapparmor-${PV}
|
|
${PYTHON_DEPS}
|
|
"
|
|
DEPEND="
|
|
${COMMON_DEPEND}
|
|
sys-devel/gettext
|
|
"
|
|
RDEPEND="
|
|
${COMMON_DEPEND}
|
|
dev-python/notify2[${PYTHON_USEDEP}]
|
|
dev-python/psutil[${PYTHON_USEDEP}]
|
|
~sys-apps/apparmor-${PV}
|
|
~sys-libs/libapparmor-${PV}[python,${PYTHON_USEDEP}]
|
|
"
|
|
BDEPEND="
|
|
verify-sig? ( sec-keys/openpgp-keys-apparmor )
|
|
"
|
|
|
|
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/apparmor.asc
|
|
|
|
PATCHES=(
|
|
"${FILESDIR}/apparmor-utils-4.1.8_disable_faulty_tests.patch"
|
|
)
|
|
|
|
# Test campaign is not 100%, it requires more fixing, see patching.
|
|
distutils_enable_tests unittest
|
|
|
|
src_prepare() {
|
|
distutils-r1_src_prepare
|
|
|
|
sed -i binutils/Makefile \
|
|
-e 's/Bstatic/Bdynamic/g' || die
|
|
|
|
sed -i utils/aa-remove-unknown \
|
|
-e 's#^\(APPARMOR_FUNCTIONS=\).*#\1/usr/libexec/rc.apparmor.functions#' || die
|
|
|
|
# Remove extra tests, also see patch
|
|
local target
|
|
local testcases_multi=(
|
|
change_onexec_gl636
|
|
change_onexec_lp1648143
|
|
file_without_filename
|
|
posix_mqueue_disconnected_no_name
|
|
testcase_changeprofile_03
|
|
)
|
|
for target in "${testcases_multi[@]}"; do
|
|
rm -f libraries/libapparmor/testsuite/test_multi/"${target}".{err,in,out,profile}
|
|
done
|
|
}
|
|
|
|
src_compile() {
|
|
python_setup
|
|
|
|
pushd utils > /dev/null || die
|
|
# launches non-make subprocesses causing "make jobserver unavailable"
|
|
# error messages to appear in generated code
|
|
emake -j1
|
|
popd > /dev/null || die
|
|
|
|
pushd binutils > /dev/null || die
|
|
export EXTRA_CFLAGS="${CFLAGS}"
|
|
emake CC="$(tc-getCC)" USE_SYSTEM=1
|
|
popd > /dev/null || die
|
|
}
|
|
|
|
python_test() {
|
|
pushd utils > /dev/null || die
|
|
emake USE_SYSTEM=1 PYFLAKES=true check
|
|
popd > /dev/null || die
|
|
}
|
|
|
|
python_install() {
|
|
local -x PYTHONDONTWRITEBYTECODE=
|
|
"${PYTHON}" python-tools-setup.py install \
|
|
--prefix="${EPREFIX}"/usr \
|
|
--root="${D}" \
|
|
--optimize 2 \
|
|
--version=${PV} || die
|
|
}
|
|
|
|
src_install() {
|
|
pushd utils > /dev/null || die
|
|
emake DESTDIR="${D}" VIM_INSTALL_PATH="${D}/usr/share/vim/vimfiles/syntax" install
|
|
|
|
distutils-r1_src_install
|
|
|
|
python_replicate_script "${D}"/usr/bin/aa-easyprof \
|
|
"${D}"/usr/sbin/aa-{audit,autodep,cleanprof,complain,disable,enforce,genprof,logprof,mergeprof,notify,unconfined}
|
|
python_optimize
|
|
sed -i 's$/usr/bin/aa-notify$/usr/sbin/aa-notify$g' aa-notify.desktop || die
|
|
domenu aa-notify.desktop
|
|
popd > /dev/null || die
|
|
|
|
pushd binutils > /dev/null || die
|
|
emake install DESTDIR="${D}" USE_SYSTEM=1
|
|
popd > /dev/null || die
|
|
}
|