Сравнение iputils-20211215 с iputils-20221126-r1

/usr/portage/net-misc/iputils/iputils-20221126-r1.ebuild 2024-12-25 14:59:51.263270144 +0300
1
# Copyright 1999-2024 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"
14
	SRC_URI="https://github.com/iputils/iputils/archive/${PV}.tar.gz -> ${P}.tar.gz"
23 15
	KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
24 16
fi
25 17

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

  
29
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
"
30 29
SLOT="0"
31
IUSE="+arping caps clockdiff doc idn nls rarpd rdisc static test tracepath"
30
IUSE="+arping caps clockdiff doc idn nls test tracepath"
32 31
RESTRICT="!test? ( test )"
33 32

  
34
LIB_DEPEND="
35
	caps? ( sys-libs/libcap[static-libs(+)] )
36
	idn? ( net-dns/libidn2:=[static-libs(+)] )
37
	nls? ( virtual/libintl[static-libs(+)] )
33
RDEPEND="
34
	caps? ( sys-libs/libcap )
35
	idn? ( net-dns/libidn2:= )
36
	nls? ( virtual/libintl )
38 37
"
39
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
40 38
DEPEND="
41 39
	${RDEPEND}
42 40
	virtual/os-headers
43
	static? ( ${LIB_DEPEND} )
44 41
"
45 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
46 48
	virtual/pkgconfig
47 49
	test? ( sys-apps/iproute2 )
48 50
	nls? ( sys-devel/gettext )
49 51
"
50 52

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

  
61 53
src_prepare() {
62 54
	default
63 55

  
......
65 57
}
66 58

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

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

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

  
100 75
	meson_src_configure
101 76
}
102 77

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

  
121
	dodir /bin
122
	local my_bin
123
	for my_bin in $(usex arping arping '') ping ; do
124
		mv "${ED}"/usr/bin/${my_bin} "${ED}"/bin/ || die
125
	done
126
	dosym ping /bin/ping4
127
	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
128 102

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

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

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

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

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

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

  
......
172 120
}
173 121

  
174 122
pkg_postinst() {
123
	fcaps_pkg_postinst
124

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

  
182
	fcaps cap_net_raw \
183
		bin/ping \
184
		$(usex arping 'bin/arping' '') \
185
		$(usex clockdiff 'usr/bin/clockdiff' '')
186 131
}
Спасибо!