apparmor-utils-2.11.0-r1.ebuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python3_4 )
  5. inherit perl-module python-r1 toolchain-funcs versionator
  6. MY_PV="$(get_version_component_range 1-2)"
  7. DESCRIPTION="Additional userspace utils to assist with AppArmor profile management"
  8. HOMEPAGE="http://apparmor.net/"
  9. SRC_URI="https://launchpad.net/apparmor/${MY_PV}/${MY_PV}/+download/apparmor-${PV}.tar.gz"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64"
  13. IUSE=""
  14. DEPEND="dev-lang/perl
  15. ${PYTHON_DEPS}"
  16. RDEPEND="${DEPEND}
  17. ~sys-libs/libapparmor-${PV}[perl,python]
  18. ~sys-apps/apparmor-${PV}
  19. dev-perl/Locale-gettext
  20. dev-perl/RPC-XML
  21. dev-perl/TermReadKey
  22. virtual/perl-Data-Dumper
  23. virtual/perl-Getopt-Long"
  24. S=${WORKDIR}/apparmor-${PV}
  25. PATCHES=(
  26. "${FILESDIR}/${PN}-2.11-shebang.patch"
  27. )
  28. src_prepare() {
  29. default
  30. sed -i binutils/Makefile \
  31. -e 's/Bstatic/Bdynamic/g' \
  32. -e 's/EXTRA_CFLAGS = /& ${CFLAGS}/' || die
  33. }
  34. src_compile() {
  35. python_setup
  36. pushd utils > /dev/null || die
  37. # launches non-make subprocesses causing "make jobserver unavailable"
  38. # error messages to appear in generated code
  39. emake -j1
  40. popd > /dev/null || die
  41. pushd binutils > /dev/null || die
  42. export EXTRA_CFLAGS="${CFLAGS}"
  43. emake CC="$(tc-getCC)" USE_SYSTEM=1
  44. popd > /dev/null || die
  45. }
  46. src_install() {
  47. pushd utils > /dev/null || die
  48. perl_set_version
  49. emake DESTDIR="${D}" PERLDIR="${D}/${VENDOR_LIB}/Immunix" \
  50. VIM_INSTALL_PATH="${D}/usr/share/vim/vimfiles/syntax" install
  51. install_python() {
  52. "${PYTHON}" "${S}"/utils/python-tools-setup.py install --prefix=/usr \
  53. --root="${D}" --version="${PV}"
  54. }
  55. python_foreach_impl install_python
  56. python_replicate_script "${D}"/usr/bin/aa-easyprof "${D}"/usr/sbin/apparmor_status \
  57. "${D}"/usr/sbin/aa-{audit,autodep,cleanprof,complain,disable,enforce,genprof,logprof,mergeprof,status,unconfined}
  58. popd > /dev/null || die
  59. pushd binutils > /dev/null || die
  60. emake install DESTDIR="${D}" USE_SYSTEM=1
  61. popd > /dev/null || die
  62. }