Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/distcc/
Date: Wed, 14 Aug 2019 23:04:56
Message-Id: 1565823885.6fe1578d38848b2b45b8b5cf83117ed1e463a140.mgorny@gentoo
1 commit: 6fe1578d38848b2b45b8b5cf83117ed1e463a140
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 14 21:36:37 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 14 23:04:45 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6fe1578d
7
8 sys-devel/distcc: Bump to 3.3.3
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-devel/distcc/Manifest | 1 +
13 sys-devel/distcc/distcc-3.3.3.ebuild | 196 +++++++++++++++++++++++++++++++++++
14 2 files changed, 197 insertions(+)
15
16 diff --git a/sys-devel/distcc/Manifest b/sys-devel/distcc/Manifest
17 index 2098365b9c6..5e6d668cdda 100644
18 --- a/sys-devel/distcc/Manifest
19 +++ b/sys-devel/distcc/Manifest
20 @@ -1 +1,2 @@
21 DIST distcc-3.3.2.tar.gz 1008938 BLAKE2B e784002dffefd395b068d237a86203563fefc81e17a08c4d2e372eaaf62c5ac799011fc8633c8bfb717f0ebc8c8cb8b999c941e0f5f87c4077d031a9e5c4b138 SHA512 fdf11ed94ba50977b45e302179c5c4ba067cc3db37579cb8ed6d5b9487f8e3c89114f65af69333c38d374cf7634d7aef8d5a2d5c7fd8e9b1f4930c0897d6da10
22 +DIST distcc-3.3.3.tar.gz 1195666 BLAKE2B b393fdb20eb555dec794bf55c1287dd804a576e0a5db9f2fa84c3924a40185a193231aea807353918430297c9c83c7592aaaafd521cf73c92a72bf30b8a69caa SHA512 d5e7fc67f49ee640cef753038b5c0ebcbbac61c6ac29f20ee4736b045a89979ced765717c46383a4fadc50a4fe34e94e58e307509144414a9ca19eb4cc68a135
23
24 diff --git a/sys-devel/distcc/distcc-3.3.3.ebuild b/sys-devel/distcc/distcc-3.3.3.ebuild
25 new file mode 100644
26 index 00000000000..7d4e47111f2
27 --- /dev/null
28 +++ b/sys-devel/distcc/distcc-3.3.3.ebuild
29 @@ -0,0 +1,196 @@
30 +# Copyright 1999-2019 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +PYTHON_COMPAT=( python3_{5,6} )
36 +
37 +inherit autotools flag-o-matic python-single-r1 systemd \
38 + toolchain-funcs user xdg-utils prefix
39 +
40 +DESCRIPTION="Distribute compilation of C code across several machines on a network"
41 +HOMEPAGE="http://distcc.org/"
42 +SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.gz"
43 +
44 +LICENSE="GPL-2+"
45 +SLOT="0"
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
47 +IUSE="gnome gssapi gtk hardened ipv6 selinux xinetd zeroconf"
48 +
49 +RESTRICT="test"
50 +
51 +CDEPEND="${PYTHON_DEPS}
52 + dev-libs/popt
53 + gnome? (
54 + >=gnome-base/libgnome-2
55 + >=gnome-base/libgnomeui-2
56 + x11-libs/gtk+:2
57 + x11-libs/pango
58 + )
59 + gssapi? ( net-libs/libgssglue )
60 + gtk? ( x11-libs/gtk+:2 )
61 + zeroconf? ( >=net-dns/avahi-0.6[dbus] )
62 +"
63 +DEPEND="${CDEPEND}
64 + sys-devel/autoconf-archive
65 + sys-libs/binutils-libs
66 + virtual/pkgconfig"
67 +RDEPEND="${CDEPEND}
68 + !net-misc/pump
69 + dev-util/shadowman
70 + >=sys-devel/gcc-config-1.4.1
71 + selinux? ( sec-policy/selinux-distcc )
72 + xinetd? ( sys-apps/xinetd )"
73 +
74 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
75 +
76 +pkg_setup() {
77 + enewuser distcc 240 -1 -1 daemon
78 + python-single-r1_pkg_setup
79 +}
80 +
81 +src_prepare() {
82 + eapply "${FILESDIR}/${PN}-3.0-xinetd.patch"
83 + # bug #255188
84 + eapply "${FILESDIR}/${PN}-3.3.2-freedesktop.patch"
85 + # SOCKSv5 support needed for Portage, bug #537616
86 + eapply "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
87 + eapply_user
88 +
89 + # Bugs #120001, #167844 and probably more. See patch for description.
90 + use hardened && eapply "${FILESDIR}/distcc-hardened.patch"
91 +
92 + sed -i \
93 + -e "/PATH/s:\$distcc_location:${EPREFIX}/usr/lib/distcc/bin:" \
94 + -e "s:@PYTHON@:${EPYTHON}:" \
95 + pump.in || die "sed failed"
96 +
97 + sed \
98 + -e "s:@EPREFIX@:${EPREFIX:-/}:" \
99 + -e "s:@libdir@:/usr/lib:" \
100 + "${FILESDIR}/distcc-config" > "${T}/distcc-config" || die
101 +
102 + hprefixify update-distcc-symlinks.py src/{serve,daemon}.c
103 + python_fix_shebang update-distcc-symlinks.py "${T}/distcc-config"
104 + eautoreconf
105 +}
106 +
107 +src_configure() {
108 + local myconf=(
109 + --disable-Werror
110 + --libdir=/usr/lib
111 + $(use_enable ipv6 rfc2553)
112 + $(use_with gtk)
113 + $(use_with gnome)
114 + $(use_with gssapi auth)
115 + $(use_with zeroconf avahi)
116 + )
117 +
118 + econf "${myconf[@]}"
119 +}
120 +
121 +src_install() {
122 + # override GZIP_BIN to stop it from compressing manpages
123 + emake DESTDIR="${D}" GZIP_BIN=false install
124 + python_optimize
125 +
126 + newinitd "${FILESDIR}/distccd.initd" distccd
127 + systemd_newunit "${FILESDIR}/distccd.service-1" distccd.service
128 + systemd_install_serviced "${FILESDIR}/distccd.service.conf"
129 +
130 + cp "${FILESDIR}/distccd.confd" "${T}/distccd" || die
131 + if use zeroconf; then
132 + cat >> "${T}/distccd" <<-EOF || die
133 +
134 + # Enable zeroconf support in distccd
135 + DISTCCD_OPTS="\${DISTCCD_OPTS} --zeroconf"
136 + EOF
137 +
138 + sed -i '/ExecStart/ s|$| --zeroconf|' "${D}$(systemd_get_systemunitdir)"/distccd.service || die
139 + fi
140 + doconfd "${T}/distccd"
141 +
142 + newenvd - 02distcc <<-EOF || die
143 + # This file is managed by distcc-config; use it to change these settings.
144 + # DISTCC_LOG and DISTCC_DIR should not be set.
145 + DISTCC_VERBOSE="${DISTCC_VERBOSE:-0}"
146 + DISTCC_FALLBACK="${DISTCC_FALLBACK:-1}"
147 + DISTCC_SAVE_TEMPS="${DISTCC_SAVE_TEMPS:-0}"
148 + DISTCC_TCP_CORK="${DISTCC_TCP_CORK}"
149 + DISTCC_SSH="${DISTCC_SSH}"
150 + UNCACHED_ERR_FD="${UNCACHED_ERR_FD}"
151 + DISTCC_ENABLE_DISCREPANCY_EMAIL="${DISTCC_ENABLE_DISCREPANCY_EMAIL}"
152 + DCC_EMAILLOG_WHOM_TO_BLAME="${DCC_EMAILLOG_WHOM_TO_BLAME}"
153 + EOF
154 +
155 + keepdir /usr/lib/distcc
156 +
157 + dobin "${T}/distcc-config"
158 +
159 + if use gnome || use gtk; then
160 + einfo "Renaming /usr/bin/distccmon-gnome to /usr/bin/distccmon-gui"
161 + einfo "This is to have a little sensability in naming schemes between distccmon programs"
162 + mv "${ED}/usr/bin/distccmon-gnome" "${ED}/usr/bin/distccmon-gui" || die
163 + dosym distccmon-gui /usr/bin/distccmon-gnome
164 + fi
165 +
166 + if use xinetd; then
167 + insinto /etc/xinetd.d
168 + newins "doc/example/xinetd" distcc
169 + fi
170 +
171 + insinto /usr/share/shadowman/tools
172 + newins - distcc <<<"${EPREFIX}/usr/lib/distcc/bin"
173 + newins - distccd <<<"${EPREFIX}/usr/lib/distcc"
174 +
175 + rm -r "${ED}/etc/default" || die
176 + rm "${ED}/etc/distcc/clients.allow" || die
177 + rm "${ED}/etc/distcc/commands.allow.sh" || die
178 +}
179 +
180 +pkg_postinst() {
181 + # remove the old paths when switching from libXX to lib
182 + if [[ $(get_libdir) != lib && ${SYMLINK_LIB} != yes && \
183 + -d ${EROOT%/}/usr/$(get_libdir)/distcc ]]; then
184 + rm -r -f "${EROOT%/}/usr/$(get_libdir)/distcc" || die
185 + fi
186 +
187 + if [[ ${ROOT} == / ]]; then
188 + eselect compiler-shadow update distcc
189 + eselect compiler-shadow update distccd
190 + fi
191 +
192 + use gnome && xdg_desktop_database_update
193 +
194 + elog
195 + elog "Tips on using distcc with Gentoo can be found at"
196 + elog "https://wiki.gentoo.org/wiki/Distcc"
197 + elog
198 + elog "distcc-pump is known to cause breakage with multiple packages."
199 + elog "Do NOT enable it globally."
200 + elog
201 + elog "To use the distccmon programs with Gentoo you should use this command:"
202 + elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-text 5"
203 +
204 + if use gnome || use gtk; then
205 + elog "Or:"
206 + elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-gnome"
207 + fi
208 +
209 + elog
210 + elog "***SECURITY NOTICE***"
211 + elog "Since distcc-3.3, whitelist is used for what distccd could execute. The whilelist"
212 + elog "has been generated by compiler-shadow distccd. To revert to the old behavior, "
213 + elog "you need to pass --make-me-a-botnet to distccd in /etc/conf.d/distccd."
214 + elog "Cf. https://github.com/distcc/distcc/pull/243."
215 +}
216 +
217 +pkg_prerm() {
218 + if [[ -z ${REPLACED_BY_VERSION} && ${ROOT} == / ]]; then
219 + eselect compiler-shadow remove distcc
220 + fi
221 +}
222 +
223 +pkg_postrm() {
224 + use gnome && xdg_desktop_database_update
225 +}