Diff iputils-20211215 with a iputils-20221126-r1

/usr/portage/net-misc/iputils/iputils-20221126-r1.ebuild 2023-10-09 14:52:34.656368480 +0300
1
# Copyright 1999-2022 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
# For released versions, we precompile the man/html pages and store
5
# them in a tarball on our mirrors.  This avoids ugly issues while
6
# building stages, and reduces dependencies.
7
# To regenerate man/html pages emerge iputils-99999999[doc] with
8
# EGIT_COMMIT set to release tag, all USE flags enabled and
9
# tar ${S}/doc folder.
10

  
11
EAPI="7"
4
EAPI=8
12 5

  
13 6
PLOCALES="de fr ja pt_BR tr uk zh_CN"
14 7

  
15
inherit fcaps flag-o-matic meson plocale systemd toolchain-funcs
8
inherit fcaps meson plocale systemd toolchain-funcs
16 9

  
17
if [[ ${PV} == "99999999" ]] ; then
10
if [[ ${PV} == *9999 ]] ; then
18 11
	EGIT_REPO_URI="https://github.com/iputils/iputils.git"
19 12
	inherit git-r3
20 13
else
21
	SRC_URI="https://github.com/iputils/iputils/archive/${PV}.tar.gz -> ${P}.tar.gz
22
		https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-manpages-${PV}.tar.xz
23
		https://dev.gentoo.org/~whissi/dist/iputils/${PN}-manpages-${PV}.tar.xz"
14
	SRC_URI="https://github.com/iputils/iputils/archive/${PV}.tar.gz -> ${P}.tar.gz"
24 15
	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
25 16
fi
26 17

  
27 18
DESCRIPTION="Network monitoring tools including ping and ping6"
28 19
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iputils"
29 20

  
30
LICENSE="BSD GPL-2+ rdisc"
21
# We install ping unconditionally so BSD is listed by itself
22
# See LICENSE on each release, it summaries per-component
23
LICENSE="
24
	BSD
25
	arping? ( GPL-2+ )
26
	clockdiff? ( BSD )
27
	tracepath? ( GPL-2+ )
28
"
31 29
SLOT="0"
32
IUSE="+arping caps clockdiff doc idn nls rarpd rdisc static test tracepath"
30
IUSE="+arping caps clockdiff doc idn nls test tracepath"
33 31
RESTRICT="!test? ( test )"
34 32

  
35
LIB_DEPEND="
36
	caps? ( sys-libs/libcap[static-libs(+)] )
37
	idn? ( net-dns/libidn2:=[static-libs(+)] )
38
	nls? ( virtual/libintl[static-libs(+)] )
33
RDEPEND="
34
	caps? ( sys-libs/libcap )
35
	idn? ( net-dns/libidn2:= )
36
	nls? ( virtual/libintl )
39 37
"
40
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
41 38
DEPEND="
42 39
	${RDEPEND}
43 40
	virtual/os-headers
44
	static? ( ${LIB_DEPEND} )
45 41
"
46 42
BDEPEND="
43
	app-text/docbook-xml-dtd:4.2
44
	app-text/docbook-xml-dtd:4.5
45
	app-text/docbook-xsl-ns-stylesheets
46
	app-text/docbook-xsl-stylesheets
47
	dev-libs/libxslt
47 48
	virtual/pkgconfig
48 49
	test? ( sys-apps/iproute2 )
49 50
	nls? ( sys-devel/gettext )
50 51
"
51 52

  
52
if [[ ${PV} == 99999999 ]] ; then
53
	BDEPEND+="
54
		app-text/docbook-xml-dtd:4.2
55
		app-text/docbook-xml-dtd:4.5
56
		app-text/docbook-xsl-ns-stylesheets
57
		app-text/docbook-xsl-stylesheets
58
		dev-libs/libxslt
59
	"
