1 |
commit: 2674b83c7df9e125e8327ad42107eeb1d2114541 |
2 |
Author: Craig Andrews <candrews <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 28 17:59:45 2022 +0000 |
4 |
Commit: Craig Andrews <candrews <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 28 18:37:22 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2674b83c |
7 |
|
8 |
mail-filter/dcc: add 2.3.168 |
9 |
|
10 |
Add myself as a maintainer |
11 |
EAPI=8 |
12 |
Add systemd service for dccifd |
13 |
Use /var/dcc to /var/lib/dcc |
14 |
|
15 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=688500 |
16 |
|
17 |
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org> |
18 |
Closes: https://github.com/gentoo/gentoo/pull/28464 |
19 |
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org> |
20 |
|
21 |
mail-filter/dcc/Manifest | 1 + |
22 |
mail-filter/dcc/dcc-2.3.168.ebuild | 141 +++++++++++++++++++++++++++++++++++ |
23 |
mail-filter/dcc/files/dccifd.service | 34 +++++++++ |
24 |
mail-filter/dcc/metadata.xml | 4 + |
25 |
4 files changed, 180 insertions(+) |
26 |
|
27 |
diff --git a/mail-filter/dcc/Manifest b/mail-filter/dcc/Manifest |
28 |
index 7eb162306044..d4661daeb0b1 100644 |
29 |
--- a/mail-filter/dcc/Manifest |
30 |
+++ b/mail-filter/dcc/Manifest |
31 |
@@ -1 +1,2 @@ |
32 |
DIST dcc-1.3.158.tar.Z 1714175 BLAKE2B 19e11e9e78268e76bf97f16ad6f03f0bb114ec9fbc9b1f8bb6ca7ce72fa419b1e50a6d35ee32ed5352b13da96002d313c00a07395317d33082eb69c9ae60008e SHA512 24fba5ea713e8df1468644508c323d64b3868685716b7cc02263933476940a807cfc4593432a9195371308c83d4ea93653e89634681d95dcb32f5d65c7274599 |
33 |
+DIST dcc-2.3.168.tar.Z 1608203 BLAKE2B d0dac4ee233fede16b4904524126cff4f127e59177d11624acf850861b9f267718efab974edafbd4521bcf78a2c3d626876c23c0af3cc108cd131c197dbc9945 SHA512 52a9671ba355a2d3e82246c3b5cf3875148d48bd314371d9e608643a59922becdf024b880e4bd37f6e36aa50830110600960ffa7a3ddd69ed7239bfc0578f141 |
34 |
|
35 |
diff --git a/mail-filter/dcc/dcc-2.3.168.ebuild b/mail-filter/dcc/dcc-2.3.168.ebuild |
36 |
new file mode 100644 |
37 |
index 000000000000..0ac9be7299a7 |
38 |
--- /dev/null |
39 |
+++ b/mail-filter/dcc/dcc-2.3.168.ebuild |
40 |
@@ -0,0 +1,141 @@ |
41 |
+# Copyright 1999-2022 Gentoo Authors |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+ |
44 |
+EAPI=8 |
45 |
+ |
46 |
+inherit systemd toolchain-funcs |
47 |
+ |
48 |
+DESCRIPTION="Distributed Checksum Clearinghouse" |
49 |
+HOMEPAGE="https://www.rhyolite.com/dcc/" |
50 |
+SRC_URI="https://www.rhyolite.com/dcc/source/old/${P}.tar.Z" |
51 |
+ |
52 |
+LICENSE="DCC GPL-2" |
53 |
+SLOT="0" |
54 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
55 |
+IUSE="cgi ipv6 rrdtool milter" |
56 |
+ |
57 |
+RDEPEND=" |
58 |
+ dev-lang/perl |
59 |
+ || ( |
60 |
+ net-ftp/ftp |
61 |
+ net-misc/curl |
62 |
+ net-misc/wget |
63 |
+ www-client/fetch |
64 |
+ ) |
65 |
+ milter? ( mail-filter/libmilter:= ) |
66 |
+ rrdtool? ( net-analyzer/rrdtool )" |
67 |
+DEPEND="${RDEPEND}" |
68 |
+ |
69 |
+dcc_cgibin=var/www/localhost/cgi-bin/dcc |
70 |
+dcc_homedir=var/lib/dcc |
71 |
+dcc_libexec=usr/sbin |
72 |
+dcc_man=usr/share/man |
73 |
+dcc_rundir=var/run/dcc |
74 |
+ |
75 |
+PATCHES=( |
76 |
+ "${FILESDIR}"/${PN}-1.3.158-clang16.patch |
77 |
+ "${FILESDIR}"/${PN}-1.3.158-c2x.patch |
78 |
+) |
79 |
+ |
80 |
+src_configure() { |
81 |
+ tc-export CC AR RANLIB |
82 |
+ local myconf=( |
83 |
+ --bindir="${EPREFIX}"/usr/bin |
84 |
+ --homedir="${EPREFIX}"/${dcc_homedir} |
85 |
+ --libexecdir="${EPREFIX}"/${dcc_libexec} |
86 |
+ --mandir="${EPREFIX}"/usr/share/man |
87 |
+ --enable-dccifd |
88 |
+ --enable-server |
89 |
+ --with-DDC-MD5 |
90 |
+ --with-installroot="${D}" |
91 |
+ --with-rundir="${EPREFIX}"/${dcc_rundir} |
92 |
+ --with-uid=root |
93 |
+ --with-updatedcc_pfile="${EPREFIX}"/${dcc_homedir}/updatecc.pfile |
94 |
+ --with-db-memory=64 |
95 |
+ --with-max-db-mem=128 |
96 |
+ --with-max-log-size=0 |
97 |
+ --with-make-cmd=${MAKE:-make} |
98 |
+ $(use_enable ipv6 IPv6) |
99 |
+ $(use_enable milter dccm) |
100 |
+ $(use_with cgi cgibin ${dcc_cgibin}) |
101 |
+ $(use_with milter sendmail) |
102 |
+ ) |
103 |
+ |
104 |
+ einfo "Using config: ${myconf[@]}" |
105 |
+ |
106 |
+ # This is NOT a normal configure script. |
107 |
+ ./configure "${myconf[@]}" || die "configure failed!" |
108 |
+} |
109 |
+ |
110 |
+moveconf() { |
111 |
+ local i |
112 |
+ for i in $@; do |
113 |
+ mv "${ED}/${dcc_homedir}/${i}" "${ED}"/etc/dcc || die |
114 |
+ dosym ../../../etc/dcc/"${i}" "${dcc_homedir}/${i}" |
115 |
+ done |
116 |
+} |
117 |
+ |
118 |
+src_install() { |
119 |
+ # stolen from the RPM .spec and modified for gentoo |
120 |
+ export MANOWN=root |
121 |
+ export MANGRP=$(id -g -n root) |
122 |
+ export BINOWN="${MANOWN}" |
123 |
+ export BINGRP="${MANGRP}" |
124 |
+ export DCC_PROTO_HOMEDIR="${ED}/${dcc_homedir}" |
125 |
+ export DCC_CGIBINDIR="${ED}/${dcc_cgibin}" |
126 |
+ export DCC_SUID="${BINOWN}" |
127 |
+ export DCC_OWN="${BINOWN}" |
128 |
+ export DCC_GRP="${BINGRP}" |
129 |
+ |
130 |
+ dodir /etc/cron.daily "${dcc_homedir}" /usr/bin /usr/sbin /usr/share/man/man{0,8} /etc/dcc |
131 |
+ if use cgi ; then |
132 |
+ dodir "${dcc_cgibin}" |
133 |
+ fi |
134 |
+ keepdir /var/log/dcc |
135 |
+ |
136 |
+ emake install |
137 |
+ |
138 |
+ # branding and setting reasonable defaults |
139 |
+ sed -e "s/BRAND=\$/BRAND='Gentoo ${PF}'/;" \ |
140 |
+ -e "s/GREY_ENABLE=\$/GREY_ENABLE=off/;" \ |
141 |
+ -e "s/DCCM_LOG_AT=5\$/DCCM_LOG_AT=50/;" \ |
142 |
+ -e "s,DCCM_LOGDIR=\"log\"\$,DCCM_LOGDIR=\"/var/log/dcc\",;" \ |
143 |
+ -e "s/DCCM_ARGS=\$/DCCM_ARGS='-SHELO -Smail_host -SSender -SList-ID'/;" \ |
144 |
+ -e "s/DCCIFD_ARGS=\$/DCCIFD_ARGS=\"\$DCCM_ARGS\"/;" \ |
145 |
+ -e 's/DCCIFD_ENABLE=off/DCCIFD_ENABLE=on/' \ |
146 |
+ -e 's/DBCLEAN_LOGDAYS=14/DBCLEAN_LOGDAYS=1/' \ |
147 |
+ -i "${ED}/${dcc_homedir}/dcc_conf" || die |
148 |
+ |
149 |
+ if use milter ; then |
150 |
+ # enable milter |
151 |
+ sed -i -e "s:^[\t #]*\(DCCM_ENABLE[\t ]*=[\t ]*\).*:\1on:g" \ |
152 |
+ "${ED}/${dcc_homedir}"/dcc_conf || die |
153 |
+ fi |
154 |
+ |
155 |
+ # provide cronjob |
156 |
+ mv "${ED}"/usr/sbin/cron-dccd "${ED}"/etc/cron.daily/dccd || die "mv failed" |
157 |
+ |
158 |
+ # clean up |
159 |
+ mv "${ED}"/usr/sbin/logger "${ED}"/usr/sbin/logger-dcc || die "mv failed" |
160 |
+ |
161 |
+ if ! use rrdtool; then |
162 |
+ # remove rrdtool interface scripts |
163 |
+ rm "${ED}"/usr/sbin/dcc-stats-{collect,graph,init} || die "Failed to clean up rrdtool scripts" |
164 |
+ fi |
165 |
+ |
166 |
+ # clean up |
167 |
+ rm "${ED}"/usr/sbin/{rcDCC,updatedcc} || die |
168 |
+ |
169 |
+ # place configuration files into /etc instead of /var/dcc |
170 |
+ moveconf dcc_conf flod grey_flod grey_whitelist ids map map.txt whiteclnt whitecommon whitelist |
171 |
+ |
172 |
+ newinitd "${FILESDIR}"/dcc.initd-1.3.154 dcc |
173 |
+ newconfd "${FILESDIR}"/dcc.confd dcc |
174 |
+ |
175 |
+ rmdir "${ED}"/"${dcc_homedir}"/log || die |
176 |
+ |
177 |
+ dodoc CHANGES |
178 |
+ doman *.{0,8} |
179 |
+ |
180 |
+ systemd_dounit "${FILESDIR}/dccifd.service" |
181 |
+} |
182 |
|
183 |
diff --git a/mail-filter/dcc/files/dccifd.service b/mail-filter/dcc/files/dccifd.service |
184 |
new file mode 100644 |
185 |
index 000000000000..4055a752f933 |
186 |
--- /dev/null |
187 |
+++ b/mail-filter/dcc/files/dccifd.service |
188 |
@@ -0,0 +1,34 @@ |
189 |
+[Unit] |
190 |
+Description=DCC (Distributed Checksum Clearinghouses) interface daemon |
191 |
+ |
192 |
+[Service] |
193 |
+Type=forking |
194 |
+PermissionsStartOnly=true |
195 |
+RuntimeDirectory=dcc |
196 |
+ConfigurationDirectory=dcc |
197 |
+LogsDirectory=dcc |
198 |
+StateDirectory=dcc |
199 |
+ExecStart=/usr/sbin/dccifd |
200 |
+ |
201 |
+#DCC writes pid file with "-" at the beginning which confuses systemd |
202 |
+#PIDFile=/run/dcc/dccifd.pid |
203 |
+ |
204 |
+# Hardening |
205 |
+ProtectSystem=strict |
206 |
+PrivateDevices=true |
207 |
+ProtectKernelModules=true |
208 |
+ProtectKernelLogs=true |
209 |
+RestrictRealtime=true |
210 |
+ProtectKernelTunables=true |
211 |
+ProtectControlGroups=true |
212 |
+ProtectHome=true |
213 |
+ProtectHostname=true |
214 |
+ProtectClock=true |
215 |
+PrivateTmp=true |
216 |
+SystemCallArchitectures=native |
217 |
+MemoryDenyWriteExecute=true |
218 |
+NoNewPrivileges=true |
219 |
+ |
220 |
+[Install] |
221 |
+WantedBy=multi-user.target |
222 |
+ |
223 |
|
224 |
diff --git a/mail-filter/dcc/metadata.xml b/mail-filter/dcc/metadata.xml |
225 |
index 95bdf6ac5792..d694695270e8 100644 |
226 |
--- a/mail-filter/dcc/metadata.xml |
227 |
+++ b/mail-filter/dcc/metadata.xml |
228 |
@@ -4,6 +4,10 @@ |
229 |
<maintainer type="person"> |
230 |
<email>robbat2@g.o</email> |
231 |
</maintainer> |
232 |
+<maintainer type="person"> |
233 |
+ <email>candrews@g.o</email> |
234 |
+ <name>Craig Andrews</name> |
235 |
+</maintainer> |
236 |
<use> |
237 |
<flag name="rrdtool">Enable <pkg>net-analyzer/rrdtool</pkg> interface |
238 |
scripts</flag> |