Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@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: Fri, 15 Nov 2019 11:29:17
Message-Id: 1573817351.bd9f55582889b29951a062daa13064b08765ebb5.jer@gentoo
1 commit: bd9f55582889b29951a062daa13064b08765ebb5
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 15 11:28:48 2019 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 15 11:29:11 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd9f5558
7
8 net-misc/apt-cacher-ng: Create default LogDir
9
10 Package-Manager: Portage-2.3.79, Repoman-2.3.18
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 .../apt-cacher-ng/apt-cacher-ng-3.3_p1-r1.ebuild | 131 +++++++++++++++++++++
14 net-misc/apt-cacher-ng/files/confd-r1 | 3 +
15 net-misc/apt-cacher-ng/files/initd-r2 | 34 ++++++
16 3 files changed, 168 insertions(+)
17
18 diff --git a/net-misc/apt-cacher-ng/apt-cacher-ng-3.3_p1-r1.ebuild b/net-misc/apt-cacher-ng/apt-cacher-ng-3.3_p1-r1.ebuild
19 new file mode 100644
20 index 00000000000..682a66fd9f0
21 --- /dev/null
22 +++ b/net-misc/apt-cacher-ng/apt-cacher-ng-3.3_p1-r1.ebuild
23 @@ -0,0 +1,131 @@
24 +# Copyright 1999-2019 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +inherit cmake-utils toolchain-funcs user
29 +
30 +DESCRIPTION="Yet another caching HTTP proxy for Debian/Ubuntu software packages"
31 +HOMEPAGE="
32 + https://www.unix-ag.uni-kl.de/~bloch/acng/
33 + https://packages.qa.debian.org/a/apt-cacher-ng.html
34 +"
35 +LICENSE="BSD-4 ZLIB public-domain"
36 +SLOT="0"
37 +SRC_URI="
38 + mirror://debian/pool/main/a/${PN}/${PN}_${PV/_*}.orig.tar.xz
39 + mirror://debian/pool/main/a/${PN}/${PN}_${PV/_p/-}.debian.tar.xz
40 +"
41 +
42 +KEYWORDS="~amd64 ~x86"
43 +IUSE="doc fuse systemd tcpd"
44 +
45 +COMMON_DEPEND="
46 + app-arch/bzip2
47 + app-arch/xz-utils
48 + dev-libs/openssl:0=
49 + sys-libs/zlib
50 + systemd? (
51 + sys-apps/systemd
52 + )
53 +"
54 +BDEPEND="
55 + ${COMMON_DEPEND}
56 + dev-util/cmake
57 + >sys-devel/gcc-4.8
58 + virtual/pkgconfig
59 +"
60 +RDEPEND="
61 + ${COMMON_DEPEND}
62 + dev-lang/perl
63 + fuse? ( sys-fs/fuse )
64 + tcpd? ( sys-apps/tcp-wrappers )
65 +"
66 +PATCHES=(
67 + "${FILESDIR}"/${PN}-3.3-flags.patch
68 +)
69 +S=${WORKDIR}/${P/_*}
70 +
71 +pkg_pretend() {
72 + if [[ $(gcc-major-version) -lt 4 ]]; then
73 + die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)"
74 + elif [[ $(gcc-major-version) = 4 ]] && [[ $(gcc-minor-version) -lt 8 ]]; then
75 + die "GCC 4.8 or greater is required but you have $(gcc-major-version).$(gcc-minor-version)"
76 + fi
77 +}
78 +
79 +pkg_setup() {
80 + # add new user & group for daemon
81 + enewgroup ${PN}
82 + enewuser ${PN} -1 -1 -1 ${PN}
83 +}
84 +
85 +src_configure(){
86 + mycmakeargs=(
87 + "-DCMAKE_INSTALL_PREFIX=/usr"
88 + )
89 + if use fuse; then
90 + mycmakeargs+=( "-DHAVE_FUSE_25=yes" )
91 + else
92 + mycmakeargs+=( "-DHAVE_FUSE_25=no" )
93 + fi
94 + if use tcpd; then
95 + mycmakeargs+=( "-DHAVE_LIBWRAP=yes" )
96 + else
97 + mycmakeargs+=( "-DHAVE_LIBWRAP=no" )
98 + fi
99 +
100 + cmake-utils_src_configure
101 +
102 + sed -i -e '/LogDir/s|/var/tmp|/var/log/'"${PN}"'|g' "${BUILD_DIR}"/conf/acng.conf || die
103 +}
104 +
105 +src_install() {
106 + pushd "${BUILD_DIR}" || die
107 + dosbin ${PN} acngtool
108 + dolib.so libsupacng.so
109 + if use fuse; then
110 + dobin acngfs
111 + fi
112 + popd || die
113 +
114 + newinitd "${FILESDIR}"/initd-r2 ${PN}
115 + newconfd "${FILESDIR}"/confd-r1 ${PN}
116 +
117 + insinto /etc/logrotate.d
118 + newins "${FILESDIR}"/logrotate ${PN}
119 +
120 + doman doc/man/${PN}*
121 + if use fuse; then
122 + doman doc/man/acngfs*
123 + fi
124 +
125 + # Documentation
126 + dodoc doc/README TODO VERSION INSTALL ChangeLog
127 + if use doc; then
128 + dodoc doc/*.pdf
129 +
130 + docinto html
131 + dodoc doc/html/*
132 +
133 + find conf -name '*.gz' -exec gzip -d {} \; || die
134 + docinto examples/conf
135 + dodoc conf/*
136 + fi
137 +
138 + # perl daily cron script
139 + dosbin scripts/expire-caller.pl
140 + exeinto /etc/cron.daily
141 + newexe "${FILESDIR}"/cron.daily ${PN}
142 +
143 + # default configuration
144 + insinto /etc/${PN}
145 + newins "${BUILD_DIR}"/conf/acng.conf ${PN}.conf
146 + doins $( echo conf/* | sed 's|conf/acng.conf.in||g' )
147 +
148 + keepdir /var/log/${PN}
149 + # Some directories must exists
150 + keepdir /var/log/${PN}
151 + fowners -R ${PN}:${PN} \
152 + /etc/${PN} \
153 + /var/log/${PN}
154 +}
155
156 diff --git a/net-misc/apt-cacher-ng/files/confd-r1 b/net-misc/apt-cacher-ng/files/confd-r1
157 new file mode 100644
158 index 00000000000..84b659bc488
159 --- /dev/null
160 +++ b/net-misc/apt-cacher-ng/files/confd-r1
161 @@ -0,0 +1,3 @@
162 +# Additional options that are passed to the Daemon.
163 +DAEMON_OPTS=" -c /etc/apt-cacher-ng "
164 +LOGDIR=""
165
166 diff --git a/net-misc/apt-cacher-ng/files/initd-r2 b/net-misc/apt-cacher-ng/files/initd-r2
167 new file mode 100644
168 index 00000000000..ae9ab7258cc
169 --- /dev/null
170 +++ b/net-misc/apt-cacher-ng/files/initd-r2
171 @@ -0,0 +1,34 @@
172 +#!/sbin/openrc-run
173 +# Copyright 1999-2019 Gentoo Authors
174 +# Distributed under the terms of the GNU General Public License v2
175 +
176 +CACHEDIR="var/cache/${RC_SVCNAME}"
177 +DAEMON="/usr/sbin/${RC_SVCNAME}"
178 +RUNDIR="/var/run/${RC_SVCNAME}"
179 +PIDFILE="${RUNDIR}/${RC_SVCNAME}.pid"
180 +SOCKETFILE="${RUNDIR}/${RC_SVCNAME}.socket"
181 +DAEMON_OPTS="${DAEMON_OPTS} pidfile=${PIDFILE} SocketPath=${SOCKETFILE} foreground=0"
182 +
183 +depend() {
184 + use net
185 +}
186 +
187 +start() {
188 + ebegin "Starting ${RC_SVCNAME}"
189 + checkpath -d -m 0755 -o ${RC_SVCNAME}:${RC_SVCNAME} "${RUNDIR}"
190 + checkpath -d -m 0755 -o ${RC_SVCNAME}:${RC_SVCNAME} "${CACHEDIR}"
191 + [ -z "${LOGDIR}" ] && checkpath -d -m 0755 -o ${RC_SVCNAME}:${RC_SVCNAME} "/var/log/${RC_SVCNAME}"
192 + start-stop-daemon --start --exec ${DAEMON} \
193 + --user ${RC_SVCNAME} --group ${RC_SVCNAME} \
194 + --pidfile ${PIDFILE} \
195 + -- ${DAEMON_OPTS}
196 + eend $?
197 +}
198 +
199 +stop() {
200 + ebegin "Stopping ${RC_SVCNAME}"
201 + start-stop-daemon --stop --retry 15 --exec ${DAEMON} \
202 + --pidfile ${PIDFILE}
203 + rm -f ${PIDFILE}
204 + eend $?
205 +}