liboping-1.9.0.ebuild 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. inherit autotools fcaps perl-module
  5. DESCRIPTION="Protocol independent ANSI-C ping library and command line utility"
  6. HOMEPAGE="https://noping.cc/"
  7. SRC_URI="https://noping.cc/files/${P}.tar.bz2"
  8. LICENSE="LGPL-2.1 GPL-2"
  9. SLOT="0/0.2"
  10. KEYWORDS="amd64 arm x86"
  11. IUSE="+filecaps ncurses perl"
  12. DEPEND="ncurses? ( sys-libs/ncurses:0= )"
  13. RDEPEND=${DEPEND}
  14. PATCHES=(
  15. "${FILESDIR}/${PN}-1.6.2-nouidmagic.patch"
  16. "${FILESDIR}/${PN}-1.8.0-remove-ncurses-automagic.patch"
  17. )
  18. src_prepare() {
  19. default
  20. eautoreconf
  21. }
  22. src_configure() {
  23. econf \
  24. $(use_with perl perl-bindings INSTALLDIRS=vendor) \
  25. $(use_with ncurses)
  26. }
  27. src_test() {
  28. if use perl; then
  29. pushd bindings/perl >/dev/null || die
  30. perl-module_src_test
  31. popd >/dev/null || die
  32. fi
  33. }
  34. src_install() {
  35. default
  36. find "${ED}"usr/lib* -name '*.la' -o -name '*.a' -delete || die
  37. }
  38. pkg_postinst() {
  39. if use filecaps; then
  40. local _caps_str="CAP_NET_RAW"
  41. _files=( "${EROOT%/}/usr/bin/oping")
  42. if use ncurses; then
  43. _files+=( "${EROOT%/}/usr/bin/noping")
  44. fi
  45. fcaps "${_caps_str}" "${_files[@]}"
  46. elog "Capabilities for"
  47. elog ""
  48. local _file=
  49. for _file in "${_files[@]}"; do
  50. elog " ${_file}"
  51. done
  52. elog ""
  53. elog "set to ${_caps_str}+EP due to set 'filecaps' USE flag."
  54. elog
  55. fi
  56. }