Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/apt-cacher-ng/files/, net-misc/apt-cacher-ng/
Date: Thu, 11 Feb 2021 08:56:22
Message-Id: 1613033763.643ed593c89f5f81e01cd5371cd06ab41b7349a9.juippis@gentoo
1 commit: 643ed593c89f5f81e01cd5371cd06ab41b7349a9
2 Author: John Helmert III <jchelmert3 <AT> posteo <DOT> net>
3 AuthorDate: Sat Jan 30 05:26:18 2021 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 11 08:56:03 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=643ed593
7
8 net-misc/apt-cacher-ng: bump to 3.5_p3
9
10 Rework so as to not install everything manually in src_install but rely
11 on the build system, clean up src_configure a bit, clean up
12 dependencies, drop useless IUSE=systemd and related dependency, drop
13 user.eclass and depend on acct-{user,group} packages, and update the
14 OpenRC init.d and conf.d files to fix a security bug. These files were
15 written by Michael Orlitzky (mjo).
16
17 Bug: https://bugs.gentoo.org/631878
18 Closes: https://bugs.gentoo.org/538214
19 Closes: https://bugs.gentoo.org/701220
20 Thanks-to: Michael Orlitzky <mjo <AT> gentoo.org>
21 Signed-off-by: John Helmert III <jchelmert3 <AT> posteo.net>
22 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
23
24 net-misc/apt-cacher-ng/Manifest | 2 +-
25 .../apt-cacher-ng/apt-cacher-ng-3.5_p1-r1.ebuild | 129 ---------------------
26 net-misc/apt-cacher-ng/apt-cacher-ng-3.5_p3.ebuild | 97 ++++++++++++++++
27 net-misc/apt-cacher-ng/files/confd-r2 | 9 ++
28 net-misc/apt-cacher-ng/files/initd-r3 | 20 ++++
29 5 files changed, 127 insertions(+), 130 deletions(-)
30
31 diff --git a/net-misc/apt-cacher-ng/Manifest b/net-misc/apt-cacher-ng/Manifest
32 index 5715fe065c4..8f5b3dcee4f 100644
33 --- a/net-misc/apt-cacher-ng/Manifest
34 +++ b/net-misc/apt-cacher-ng/Manifest
35 @@ -1,2 +1,2 @@
36 -DIST apt-cacher-ng_3.5-1.debian.tar.xz 49916 BLAKE2B c01c96e5cf46fa3b8c46145b34976f3c4a3b545819719a8de517fe53a91d6f65c460bee59d98de750912d7bb9e3416804a088bdf274d74352c35f757cdeb16ea SHA512 8a543f94ef5e206be40070eb757c950ad6915cfbd6cacfadb5bd91070d14b4bb1c3c550823cd088c15335963587cc34d414518ae0013f6561996f855ccf97359
37 +DIST apt-cacher-ng_3.5-3.debian.tar.xz 49708 BLAKE2B 85092374207a252dcb4ef7b95dc434f81f9b67791e20099dc058022a9a575130070c12827f3fd04640fcec3b44a444fb85d8cea6439d5eaeeb359f263fb05682 SHA512 f690ae69d38b8e9c73ef095e9779364c7c5ccd246b19e8f5ce2edde47861e44c0aedabc75bcf11f5b408e034e52190dc8ed1789b503284f8f68dc1f5e84e1712
38 DIST apt-cacher-ng_3.5.orig.tar.xz 325260 BLAKE2B 1cf19bd575d4e3d320f73771b31e98977417713d57ceaaccb8b6c0eff7bd5e02c99a0c197ddbc09d14d8f6a70799525dedfe1fbacb00357f65f0c8c4d540bcab SHA512 0bbc78c128d353ec2504f4d898d0ffb339778e98ab9899d48c61c094b15cafd92e430f864c82b66049578f5dd3c9e74fc5c09883231faeddce453be64e6f8954
39
40 diff --git a/net-misc/apt-cacher-ng/apt-cacher-ng-3.5_p1-r1.ebuild b/net-misc/apt-cacher-ng/apt-cacher-ng-3.5_p1-r1.ebuild
41 deleted file mode 100644
42 index 362e497b3c1..00000000000
43 --- a/net-misc/apt-cacher-ng/apt-cacher-ng-3.5_p1-r1.ebuild
44 +++ /dev/null
45 @@ -1,129 +0,0 @@
46 -# Copyright 1999-2020 Gentoo Authors
47 -# Distributed under the terms of the GNU General Public License v2
48 -
49 -EAPI=7
50 -inherit cmake user
51 -
52 -DESCRIPTION="Yet another caching HTTP proxy for Debian/Ubuntu software packages"
53 -HOMEPAGE="
54 - https://www.unix-ag.uni-kl.de/~bloch/acng/
55 - https://packages.qa.debian.org/a/apt-cacher-ng.html
56 -"
57 -LICENSE="BSD-4 ZLIB public-domain"
58 -SLOT="0"
59 -SRC_URI="
60 - mirror://debian/pool/main/a/${PN}/${PN}_${PV/_*}.orig.tar.xz
61 - mirror://debian/pool/main/a/${PN}/${PN}_${PV/_p/-}.debian.tar.xz
62 -"
63 -
64 -KEYWORDS="~amd64 ~x86"
65 -IUSE="doc fuse systemd tcpd"
66 -
67 -COMMON_DEPEND="
68 - app-arch/bzip2
69 - app-arch/xz-utils
70 - dev-libs/libevent:=
71 - dev-libs/openssl:0=
72 - sys-libs/zlib
73 - systemd? (
74 - sys-apps/systemd
75 - )
76 -"
77 -BDEPEND="
78 - ${COMMON_DEPEND}
79 - virtual/pkgconfig
80 -"
81 -RDEPEND="
82 - ${COMMON_DEPEND}
83 - dev-lang/perl
84 - fuse? ( sys-fs/fuse )
85 - tcpd? ( sys-apps/tcp-wrappers )
86 -"
87 -PATCHES=(
88 - "${FILESDIR}"/${PN}-3.3.1-flags.patch
89 - "${FILESDIR}"/${PN}-3.5-perl-syntax.patch
90 - "${WORKDIR}"/debian/patches/debian-changes
91 -)
92 -S=${WORKDIR}/${P/_*}
93 -
94 -pkg_setup() {
95 - # add new user & group for daemon
96 - enewgroup ${PN}
97 - enewuser ${PN} -1 -1 -1 ${PN}
98 -}
99 -
100 -src_configure() {
101 - local mycmakeargs=()
102 - if use fuse; then
103 - mycmakeargs+=( "-DHAVE_FUSE_25=yes" )
104 - else
105 - mycmakeargs+=( "-DHAVE_FUSE_25=no" )
106 - fi
107 - if use tcpd; then
108 - mycmakeargs+=( "-DHAVE_LIBWRAP=yes" )
109 - else
110 - mycmakeargs+=( "-DHAVE_LIBWRAP=no" )
111 - fi
112 - if tc-ld-is-gold; then
113 - mycmakeargs+=( "-DUSE_GOLD=yes" )
114 - else
115 - mycmakeargs+=( "-DUSE_GOLD=no" )
116 - fi
117 -
118 - cmake_src_configure
119 -
120 - sed -i -e '/LogDir/s|/var/tmp|/var/log/'"${PN}"'|g' "${BUILD_DIR}"/conf/acng.conf || die
121 -}
122 -
123 -src_install() {
124 - pushd "${BUILD_DIR}" || die
125 - dosbin ${PN} acngtool
126 - dolib.so libsupacng.so
127 - if use fuse; then
128 - dobin acngfs
129 - fi
130 - popd || die
131 -
132 - newinitd "${FILESDIR}"/initd-r2 ${PN}
133 - newconfd "${FILESDIR}"/confd-r1 ${PN}
134 -
135 - insinto /etc/logrotate.d
136 - newins "${FILESDIR}"/logrotate ${PN}
137 -
138 - doman doc/man/${PN}*
139 - if use fuse; then
140 - doman doc/man/acngfs*
141 - fi
142 -
143 - # Documentation
144 - dodoc doc/README TODO VERSION INSTALL ChangeLog
145 - if use doc; then
146 - dodoc doc/*.pdf
147 -
148 - docinto html
149 - dodoc doc/html/*
150 -
151 - find conf -name '*.gz' -exec gzip -d {} \; || die
152 - docinto examples/conf
153 - dodoc conf/*
154 - fi
155 -
156 - newdoc "${WORKDIR}"/debian/changelog debian.changelog
157 -
158 - # perl daily cron script
159 - dosbin scripts/expire-caller.pl
160 - insinto /etc/cron.daily
161 - newins "${FILESDIR}"/cron.daily ${PN}
162 -
163 - # default configuration
164 - insinto /etc/${PN}
165 - newins "${BUILD_DIR}"/conf/acng.conf ${PN}.conf
166 - doins $( echo conf/* | sed 's|conf/acng.conf.in||g' )
167 -
168 - keepdir /var/log/${PN}
169 - # Some directories must exists
170 - keepdir /var/log/${PN}
171 - fowners -R ${PN}:${PN} \
172 - /etc/${PN} \
173 - /var/log/${PN}
174 -}
175
176 diff --git a/net-misc/apt-cacher-ng/apt-cacher-ng-3.5_p3.ebuild b/net-misc/apt-cacher-ng/apt-cacher-ng-3.5_p3.ebuild
177 new file mode 100644
178 index 00000000000..56294639238
179 --- /dev/null
180 +++ b/net-misc/apt-cacher-ng/apt-cacher-ng-3.5_p3.ebuild
181 @@ -0,0 +1,97 @@
182 +# Copyright 1999-2021 Gentoo Authors
183 +# Distributed under the terms of the GNU General Public License v2
184 +
185 +EAPI=7
186 +
187 +inherit cmake
188 +
189 +DESCRIPTION="Yet another caching HTTP proxy for Debian/Ubuntu software packages"
190 +HOMEPAGE="https://www.unix-ag.uni-kl.de/~bloch/acng/
191 + https://packages.qa.debian.org/a/apt-cacher-ng.html"
192 +SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${PV/_*}.orig.tar.xz
193 + mirror://debian/pool/main/a/${PN}/${PN}_${PV/_p/-}.debian.tar.xz"
194 +
195 +LICENSE="BSD-4 ZLIB public-domain"
196 +SLOT="0"
197 +KEYWORDS="~amd64 ~x86"
198 +IUSE="doc fuse tcpd"
199 +
200 +DEPEND="acct-user/apt-cacher-ng
201 + acct-group/apt-cacher-ng
202 + app-arch/bzip2
203 + dev-libs/libevent:=
204 + dev-libs/openssl:0=
205 + sys-libs/zlib
206 + fuse? ( sys-fs/fuse:0 )
207 + tcpd? ( sys-apps/tcp-wrappers )"
208 +BDEPEND="virtual/pkgconfig"
209 +RDEPEND="${DEPEND}
210 + dev-lang/perl"
211 +
212 +PATCHES=(
213 + "${FILESDIR}/${PN}-3.3.1-flags.patch"
214 + "${FILESDIR}/${PN}-3.5-perl-syntax.patch"
215 + "${WORKDIR}/debian/patches/debian-changes"
216 +)
217 +
218 +S="${WORKDIR}/${P/_*}"
219 +
220 +src_prepare() {
221 + # Fixup systemd/CMakeLists.txt cmake version requirement
222 + sed -ie "s/2.6/3.1/" systemd/CMakeLists.txt || die
223 +
224 + # Make sure we install everything the same way it used to be after
225 + # switching from mostly custom src_install to relying on build system
226 + # installation
227 + sed -e "/install/s/LIBDIR/CFGDIR/" \
228 + -e "/install.*acng\.conf/s/)$/ RENAME ${PN}.conf)/" \
229 + -e "/file/s/)$/ \"*hooks\" \"backends_debian\")/" -i conf/CMakeLists.txt || die
230 + sed -ie "/INSTALL.*acngtool/s/LIBDIR/CMAKE_INSTALL_SBINDIR/" source/CMakeLists.txt || die
231 + cmake_src_prepare
232 +}
233 +
234 +src_configure() {
235 + local mycmakeargs=(
236 + "-DHAVE_FUSE_25=$(usex fuse)"
237 + "-DHAVE_LIBWRAP=$(usex tcpd)"
238 + # Unconditionally install systemd service file
239 + "-DSDINSTALL=1"
240 + )
241 +
242 + if tc-ld-is-gold; then
243 + mycmakeargs+=( "-DUSE_GOLD=yes" )
244 + else
245 + mycmakeargs+=( "-DUSE_GOLD=no" )
246 + fi
247 +
248 + cmake_src_configure
249 +
250 + sed -ie '/LogDir/s|/var/tmp|/var/log/'"${PN}"'|g' "${BUILD_DIR}"/conf/acng.conf || die
251 +}
252 +
253 +src_install() {
254 + newinitd "${FILESDIR}/initd-r3" "${PN}"
255 + newconfd "${FILESDIR}/confd-r2" "${PN}"
256 +
257 + insinto /etc/logrotate.d
258 + newins "${FILESDIR}/logrotate" "${PN}"
259 +
260 + insinto /etc/cron.daily
261 + newins "${FILESDIR}/cron.daily" "${PN}"
262 +
263 + # USE=fuse installs acngfs, don't install manpage without the bin
264 + if use !fuse; then
265 + rm doc/man/acngfs.8 || die
266 + fi
267 +
268 + if use !doc; then
269 + rm -r doc/html || die
270 + fi
271 +
272 + dosbin scripts/expire-caller.pl
273 +
274 + keepdir "/var/log/${PN}"
275 + fowners -R ${PN}:${PN} "/var/log/${PN}"
276 +
277 + cmake_src_install
278 +}
279
280 diff --git a/net-misc/apt-cacher-ng/files/confd-r2 b/net-misc/apt-cacher-ng/files/confd-r2
281 new file mode 100644
282 index 00000000000..2e2f5c99dd4
283 --- /dev/null
284 +++ b/net-misc/apt-cacher-ng/files/confd-r2
285 @@ -0,0 +1,9 @@
286 +# Additional options that are passed to the Daemon.
287 +APT_CACHER_NG_ARGS="-c /etc/apt-cacher-ng"
288 +
289 +# Specify the network services that correspond to the "BindAddress"
290 +# setting in your apt-cacher-ng.conf. For example, if you bind to
291 +# 127.0.0.1, then this should be set to "net.lo" which provides the
292 +# loopback interface. The default BindAddress listens on all available
293 +# interfaces, for which it suffices to have only one (net.lo) up.
294 +rc_need="net.lo"
295
296 diff --git a/net-misc/apt-cacher-ng/files/initd-r3 b/net-misc/apt-cacher-ng/files/initd-r3
297 new file mode 100644
298 index 00000000000..665b0e46bca
299 --- /dev/null
300 +++ b/net-misc/apt-cacher-ng/files/initd-r3
301 @@ -0,0 +1,20 @@
302 +#!/sbin/openrc-run
303 +# Copyright 1999-2017 Gentoo Foundation
304 +# Distributed under the terms of the GNU General Public License v2
305 +
306 +CACHEDIR="/var/cache/${RC_SVCNAME}"
307 +SOCKETDIR="/run/apt-cacher-ng"
308 +SOCKETFILE="${SOCKETDIR}/${RC_SVCNAME}.socket"
309 +
310 +command="/usr/sbin/apt-cacher-ng"
311 +command_args="SocketPath=${SOCKETFILE} foreground=1 ${APT_CACHER_NG_ARGS}"
312 +command_background="true"
313 +command_user="apt-cacher-ng:apt-cacher-ng"
314 +pidfile="/run/${RC_SVCNAME}.pid"
315 +retry="15"
316 +
317 +start_pre() {
318 + for d in "${SOCKETDIR}" "${CACHEDIR}"; do
319 + checkpath --directory --mode 0755 --owner "${command_user}" "${d}"
320 + done
321 +}