libcap-2.25.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  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. # While the build system optionally uses gperf, we don't DEPEND on it because
  14. # the build automatically falls back when it's unavailable. #604802
  15. RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
  16. pam? ( virtual/pam )"
  17. DEPEND="${RDEPEND}
  18. sys-kernel/linux-headers"
  19. PATCHES=(
  20. "${FILESDIR}"/${PN}-2.25-build-system-fixes.patch
  21. "${FILESDIR}"/${PN}-2.22-no-perl.patch
  22. "${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
  23. "${FILESDIR}"/${PN}-2.21-include.patch
  24. "${FILESDIR}"/${PN}-2.25-gperf.patch
  25. )
  26. src_prepare() {
  27. epatch "${PATCHES[@]}"
  28. multilib_copy_sources
  29. }
  30. multilib_src_configure() {
  31. local pam
  32. if multilib_is_native_abi && use pam; then
  33. pam=yes
  34. else
  35. pam=no
  36. fi
  37. sed -i \
  38. -e "/^PAM_CAP/s:=.*:=${pam}:" \
  39. -e '/^DYNAMIC/s:=.*:=yes:' \
  40. -e '/^lib_prefix=/s:=.*:=$(prefix):' \
  41. -e "/^lib=/s:=.*:=$(get_libdir):" \
  42. Make.Rules
  43. }
  44. multilib_src_compile() {
  45. tc-export_build_env BUILD_CC
  46. tc-export AR CC RANLIB
  47. default
  48. }
  49. multilib_src_install() {
  50. # no configure, needs explicit install line #444724#c3
  51. emake install DESTDIR="${ED}"
  52. gen_usr_ldscript -a cap
  53. use static-libs || rm "${ED}"/usr/$(get_libdir)/libcap.a
  54. rm -rf "${ED}"/usr/$(get_libdir)/security
  55. if multilib_is_native_abi && use pam; then
  56. dopammod pam_cap/pam_cap.so
  57. dopamsecurity '' pam_cap/capability.conf
  58. fi
  59. }
  60. multilib_src_install_all() {
  61. dodoc CHANGELOG README doc/capability.notes
  62. }