net-tools-1.60_p20160215155418.ebuild 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit flag-o-matic toolchain-funcs
  5. if [[ ${PV} == "9999" ]] ; then
  6. EGIT_REPO_URI="git://git.code.sf.net/p/net-tools/code"
  7. EGIT_PROJECT="${PN}"
  8. inherit git-2
  9. else
  10. SRC_URI="mirror://gentoo/${P}.tar.xz"
  11. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
  12. fi
  13. DESCRIPTION="Standard Linux networking tools"
  14. HOMEPAGE="http://net-tools.sourceforge.net/"
  15. LICENSE="GPL-2"
  16. SLOT="0"
  17. IUSE="+arp +hostname ipv6 nis nls plipconfig selinux slattach static"
  18. REQUIRED_USE="nis? ( hostname )"
  19. RDEPEND="selinux? ( sys-libs/libselinux )"
  20. DEPEND="${RDEPEND}
  21. selinux? ( virtual/pkgconfig )
  22. app-arch/xz-utils"
  23. if [[ ${PV} == "9999" ]]; then
  24. DEPEND+=" nls? ( sys-devel/gettext )"
  25. fi
  26. RDEPEND+="
  27. hostname? ( !sys-apps/coreutils[hostname] )
  28. !<sys-apps/openrc-0.9.9.3"
  29. maint_pkg_create() {
  30. cd /usr/local/src/net-tools
  31. #git-update
  32. local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
  33. local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
  34. local p="${PN}-${pv}"
  35. git archive --prefix="${p}/" master | tar xf - -C "${T}"
  36. pushd "${T}" >/dev/null
  37. emake -C "${p}/po" dist
  38. sed -i "/^RELEASE/s:=.*:=${pv}:" */Makefile || die
  39. tar cf - ${p}/ | xz > ${p}.tar.xz
  40. popd >/dev/null
  41. du -b "${T}"/*.tar.xz
  42. }
  43. pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
  44. set_opt() {
  45. local opt=$1 ans
  46. shift
  47. ans=$("$@" && echo y || echo n)
  48. einfo "Setting option ${opt} to ${ans}"
  49. sed -i \
  50. -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
  51. config.in || die
  52. }
  53. src_configure() {
  54. # Clear out env vars from the user. #599602
  55. unset BASEDIR BINDIR SBINDIR
  56. set_opt I18N use nls
  57. set_opt HAVE_AFINET6 use ipv6
  58. set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
  59. set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
  60. set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
  61. set_opt HAVE_SELINUX use selinux
  62. set_opt HAVE_ARP_TOOLS use arp
  63. set_opt HAVE_HOSTNAME_TOOLS use hostname
  64. set_opt HAVE_HOSTNAME_SYMLINKS use nis
  65. set_opt HAVE_PLIP_TOOLS use plipconfig
  66. set_opt HAVE_SERIAL_TOOLS use slattach
  67. if use static ; then
  68. append-flags -static
  69. append-ldflags -static
  70. fi
  71. tc-export AR CC
  72. yes "" | ./configure.sh config.in || die
  73. }
  74. src_install() {
  75. # We need to use emake by hand to pass ED. #567300
  76. emake DESTDIR="${ED}" install
  77. dodoc README THANKS TODO
  78. }