libnl-3.3.0_rc1.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. "
  15. LICENSE="LGPL-2.1 utils? ( GPL-2 )"
  16. SLOT="3"
  17. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
  18. IUSE="static-libs python utils"
  19. RDEPEND="
  20. python? ( ${PYTHON_DEPS} )
  21. abi_x86_32? (
  22. !<=app-emulation/emul-linux-x86-baselibs-20140508-r5
  23. !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
  24. )
  25. "
  26. DEPEND="
  27. ${RDEPEND}
  28. python? ( dev-lang/swig )
  29. sys-devel/bison
  30. sys-devel/flex
  31. "
  32. REQUIRED_USE="
  33. python? ( ${PYTHON_REQUIRED_USE} )
  34. "
  35. DOCS=(
  36. ChangeLog
  37. )
  38. S=${WORKDIR}/${LIBNL_P}
  39. MULTILIB_WRAPPED_HEADERS=(
  40. # we do not install CLI stuff for non-native
  41. /usr/include/libnl3/netlink/cli/addr.h
  42. /usr/include/libnl3/netlink/cli/class.h
  43. /usr/include/libnl3/netlink/cli/cls.h
  44. /usr/include/libnl3/netlink/cli/ct.h
  45. /usr/include/libnl3/netlink/cli/exp.h
  46. /usr/include/libnl3/netlink/cli/link.h
  47. /usr/include/libnl3/netlink/cli/neigh.h
  48. /usr/include/libnl3/netlink/cli/qdisc.h
  49. /usr/include/libnl3/netlink/cli/route.h
  50. /usr/include/libnl3/netlink/cli/rule.h
  51. /usr/include/libnl3/netlink/cli/tc.h
  52. /usr/include/libnl3/netlink/cli/utils.h
  53. )
  54. src_prepare() {
  55. default
  56. elibtoolize
  57. if use python; then
  58. cd "${S}"/python || die
  59. distutils-r1_src_prepare
  60. fi
  61. # out-of-source build broken
  62. # https://github.com/thom311/libnl/pull/58
  63. multilib_copy_sources
  64. }
  65. multilib_src_configure() {
  66. econf \
  67. --disable-silent-rules \
  68. $(use_enable static-libs static) \
  69. $(multilib_native_use_enable utils cli)
  70. }
  71. multilib_src_compile() {
  72. default
  73. if multilib_is_native_abi && use python; then
  74. cd python || die
  75. distutils-r1_src_compile
  76. fi
  77. }
  78. multilib_src_install() {
  79. emake DESTDIR="${D}" install
  80. if multilib_is_native_abi && use python; then
  81. # Unset DOCS= since distutils-r1.eclass interferes
  82. local DOCS=()
  83. cd python || die
  84. distutils-r1_src_install
  85. fi
  86. }
  87. multilib_src_install_all() {
  88. einstalldocs
  89. prune_libtool_files --modules
  90. }