iputils-20121221-r2.ebuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # For released versions, we precompile the man/html pages and store
  4. # them in a tarball on our mirrors. This avoids ugly issues while
  5. # building stages, and when the jade/sgml packages are broken (which
  6. # seems to be more common than would be nice).
  7. EAPI="4"
  8. inherit flag-o-matic eutils toolchain-funcs fcaps
  9. if [[ ${PV} == "99999999" ]] ; then
  10. EGIT_REPO_URI="git://www.linux-ipv6.org/gitroot/iputils"
  11. inherit git-2
  12. else
  13. SRC_URI="http://www.skbuff.net/iputils/iputils-s${PV}.tar.bz2
  14. mirror://gentoo/iputils-s${PV}-manpages.tar.bz2"
  15. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux"
  16. fi
  17. DESCRIPTION="Network monitoring tools including ping and ping6"
  18. HOMEPAGE="https://wiki.linuxfoundation.org/networking/iputils"
  19. LICENSE="BSD-4"
  20. SLOT="0"
  21. IUSE="arping caps clockdiff doc gnutls idn ipv6 libressl rarpd rdisc SECURITY_HAZARD ssl static tftpd tracepath traceroute"
  22. LIB_DEPEND="caps? ( sys-libs/libcap[static-libs(+)] )
  23. idn? ( net-dns/libidn[static-libs(+)] )
  24. ipv6? ( ssl? (
  25. gnutls? (
  26. net-libs/gnutls[openssl(+)]
  27. net-libs/gnutls[static-libs(+)]
  28. )
  29. !gnutls? (
  30. !libressl? ( dev-libs/openssl:0[static-libs(+)] )
  31. libressl? ( dev-libs/libressl[static-libs(+)] )
  32. )
  33. ) )"
  34. RDEPEND="arping? ( !net-misc/arping )
  35. rarpd? ( !net-misc/rarpd )
  36. traceroute? ( !net-analyzer/traceroute )
  37. !static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
  38. DEPEND="${RDEPEND}
  39. static? ( ${LIB_DEPEND} )
  40. virtual/os-headers"
  41. if [[ ${PV} == "99999999" ]] ; then
  42. DEPEND+="
  43. app-text/openjade
  44. dev-perl/SGMLSpm
  45. app-text/docbook-sgml-dtd
  46. app-text/docbook-sgml-utils
  47. "
  48. fi
  49. S=${WORKDIR}/${PN}-s${PV}
  50. src_prepare() {
  51. epatch "${FILESDIR}"/021109-uclibc-no-ether_ntohost.patch
  52. epatch "${FILESDIR}"/${PN}-20121221-openssl.patch #335436
  53. epatch "${FILESDIR}"/${PN}-20121221-crypto-build.patch
  54. epatch "${FILESDIR}"/${PN}-20100418-so_mark.patch #335347
  55. epatch "${FILESDIR}"/${PN}-20121221-tftpd-setid.patch
  56. epatch "${FILESDIR}"/${PN}-20121221-tftpd-syslog.patch
  57. epatch "${FILESDIR}"/${PN}-20121221-makefile.patch
  58. epatch "${FILESDIR}"/${PN}-20121221-parallel-doc.patch
  59. epatch "${FILESDIR}"/${PN}-20121221-printf-size.patch
  60. epatch "${FILESDIR}"/${PN}-20121221-owl-pingsock.diff
  61. epatch "${FILESDIR}"/${PN}-20121221-strtod.patch #472592
  62. use SECURITY_HAZARD && epatch "${FILESDIR}"/${PN}-20071127-nonroot-floodping.patch
  63. }
  64. src_configure() {
  65. use static && append-ldflags -static
  66. IPV4_TARGETS=(
  67. ping
  68. $(for v in arping clockdiff rarpd rdisc tftpd tracepath ; do usev ${v} ; done)
  69. )
  70. IPV6_TARGETS=(
  71. ping6
  72. $(usex tracepath 'tracepath6' '')
  73. $(usex traceroute 'traceroute6' '')
  74. )
  75. use ipv6 || IPV6_TARGETS=()
  76. }
  77. src_compile() {
  78. tc-export CC
  79. emake \
  80. USE_CAP=$(usex caps) \
  81. USE_IDN=$(usex idn) \
  82. USE_GNUTLS=$(usex gnutls) \
  83. USE_CRYPTO=$(usex ssl) \
  84. IPV4_TARGETS="${IPV4_TARGETS[*]}" \
  85. IPV6_TARGETS="${IPV6_TARGETS[*]}"
  86. if [[ ${PV} == "99999999" ]] ; then
  87. emake html man
  88. fi
  89. }
  90. src_install() {
  91. into /
  92. dobin ping $(usex ipv6 'ping6' '')
  93. use ipv6 && dosym ping.8 "${EPREFIX}"/usr/share/man/man8/ping6.8
  94. doman doc/ping.8
  95. if use arping ; then
  96. dobin arping
  97. doman doc/arping.8
  98. fi
  99. into /usr
  100. local u
  101. for u in clockdiff rarpd rdisc tftpd tracepath ; do
  102. if use ${u} ; then
  103. case ${u} in
  104. clockdiff) dobin ${u};;
  105. *) dosbin ${u};;
  106. esac
  107. doman doc/${u}.8
  108. fi
  109. done
  110. if use tracepath && use ipv6 ; then
  111. dosbin tracepath6
  112. dosym tracepath.8 "${EPREFIX}"/usr/share/man/man8/tracepath6.8
  113. fi
  114. if use traceroute && use ipv6 ; then
  115. dosbin traceroute6
  116. doman doc/traceroute6.8
  117. fi
  118. if use rarpd ; then
  119. newinitd "${FILESDIR}"/rarpd.init.d rarpd
  120. newconfd "${FILESDIR}"/rarpd.conf.d rarpd
  121. fi
  122. dodoc INSTALL RELNOTES
  123. use doc && dohtml doc/*.html
  124. }
  125. pkg_postinst() {
  126. fcaps cap_net_raw \
  127. bin/ping \
  128. $(usex ipv6 'bin/ping6' '') \
  129. $(usex arping 'bin/arping' '') \
  130. $(usex clockdiff 'usr/bin/clockdiff' '')
  131. }