60
fi
61

  
62 53
src_prepare() {
63 54
	default
64 55

  
......
66 57
}
67 58

  
68 59
src_configure() {
69
	use static && append-ldflags -static
70

  
71 60
	local emesonargs=(
72 61
		-DUSE_CAP=$(usex caps true false)
73 62
		-DUSE_IDN=$(usex idn true false)
74 63
		-DBUILD_ARPING=$(usex arping true false)
75 64
		-DBUILD_CLOCKDIFF=$(usex clockdiff true false)
76 65
		-DBUILD_PING=true
77
		-DBUILD_RARPD=$(usex rarpd true false)
78
		-DBUILD_RDISC=$(usex rdisc true false)
79
		-DENABLE_RDISC_SERVER=$(usex rdisc true false)
80 66
		-DBUILD_TRACEPATH=$(usex tracepath true false)
81
		-DBUILD_NINFOD=false
82
		-DNINFOD_MESSAGES=false
83 67
		-DNO_SETCAP_OR_SUID=true
84 68
		-Dsystemdunitdir=$(systemd_get_systemunitdir)
85 69
		-DUSE_GETTEXT=$(usex nls true false)
86 70
		$(meson_use !test SKIP_TESTS)
71
		-DBUILD_HTML_MANS=$(usex doc true false)
72
		-DBUILD_MANS=true
87 73
	)
88 74

  
89
	if [[ ${PV} == 99999999 ]] ; then
90
		emesonargs+=(
91
			-DBUILD_HTML_MANS=$(usex doc true false)
92
			-DBUILD_MANS=true
93
		)
94
	else
95
		emesonargs+=(
96
			-DBUILD_HTML_MANS=false
97
			-DBUILD_MANS=false
98
		)
99
	fi
100

  
101 75
	meson_src_configure
102 76
}
103 77

  
......
119 93
src_install() {
120 94
	meson_src_install
121 95

  
122
	dodir /bin
123
	local my_bin
124
	for my_bin in $(usex arping arping '') ping ; do
125
		mv "${ED}"/usr/bin/${my_bin} "${ED}"/bin/ || die
126
	done
127
	dosym ping /bin/ping4
128
	dosym ping /bin/ping6
96
	FILECAPS=( cap_net_raw usr/bin/ping )
97
	use arping && FILECAPS+=( usr/bin/arping )
98
	use clockdiff && FILECAPS+=( usr/bin/clockdiff )
99

  
100
	dosym ping /usr/bin/ping4
101
	dosym ping /usr/bin/ping6
129 102

  
130 103
	if use tracepath ; then
131 104
		dosym tracepath /usr/bin/tracepath4
132 105
		dosym tracepath /usr/bin/tracepath6
106
		dosym tracepath.8 /usr/share/man/man8/tracepath4.8
133 107
		dosym tracepath.8 /usr/share/man/man8/tracepath6.8
134 108
	fi
135 109

  
136
	if [[ ${PV} != 99999999 ]] ; then
137
		local -a man_pages
138
		local -a html_man_pages
139

  
140
		while IFS= read -r -u 3 -d $'\0' my_bin
141
		do
142
			my_bin=$(basename "${my_bin}")
143
			[[ -z "${my_bin}" ]] && continue
144

  
145
			if [[ -f "${S}/doc/${my_bin}.8" ]] ; then
146
				man_pages+=( ${my_bin}.8 )
147
			fi
148

  
149
			if [[ -f "${S}/doc/${my_bin}.html" ]] ; then
150
				html_man_pages+=( ${my_bin}.html )
151
			fi
152
		done 3< <(find "${ED}"/{bin,usr/bin,usr/sbin} -type f -perm -a+x -print0 2>/dev/null)
153

  
154
		pushd doc &>/dev/null || die
155
		doman "${man_pages[@]}"
156
		if use doc ; then
157
			docinto html
158
			dodoc "${html_man_pages[@]}"
159
		fi
160
		popd &>/dev/null || die
161
	else
162
		if use doc ; then
163
			mv "${ED}"/usr/share/${PN} "${ED}"/usr/share/doc/${PF}/html || die
164
		fi
110
	if use doc ; then
111
		mv "${ED}"/usr/share/${PN} "${ED}"/usr/share/doc/${PF}/html || die
165 112
	fi
166 113
}
167 114

  
......
173 120
}
174 121

  
175 122
pkg_postinst() {
123
	fcaps_pkg_postinst
124

  
176 125
	if [[ ${HAD_TFTPD_VERSION} -eq 1 ]] ; then
177 126
		ewarn "This upstream version (>= 20211215) drops two tools:"
178 127
		ewarn "1. tftpd (alternatives: net-ftp/tftp-hpa, net-dns/dnsmasq)"
179 128
		ewarn "2. traceroute6 (alternatives: net-analyzer/mtr, net-analyzer/traceroute)"
180 129
		ewarn "Please install one of the listed alternatives if needed!"
181 130
	fi
182

  
183
	fcaps cap_net_raw \
184
		bin/ping \
185
		$(usex arping 'bin/arping' '') \
186
		$(usex clockdiff 'usr/bin/clockdiff' '')
187 131
}
Thank you!