libnl-3.2.29.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 python3_{4,5} )
  5. DISTUTILS_OPTIONAL=1
  6. inherit distutils-r1 eutils libtool multilib multilib-minimal
  7. LIBNL_P=${P/_/-}
  8. LIBNL_DIR=${PV/_/}
  9. LIBNL_DIR=${LIBNL_DIR//./_}
  10. DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
  11. HOMEPAGE="http://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
  12. SRC_URI="
  13. https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz
  14. https://dev.gentoo.org/~jer/libnl-3.2.28-in6.patch.xz
  15. "
  16. LICENSE="LGPL-2.1 utils? ( GPL-2 )"
  17. SLOT="3"
  18. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
  19. IUSE="static-libs python utils"
  20. RDEPEND="
  21. python? ( ${PYTHON_DEPS} )
  22. abi_x86_32? (
  23. !<=app-emulation/emul-linux-x86-baselibs-20140508-r5
  24. !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
  25. )
  26. "
  27. DEPEND="
  28. ${RDEPEND}
  29. python? ( dev-lang/swig )
  30. sys-devel/bison
  31. sys-devel/flex
  32. "
  33. REQUIRED_USE="
  34. python? ( ${PYTHON_REQUIRED_USE} )
  35. "
  36. DOCS=(
  37. ChangeLog
  38. )
  39. S=${WORKDIR}/${LIBNL_P}
  40. MULTILIB_WRAPPED_HEADERS=(
  41. # we do not install CLI stuff for non-native
  42. /usr/include/libnl3/netlink/cli/addr.h
  43. /usr/include/libnl3/netlink/cli/class.h
  44. /usr/include/libnl3/netlink/cli/cls.h
  45. /usr/include/libnl3/netlink/cli/ct.h
  46. /usr/include/libnl3/netlink/cli/exp.h
  47. /usr/include/libnl3/netlink/cli/link.h
  48. /usr/include/libnl3/netlink/cli/neigh.h
  49. /usr/include/libnl3/netlink/cli/qdisc.h
  50. /usr/include/libnl3/netlink/cli/route.h
  51. /usr/include/libnl3/netlink/cli/rule.h
  52. /usr/include/libnl3/netlink/cli/tc.h
  53. /usr/include/libnl3/netlink/cli/utils.h
  54. )
  55. PATCHES=(
  56. "${FILESDIR}"/${PN}-1.1-vlan-header.patch
  57. "${WORKDIR}"/${PN}-3.2.28-in6.patch
  58. )
  59. src_prepare() {
  60. default
  61. elibtoolize
  62. if use python; then
  63. cd "${S}"/python || die
  64. distutils-r1_src_prepare
  65. fi
  66. # out-of-source build broken
  67. # https://github.com/thom311/libnl/pull/58
  68. multilib_copy_sources
  69. }
  70. multilib_src_configure() {
  71. econf \
  72. --disable-silent-rules \
  73. $(use_enable static-libs static) \
  74. $(multilib_native_use_enable utils cli)
  75. }
  76. multilib_src_compile() {
  77. default
  78. if multilib_is_native_abi && use python; then
  79. cd python || die
  80. distutils-r1_src_compile
  81. fi
  82. }
  83. multilib_src_install() {
  84. emake DESTDIR="${D}" install
  85. if multilib_is_native_abi && use python; then
  86. # Unset DOCS= since distutils-r1.eclass interferes
  87. local DOCS=()
  88. cd python || die
  89. distutils-r1_src_install
  90. fi
  91. }
  92. multilib_src_install_all() {
  93. einstalldocs
  94. prune_libtool_files --modules
  95. }