libcap-2.24-r2.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils multilib multilib-minimal toolchain-funcs pam
  5. DESCRIPTION="POSIX 1003.1e capabilities"
  6. HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html"
  7. SRC_URI="mirror://kernel/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
  8. # it's available under either of the licenses
  9. LICENSE="|| ( GPL-2 BSD )"
  10. SLOT="0"
  11. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
  12. IUSE="pam static-libs"
  13. RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
  14. pam? ( virtual/pam )"
  15. DEPEND="${RDEPEND}
  16. sys-kernel/linux-headers"
  17. src_prepare() {
  18. epatch "${FILESDIR}"/${PN}-2.24-build-system-fixes.patch
  19. epatch "${FILESDIR}"/${PN}-2.22-no-perl.patch
  20. epatch "${FILESDIR}"/${PN}-2.20-ignore-RAISE_SETFCAP-install-failures.patch
  21. epatch "${FILESDIR}"/${PN}-2.21-include.patch
  22. epatch "${FILESDIR}"/${PN}-2.24-setcap-errno.patch #551672
  23. multilib_copy_sources
  24. }
  25. multilib_src_configure() {
  26. local pam
  27. if multilib_is_native_abi && use pam; then
  28. pam=yes
  29. else
  30. pam=no
  31. fi
  32. sed -i \
  33. -e "/^PAM_CAP/s:=.*:=${pam}:" \
  34. -e '/^DYNAMIC/s:=.*:=yes:' \
  35. -e '/^lib_prefix=/s:=.*:=$(prefix):' \
  36. -e "/^lib=/s:=.*:=$(get_libdir):" \
  37. Make.Rules
  38. }
  39. multilib_src_compile() {
  40. tc-export_build_env BUILD_CC
  41. tc-export AR CC RANLIB
  42. default
  43. }
  44. multilib_src_install() {
  45. # no configure, needs explicit install line #444724#c3
  46. emake install DESTDIR="${ED}"
  47. gen_usr_ldscript -a cap
  48. use static-libs || rm "${ED}"/usr/$(get_libdir)/libcap.a
  49. rm -rf "${ED}"/usr/$(get_libdir)/security
  50. if multilib_is_native_abi && use pam; then
  51. dopammod pam_cap/pam_cap.so
  52. dopamsecurity '' pam_cap/capability.conf
  53. fi
  54. }
  55. multilib_src_install_all() {
  56. dodoc CHANGELOG README doc/capability.notes
  57. }