Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/iputils/
Date: Tue, 27 Nov 2018 12:36:09
Message-Id: 1543322156.b0b6bc4f3a5e3fd56d9f0ec55e9443957b1e0586.polynomial-c@gentoo
1 commit: b0b6bc4f3a5e3fd56d9f0ec55e9443957b1e0586
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 27 12:17:37 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 27 12:35:56 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0b6bc4f
7
8 net-misc/iputils: Convert live ebuild to use meson
9
10 Closes: https://bugs.gentoo.org/672046
11 Package-Manager: Portage-2.3.52, Repoman-2.3.12
12 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
13
14 net-misc/iputils/iputils-99999999.ebuild | 144 ++++++++++++++-----------------
15 1 file changed, 63 insertions(+), 81 deletions(-)
16
17 diff --git a/net-misc/iputils/iputils-99999999.ebuild b/net-misc/iputils/iputils-99999999.ebuild
18 index d728fe52c47..ccc540e0855 100644
19 --- a/net-misc/iputils/iputils-99999999.ebuild
20 +++ b/net-misc/iputils/iputils-99999999.ebuild
21 @@ -1,4 +1,4 @@
22 -# Copyright 1999-2018 Gentoo Foundation
23 +# Copyright 1999-2018 Gentoo Authors
24 # Distributed under the terms of the GNU General Public License v2
25
26 # For released versions, we precompile the man/html pages and store
27 @@ -9,9 +9,7 @@
28
29 EAPI="6"
30
31 -inherit flag-o-matic toolchain-funcs fcaps
32 -
33 -PATCHES=()
34 +inherit fcaps flag-o-matic meson systemd toolchain-funcs
35
36 if [[ ${PV} == "99999999" ]] ; then
37 EGIT_REPO_URI="https://github.com/iputils/iputils.git"
38 @@ -29,7 +27,8 @@ LICENSE="BSD GPL-2+ rdisc"
39 SLOT="0"
40 IUSE="+arping caps clockdiff doc gcrypt idn ipv6 libressl nettle rarpd rdisc SECURITY_HAZARD ssl static tftpd tracepath traceroute"
41
42 -LIB_DEPEND="caps? ( sys-libs/libcap[static-libs(+)] )
43 +LIB_DEPEND="
44 + caps? ( sys-libs/libcap[static-libs(+)] )
45 idn? ( net-dns/libidn2:=[static-libs(+)] )
46 ipv6? (
47 ssl? (
48 @@ -44,23 +43,30 @@ LIB_DEPEND="caps? ( sys-libs/libcap[static-libs(+)] )
49 )
50 )
51 "
52 -RDEPEND="arping? ( !net-misc/arping )
53 +RDEPEND="
54 + arping? ( !net-misc/arping )
55 rarpd? ( !net-misc/rarpd )
56 traceroute? ( !net-analyzer/traceroute )
57 - !static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
58 -DEPEND="${RDEPEND}
59 + !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
60 +"
61 +DEPEND="
62 + ${RDEPEND}
63 static? ( ${LIB_DEPEND} )
64 virtual/os-headers
65 + virtual/pkgconfig
66 "
67 if [[ ${PV} == "99999999" ]] ; then
68 - DEPEND+="app-text/docbook-xml-dtd:4.2
69 + DEPEND+="
70 + app-text/docbook-xml-dtd:4.2
71 app-text/docbook-xml-dtd:4.5
72 app-text/docbook-xsl-stylesheets
73 dev-libs/libxslt:0
74 "
75 fi
76
77 -[ "${PV}" = "99999999" ] || S="${WORKDIR}/${PN}-s${PV}"
78 +[ "${PV}" == "99999999" ] || S="${WORKDIR}/${PN}-s${PV}"
79 +
80 +PATCHES=()
81
82 src_prepare() {
83 use SECURITY_HAZARD && PATCHES+=( "${FILESDIR}"/${PN}-20150815-nonroot-floodping.patch )
84 @@ -71,99 +77,75 @@ src_prepare() {
85 src_configure() {
86 use static && append-ldflags -static
87
88 - TARGETS=(
89 - ping
90 - $(for v in arping clockdiff rarpd rdisc tftpd tracepath ; do usev ${v} ; done)
91 + local emesonargs=(
92 + -DUSE_CAP="$(usex caps true false)"
93 + -DUSE_IDN="$(usex idn true false)"
94 + -DBUILD_ARPING="$(usex arping true false)"
95 + -DBUILD_CLOCKDIFF="$(usex clockdiff true false)"
96 + -DBUILD_PING="true"
97 + -DBUILD_RARPD="$(usex rarpd true false)"
98 + -DBUILD_RDISC="$(usex rdisc true false)"
99 + -DENABLE_RDISC_SERVER="$(usex rdisc true false)"
100 + -DBUILD_TFTPD="$(usex tftpd true false)"
101 + -DBUILD_TRACEPATH="$(usex tracepath true false)"
102 + -DBUILD_TRACEROUTE6="$(usex ipv6 $(usex traceroute true false) false)"
103 + -DBUILD_NINFOD="false"
104 + -DNINFOD_MESSAGES="false"
105 + -DBUILD_HTML_MANS="$(usex doc true false)"
106 + -DUSE_SYSFS="$(usex arping true false)"
107 + -Dsystemdunitdir="$(systemd_get_systemunitdir)"
108 )
109 - if use ipv6 ; then
110 - TARGETS+=(
111 - $(usex traceroute 'traceroute6' '')
112 +
113 + if use ipv6 && use ssl ; then
114 + emesonargs+=(
115 + -DUSE_CRYPTO="$(usex gcrypt gcrypt $(usex nettle nettle openssl))"
116 + )
117 + else
118 + emesonargs+=(
119 + -DUSE_CRYPTO="none"
120 )
121 fi
122
123 - myconf=(
124 - USE_CRYPTO=no
125 - USE_GCRYPT=no
126 - USE_NETTLE=no
127 - )
128 -
129 - if use ipv6 && use ssl ; then
130 - myconf=(
131 - USE_CRYPTO=yes
132 - USE_GCRYPT=$(usex gcrypt)
133 - USE_NETTLE=$(usex nettle)
134 + if [[ "${PV}" != 99999999 ]] ; then
135 + emesonargs+=(
136 + -DBUILD_MANS="false"
137 )
138 fi
139 +
140 + meson_src_configure
141 }
142
143 src_compile() {
144 tc-export CC
145 - emake \
146 - USE_CAP=$(usex caps) \
147 - USE_IDN=$(usex idn) \
148 - IPV4_DEFAULT=$(usex ipv6 'no' 'yes') \
149 - TARGETS="${TARGETS[*]}" \
150 - ${myconf[@]}
151 -
152 - if [[ ${PV} == "99999999" ]] ; then
153 - emake man
154 -
155 - use doc && emake html
156 - fi
157 + meson_src_compile
158 }
159
160 src_install() {
161 - into /
162 - dobin ping
163 - dosym ping /bin/ping4
164 - if use ipv6 ; then
165 - dosym ping /bin/ping6
166 - dosym ping.8 /usr/share/man/man8/ping6.8
167 - fi
168 - doman doc/ping.8
169 -
170 - if use arping ; then
171 - dobin arping
172 - doman doc/arping.8
173 - fi
174 + meson_src_install
175
176 - into /usr
177 + dodir /bin
178 + local my_bin
179 + for my_bin in $(usex arping arping '') ping ; do
180 + mv "${ED%/}"/usr/bin/${my_bin} "${ED%/}"/bin/ || die
181 + done
182 + dosym ping /bin/ping4
183
184 if use tracepath ; then
185 - dosbin tracepath
186 - doman doc/tracepath.8
187 - dosym tracepath /usr/sbin/tracepath4
188 + dosym tracepath /usr/bin/tracepath4
189 fi
190
191 - local u
192 - for u in clockdiff rarpd rdisc tftpd ; do
193 - if use ${u} ; then
194 - case ${u} in
195 - clockdiff) dobin ${u};;
196 - *) dosbin ${u};;
197 - esac
198 - doman doc/${u}.8
199 - fi
200 - done
201 -
202 - if use tracepath && use ipv6 ; then
203 - dosym tracepath /usr/sbin/tracepath6
204 - dosym tracepath.8 /usr/share/man/man8/tracepath6.8
205 - fi
206 + if use ipv6 ; then
207 + dosym ping /bin/ping6
208
209 - if use traceroute && use ipv6 ; then
210 - dosbin traceroute6
211 - doman doc/traceroute6.8
212 + if use tracepath ; then
213 + dosym tracepath /usr/bin/tracepath6
214 + dosym tracepath.8 /usr/share/man/man8/tracepath6.8
215 + fi
216 fi
217
218 - if use rarpd ; then
219 - newinitd "${FILESDIR}"/rarpd.init.d rarpd
220 - newconfd "${FILESDIR}"/rarpd.conf.d rarpd
221 + if use doc ; then
222 + mv "${ED%/}"/usr/share/${PN} "${ED%/}"/usr/share/doc/${PF}/html || die
223 fi
224 -
225 - dodoc INSTALL.md
226 -
227 - use doc && dodoc doc/*.html
228 }
229
230 pkg_postinst() {