From d7ed2b01311f15ba54fe8ea872aab7d59ab2b193 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 29 Jan 2021 18:03:51 +0000 Subject: gentoo resync : 29.01.2021 --- net-misc/iputils/Manifest | 5 +- .../iputils/files/iputils-20200821-fclose.patch | 45 ++++++ .../iputils-20200821-getrandom-fallback.patch | 43 +++++ .../files/iputils-20200821-install-sbindir.patch | 29 ++++ net-misc/iputils/iputils-20200821-r2.ebuild | 178 +++++++++++++++++++++ net-misc/iputils/iputils-20200821.ebuild | 174 -------------------- 6 files changed, 299 insertions(+), 175 deletions(-) create mode 100644 net-misc/iputils/files/iputils-20200821-fclose.patch create mode 100644 net-misc/iputils/files/iputils-20200821-getrandom-fallback.patch create mode 100644 net-misc/iputils/files/iputils-20200821-install-sbindir.patch create mode 100644 net-misc/iputils/iputils-20200821-r2.ebuild delete mode 100644 net-misc/iputils/iputils-20200821.ebuild (limited to 'net-misc/iputils') diff --git a/net-misc/iputils/Manifest b/net-misc/iputils/Manifest index 23ff8aacdd54..f0c129ab79d4 100644 --- a/net-misc/iputils/Manifest +++ b/net-misc/iputils/Manifest @@ -2,11 +2,14 @@ AUX iputils-20150815-nonroot-floodping.patch 406 BLAKE2B 18c9adf92bb64ddae4a62aa AUX iputils-20190709-arping-revert-partially-fix-sent-vs-received-package.patch 1134 BLAKE2B cb6a700f3b0681e6abf5bfcfed3b5b4736aeba481e1b5334193cc32dab8e21134ed729d1b6b098495e46f59416f9d2c29f186b87143adcb2824f08058c7792ce SHA512 4e8bd9d4ae752dcdcb169eec1c42bc16d3f89cd1579140db74c3883da54145faea875513aca4bf8241208253b8950590fd615fe2ea7e448d431d509ff2e8dc03 AUX iputils-20190709-ping-fix-main-loop-over-multiple-addrinfo-results.patch 2852 BLAKE2B a9375c41ba6dde249ec2a0a287eef68228198c7132dd145550c55a6f42b29d2e53160ef9a99455e0f60e2bb738f1a2dbeff016f2ce6903ead58c75bdcafeb618 SHA512 e9f322620ce2e10830c7127fdb64e68ea7bad59620e8b1ffd10ec9ee9f49f74500f0efe25de62feb0e1dd3cbd37af744263b53deeae8d78d44a6b9d335686afc AUX iputils-20190709-ping-try-next-addrinfo-on-connect-failure.patch 7935 BLAKE2B 550fc998feb6accae244baf8334d522ffcd6c464756f465c17298bef5338c8e746345026b72c95ff86aa14ef85223ca8cad4e00040f66b4e7aab3526296fc411 SHA512 1da0f189d47cb0b31cea5d1ea8081fbb2be0e55fb5b206cb366dce467bf0e557a2b77b2c8007993bdc91006a5f290269ae70e5d7e50f7fa5bdde93b0079d4e07 +AUX iputils-20200821-fclose.patch 1764 BLAKE2B d74fa527970ede1c52f5a361debe06f46d81821356008429165d7ccd4952e61610b567d9c7008b8ba0d6cf909af8bcc5026dc4b724e441486ff15307f32659f7 SHA512 b17db5137e4ebd1a32d2e051152f6f726b2c6350356ba57262f68a57765f8129a4af27c78620b46ed927217e543937b8f4ba0969ae64aeaa6e67d07c361341fe +AUX iputils-20200821-getrandom-fallback.patch 1056 BLAKE2B 27cf7f9711f877bc55238cccc8714b17bf6e731d0e070e87ed915cf7d18f18019c768d2cea58048795772003408bbcc65c0a12f2fa3ca099b16d84e2ac558b7e SHA512 b1366b67dbee58744ac03dfda3d3daee4f86fada8cb5e44a9ed84ae669cfd2735aee6b21b80d7835e07ec5c42524f359601f6b09b0ac38dd93a18c319db98fe7 +AUX iputils-20200821-install-sbindir.patch 894 BLAKE2B 5947e4d94b802b23ba6160f47bf51208ebf5e056961fe8dee37c67a21dad3e485ebfaca0937089b65514f3c9ac14d0c161c200cdaa17f820e381679eef278214 SHA512 0cf552b0b2770aa061d8edf7a0b1a24ef58c8d1ded4d266224e56644281c9f19c724ee722eb7f35eac9c4a4e493089558a4d961686308a7ded3f776d2fca9553 DIST iputils-20190709.tar.gz 404101 BLAKE2B 38e66366cc13a77b7da1a85afe7245891c6c7069c218bc8d5d0dd3664d07a5c4004aa6fc56c192b90bfacf2e5e103997cd671a236aa0a9932a5818eca1e10744 SHA512 5db18ac49fa46ed810da4d508e78f4baf2d5c07e7f923eb49d005ad8745743d8861e5788b34a7e37fb7261cee7ddfb768b737eee9d200502ea53537142cac6b5 DIST iputils-20200821.tar.gz 504852 BLAKE2B 3ce31554937e28ca3edd204b4b4ba2d11a5eab4ed0d9257cc1f0df38e3ac4d9093f786f308c96c35e1b4909be5de51a0bfb25d890269d9bd7bdd3ea5f612c299 SHA512 4a57c3637cdd9aab2600682774e27370716cbdf1c7ac8ae61bf86c21c08701a5b697792df4aa95309b196eaa74f3cb6b2836a40f04da0e602156e982ac99d8c9 DIST iputils-manpages-20190709.tar.xz 27588 BLAKE2B 9780a96dfde077625a7a499182511066ede63ca364d2de729403354af7cea6b25629da1408ee2081f9da1b21756ee956d04642ea36d05ee02ef7ef05b66c1ad5 SHA512 4de796666426574bd134f4c4ea4d560d8e3eae8bd8ac19b89793fe252a1ef9eebd1833cafb72a2987118f3061eaf00da8a2468e8bced1568611f9391a1203066 DIST iputils-manpages-20200821.tar.xz 19200 BLAKE2B 7d139ccac181eb3d74e3dcd2ba28cb906a0002aa4922de3e37771e2063234fa12428fa44bab3b50e43c40576a66d585a7460cf550afbeacd665fc41a3333d11a SHA512 0dd385565c9a15dfce668d637e055004a347056ee56260a4e726e7aa5ba5a6374aea8e9fc848dfe36b7609e5d92cb8c21f3e88f2d63e7cfe299489e41a17dc33 EBUILD iputils-20190709-r1.ebuild 4987 BLAKE2B e3eae89daf8659c2b2906f1dd4fa12216b19ac2525fc5e11a7f43fc03794959813442c1a95d5b66dba1adb3850bd8b3022767b677e85e92e116a459cf6c2969a SHA512 e7857644e9f152d1d02e951f113c52bfbd7a21444d8ea302d986cbc777c936a9a687fb7dde8637defe95be71acf19b26bad66b346489db8d01050a795fb4c204 -EBUILD iputils-20200821.ebuild 4261 BLAKE2B d8a4ad95cec1b2844bfa24a361095ea65fa4790574ac98d790965f3fd46b72160612dff06f8af9b74dd053bc3ab69690e8dad70c456e0e3d72803e450be99a51 SHA512 27a7457a88419f85464c11a5ffb275ef760b99120d123afed63562328b372b2e53370cbcb8f8bbe6609504045a8f638d6c6117129639d5c0c67326fbedb559d6 +EBUILD iputils-20200821-r2.ebuild 4416 BLAKE2B 3b6053527978f651a281e431ccb9cd42fa098118696c2a9008b0428784e9e8dd77a3b27154c33b425204c16976cef162b04b4cadb5991d3e24456d21e18a7157 SHA512 3efad2ee4e6a67a3b3be3b0aa2d12e478c35856ad11aad2e8b0bca00311e7af807cf53ffe335c8fce129ad4ecc0d6c18e632af653b510ffe6a95571992f4ef4b EBUILD iputils-99999999.ebuild 4262 BLAKE2B feecdd0bf22c8d073a0bf7518a331a98ca3f25b3369a0c3b423af8ff6daf4c4cd784bea2b2c3778ad6afaa01945ab847ade6de2387363b49ecb69f9c2884214e SHA512 393681126d1272b16700ff36bd9597d66cc7000255eefc9bb48a4407869119dbdf6060bf57e29eb32279986552bfa10de4fb2a45be8bd495c4af37457fbbd2a3 MISC metadata.xml 1625 BLAKE2B c29d113e691929f035c7dffbe52e043c1552941565a51021efe401a299aebb5d818ff33a1c99ae086bdc5ecd5a1063db5180b8bd1107dc103e45a8c9450913d2 SHA512 86d64befb808172b14c5e5c53fdc901d51f380045dcc5f42cf770ec03c1722a78677824c2a4823357bdce438edc92cf3d3340436968935c615fa49c4173cc17e diff --git a/net-misc/iputils/files/iputils-20200821-fclose.patch b/net-misc/iputils/files/iputils-20200821-fclose.patch new file mode 100644 index 000000000000..cc370f0a5561 --- /dev/null +++ b/net-misc/iputils/files/iputils-20200821-fclose.patch @@ -0,0 +1,45 @@ +From e1c3d09b412ad0d022178344b8cbf748dc60f17f Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Sun, 24 Jan 2021 23:29:27 -0500 +Subject: [PATCH] tftpd: recvfile: avoid closing the file twice + +The close_stream function calls fclose, so don't call it again. + +This resolves an abort in glibc: + + Message: Process 1038079 (tftpd) of user 65534 dumped core. + + Stack trace of thread 1038079: + #0 0x00007f5f650ed204 raise (libc.so.6 + 0x39204) + #1 0x00007f5f650d6547 abort (libc.so.6 + 0x22547) + #2 0x00007f5f6512f25f n/a (libc.so.6 + 0x7b25f) + #3 0x00007f5f651372fa n/a (libc.so.6 + 0x832fa) + #4 0x00007f5f65138dc2 n/a (libc.so.6 + 0x84dc2) + #5 0x00007f5f65124b2f fclose (libc.so.6 + 0x70b2f) + #6 0x000055571a50de73 recvfile (tftpd + 0x2e73) + #7 0x000055571a50e064 tftp (tftpd + 0x3064) + #8 0x000055571a50e387 tftpd_inetd (tftpd + 0x3387) + #9 0x000055571a50e50f main (tftpd + 0x350f) + #10 0x00007f5f650d7e6d __libc_start_main (libc.so.6 + 0x23e6d) + #11 0x000055571a50d3ca _start (tftpd + 0x23ca) + +Fixes: 5d6be65 ("tftpd: remove global variables by using a run state struct") + +Reviewed-by: Petr Vorel +Signed-off-by: Mike Gilbert +--- + tftpd/tftpd.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c +index 42998f9b..a09d32ba 100644 +--- a/tftpd/tftpd.c ++++ b/tftpd/tftpd.c +@@ -387,7 +387,6 @@ void recvfile(struct run_state *ctl, struct formats *pf) + write_behind(ctl->file, pf->f_convert); + if (close_stream(ctl->file)) + syslog(LOG_ERR, "tftpd: write error: %s\n", strerror(errno)); +- fclose(ctl->file); /* close data file */ + + ap->th_opcode = htons((uint16_t)ACK); /* send the "final" ack */ + ap->th_block = htons(block); diff --git a/net-misc/iputils/files/iputils-20200821-getrandom-fallback.patch b/net-misc/iputils/files/iputils-20200821-getrandom-fallback.patch new file mode 100644 index 000000000000..5b69e5c88fb7 --- /dev/null +++ b/net-misc/iputils/files/iputils-20200821-getrandom-fallback.patch @@ -0,0 +1,43 @@ +From 469b41ac89b9f6772ea31df8379669d205be95f8 Mon Sep 17 00:00:00 2001 +From: Nuno Silva +Date: Mon, 24 Aug 2020 19:34:53 +0100 +Subject: [PATCH] common: fix infinite loop when getrandom fails + +Fixes: https://github.com/iputils/iputils/issues/291 +--- + iputils_common.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/iputils_common.c b/iputils_common.c +index 58eacd0..c41f201 100644 +--- a/iputils_common.c ++++ b/iputils_common.c +@@ -98,18 +98,24 @@ static unsigned int iputil_srand_fallback(void) + void iputils_srand(void) + { + unsigned int i; ++ + #if HAVE_GETRANDOM + ssize_t ret; + +- while ((ret = getrandom(&i, sizeof(i), GRND_NONBLOCK)) != sizeof(i)) { +- switch(errno) { ++ do { ++ errno = 0; ++ ret = getrandom(&i, sizeof(i), GRND_NONBLOCK); ++ switch (errno) { ++ case 0: ++ break; + case EINTR: + continue; + default: + i = iputil_srand_fallback(); +- break; ++ goto done; + } +- } ++ } while (ret != sizeof(i)); ++ done: + #else + i = iputil_srand_fallback(); + #endif diff --git a/net-misc/iputils/files/iputils-20200821-install-sbindir.patch b/net-misc/iputils/files/iputils-20200821-install-sbindir.patch new file mode 100644 index 000000000000..cb1575841ccd --- /dev/null +++ b/net-misc/iputils/files/iputils-20200821-install-sbindir.patch @@ -0,0 +1,29 @@ +From 8d1420f3019cd1caccf2ffa15a5873f0c61ab529 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Sun, 24 Jan 2021 22:39:03 -0500 +Subject: [PATCH] tftpd: install into sbindir + +The xinet.d config expects the daemon to live in sbindir. + +Closes: https://github.com/iputils/iputils/pull/310 + +Reviewed-by: Petr Vorel +Signed-off-by: Mike Gilbert +--- + tftpd/meson.build | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tftpd/meson.build b/tftpd/meson.build +index 6e508a24..b4cf6812 100644 +--- a/tftpd/meson.build ++++ b/tftpd/meson.build +@@ -3,7 +3,8 @@ inc = include_directories('..') + executable('tftpd', ['tftpd.c', 'tftpsubs.c', git_version_h], + include_directories : inc, + link_with : [libcommon], +- install: true) ++ install: true, ++ install_dir: sbindir) + + subs = configuration_data() + subs.set('sbindir', sbindir) diff --git a/net-misc/iputils/iputils-20200821-r2.ebuild b/net-misc/iputils/iputils-20200821-r2.ebuild new file mode 100644 index 000000000000..5219577cf6b7 --- /dev/null +++ b/net-misc/iputils/iputils-20200821-r2.ebuild @@ -0,0 +1,178 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# For released versions, we precompile the man/html pages and store +# them in a tarball on our mirrors. This avoids ugly issues while +# building stages, and reduces depedencies. +# To regenerate man/html pages emerge iputils-99999999[doc] with +# EGIT_COMMIT set to release tag, all USE flags enabled and +# tar ${S}/doc folder. + +EAPI="7" + +PLOCALES="de fr ja pt_BR tr uk zh_CN" + +inherit fcaps flag-o-matic l10n meson systemd toolchain-funcs + +if [[ ${PV} == "99999999" ]] ; then + EGIT_REPO_URI="https://github.com/iputils/iputils.git" + inherit git-r3 +else + SRC_URI="https://github.com/iputils/iputils/archive/s${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~whissi/dist/iputils/${PN}-manpages-${PV}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux" +fi + +DESCRIPTION="Network monitoring tools including ping and ping6" +HOMEPAGE="https://wiki.linuxfoundation.org/networking/iputils" + +LICENSE="BSD GPL-2+ rdisc" +SLOT="0" +IUSE="+arping caps clockdiff doc gcrypt idn ipv6 libressl nettle nls rarpd rdisc ssl static tftpd tracepath traceroute6" + +BDEPEND="virtual/pkgconfig" + +LIB_DEPEND=" + caps? ( sys-libs/libcap[static-libs(+)] ) + idn? ( net-dns/libidn2:=[static-libs(+)] ) + nls? ( sys-devel/gettext[static-libs(+)] ) +" + +RDEPEND=" + traceroute6? ( !net-analyzer/traceroute ) + !static? ( ${LIB_DEPEND//\[static-libs(+)]} ) +" + +DEPEND=" + ${RDEPEND} + virtual/os-headers + static? ( ${LIB_DEPEND} ) +" + +if [[ ${PV} == "99999999" ]] ; then + DEPEND+=" + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-ns-stylesheets + app-text/docbook-xsl-stylesheets + dev-libs/libxslt:0 + " +fi + +[ "${PV}" == "99999999" ] || S="${WORKDIR}/${PN}-s${PV}" + +PATCHES=( + "${FILESDIR}/iputils-20200821-getrandom-fallback.patch" + "${FILESDIR}/iputils-20200821-fclose.patch" + "${FILESDIR}/iputils-20200821-install-sbindir.patch" +) + +src_prepare() { + default + + l10n_get_locales > po/LINGUAS || die +} + +src_configure() { + use static && append-ldflags -static + + local emesonargs=( + -DUSE_CAP="$(usex caps true false)" + -DUSE_IDN="$(usex idn true false)" + -DBUILD_ARPING="$(usex arping true false)" + -DBUILD_CLOCKDIFF="$(usex clockdiff true false)" + -DBUILD_PING="true" + -DBUILD_RARPD="$(usex rarpd true false)" + -DBUILD_RDISC="$(usex rdisc true false)" + -DENABLE_RDISC_SERVER="$(usex rdisc true false)" + -DBUILD_TFTPD="$(usex tftpd true false)" + -DBUILD_TRACEPATH="$(usex tracepath true false)" + -DBUILD_TRACEROUTE6="$(usex ipv6 $(usex traceroute6 true false) false)" + -DBUILD_NINFOD="false" + -DNINFOD_MESSAGES="false" + -DNO_SETCAP_OR_SUID="true" + -Dsystemdunitdir="$(systemd_get_systemunitdir)" + -DUSE_GETTEXT="$(usex nls true false)" + ) + + if [[ "${PV}" == 99999999 ]] ; then + emesonargs+=( + -DBUILD_HTML_MANS="$(usex doc true false)" + -DBUILD_MANS="true" + ) + else + emesonargs+=( + -DBUILD_HTML_MANS="false" + -DBUILD_MANS="false" + ) + fi + + meson_src_configure +} + +src_compile() { + tc-export CC + meson_src_compile +} + +src_install() { + meson_src_install + + dodir /bin + local my_bin + for my_bin in $(usex arping arping '') ping ; do + mv "${ED}"/usr/bin/${my_bin} "${ED}"/bin/ || die + done + dosym ping /bin/ping4 + + if use tracepath ; then + dosym tracepath /usr/bin/tracepath4 + fi + + if use ipv6 ; then + dosym ping /bin/ping6 + + if use tracepath ; then + dosym tracepath /usr/bin/tracepath6 + dosym tracepath.8 /usr/share/man/man8/tracepath6.8 + fi + fi + + if [[ "${PV}" != 99999999 ]] ; then + local -a man_pages + local -a html_man_pages + + while IFS= read -r -u 3 -d $'\0' my_bin + do + my_bin=$(basename "${my_bin}") + [[ -z "${my_bin}" ]] && continue + + if [[ -f "${S}/doc/${my_bin}.8" ]] ; then + man_pages+=( ${my_bin}.8 ) + fi + + if [[ -f "${S}/doc/${my_bin}.html" ]] ; then + html_man_pages+=( ${my_bin}.html ) + fi + done 3< <(find "${ED}"/{bin,usr/bin,usr/sbin} -type f -perm -a+x -print0 2>/dev/null) + + pushd doc &>/dev/null || die + doman "${man_pages[@]}" + if use doc ; then + docinto html + dodoc "${html_man_pages[@]}" + fi + popd &>/dev/null || die + else + if use doc ; then + mv "${ED}"/usr/share/${PN} "${ED}"/usr/share/doc/${PF}/html || die + fi + fi +} + +pkg_postinst() { + fcaps cap_net_raw \ + bin/ping \ + $(usex arping 'bin/arping' '') \ + $(usex clockdiff 'usr/bin/clockdiff' '') +} diff --git a/net-misc/iputils/iputils-20200821.ebuild b/net-misc/iputils/iputils-20200821.ebuild deleted file mode 100644 index 035fe9df7914..000000000000 --- a/net-misc/iputils/iputils-20200821.ebuild +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# For released versions, we precompile the man/html pages and store -# them in a tarball on our mirrors. This avoids ugly issues while -# building stages, and reduces depedencies. -# To regenerate man/html pages emerge iputils-99999999[doc] with -# EGIT_COMMIT set to release tag, all USE flags enabled and -# tar ${S}/doc folder. - -EAPI="7" - -PLOCALES="de fr ja pt_BR tr uk zh_CN" - -inherit fcaps flag-o-matic l10n meson systemd toolchain-funcs - -if [[ ${PV} == "99999999" ]] ; then - EGIT_REPO_URI="https://github.com/iputils/iputils.git" - inherit git-r3 -else - SRC_URI="https://github.com/iputils/iputils/archive/s${PV}.tar.gz -> ${P}.tar.gz - https://dev.gentoo.org/~whissi/dist/iputils/${PN}-manpages-${PV}.tar.xz" - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" -fi - -DESCRIPTION="Network monitoring tools including ping and ping6" -HOMEPAGE="https://wiki.linuxfoundation.org/networking/iputils" - -LICENSE="BSD GPL-2+ rdisc" -SLOT="0" -IUSE="+arping caps clockdiff doc gcrypt idn ipv6 libressl nettle nls rarpd rdisc ssl static tftpd tracepath traceroute6" - -BDEPEND="virtual/pkgconfig" - -LIB_DEPEND=" - caps? ( sys-libs/libcap[static-libs(+)] ) - idn? ( net-dns/libidn2:=[static-libs(+)] ) - nls? ( sys-devel/gettext[static-libs(+)] ) -" - -RDEPEND=" - traceroute6? ( !net-analyzer/traceroute ) - !static? ( ${LIB_DEPEND//\[static-libs(+)]} ) -" - -DEPEND=" - ${RDEPEND} - virtual/os-headers - static? ( ${LIB_DEPEND} ) -" - -if [[ ${PV} == "99999999" ]] ; then - DEPEND+=" - app-text/docbook-xml-dtd:4.2 - app-text/docbook-xml-dtd:4.5 - app-text/docbook-xsl-ns-stylesheets - app-text/docbook-xsl-stylesheets - dev-libs/libxslt:0 - " -fi - -[ "${PV}" == "99999999" ] || S="${WORKDIR}/${PN}-s${PV}" - -PATCHES=() - -src_prepare() { - default - - l10n_get_locales > po/LINGUAS || die -} - -src_configure() { - use static && append-ldflags -static - - local emesonargs=( - -DUSE_CAP="$(usex caps true false)" - -DUSE_IDN="$(usex idn true false)" - -DBUILD_ARPING="$(usex arping true false)" - -DBUILD_CLOCKDIFF="$(usex clockdiff true false)" - -DBUILD_PING="true" - -DBUILD_RARPD="$(usex rarpd true false)" - -DBUILD_RDISC="$(usex rdisc true false)" - -DENABLE_RDISC_SERVER="$(usex rdisc true false)" - -DBUILD_TFTPD="$(usex tftpd true false)" - -DBUILD_TRACEPATH="$(usex tracepath true false)" - -DBUILD_TRACEROUTE6="$(usex ipv6 $(usex traceroute6 true false) false)" - -DBUILD_NINFOD="false" - -DNINFOD_MESSAGES="false" - -DNO_SETCAP_OR_SUID="true" - -Dsystemdunitdir="$(systemd_get_systemunitdir)" - -DUSE_GETTEXT="$(usex nls true false)" - ) - - if [[ "${PV}" == 99999999 ]] ; then - emesonargs+=( - -DBUILD_HTML_MANS="$(usex doc true false)" - -DBUILD_MANS="true" - ) - else - emesonargs+=( - -DBUILD_HTML_MANS="false" - -DBUILD_MANS="false" - ) - fi - - meson_src_configure -} - -src_compile() { - tc-export CC - meson_src_compile -} - -src_install() { - meson_src_install - - dodir /bin - local my_bin - for my_bin in $(usex arping arping '') ping ; do - mv "${ED}"/usr/bin/${my_bin} "${ED}"/bin/ || die - done - dosym ping /bin/ping4 - - if use tracepath ; then - dosym tracepath /usr/bin/tracepath4 - fi - - if use ipv6 ; then - dosym ping /bin/ping6 - - if use tracepath ; then - dosym tracepath /usr/bin/tracepath6 - dosym tracepath.8 /usr/share/man/man8/tracepath6.8 - fi - fi - - if [[ "${PV}" != 99999999 ]] ; then - local -a man_pages - local -a html_man_pages - - while IFS= read -r -u 3 -d $'\0' my_bin - do - my_bin=$(basename "${my_bin}") - [[ -z "${my_bin}" ]] && continue - - if [[ -f "${S}/doc/${my_bin}.8" ]] ; then - man_pages+=( ${my_bin}.8 ) - fi - - if [[ -f "${S}/doc/${my_bin}.html" ]] ; then - html_man_pages+=( ${my_bin}.html ) - fi - done 3< <(find "${ED}"/{bin,usr/bin,usr/sbin} -type f -perm -a+x -print0 2>/dev/null) - - pushd doc &>/dev/null || die - doman "${man_pages[@]}" - if use doc ; then - docinto html - dodoc "${html_man_pages[@]}" - fi - popd &>/dev/null || die - else - if use doc ; then - mv "${ED}"/usr/share/${PN} "${ED}"/usr/share/doc/${PF}/html || die - fi - fi -} - -pkg_postinst() { - fcaps cap_net_raw \ - bin/ping \ - $(usex arping 'bin/arping' '') \ - $(usex clockdiff 'usr/bin/clockdiff' '') -} -- cgit v1.2.3