Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/dcc/
Date: Thu, 04 Aug 2022 01:45:52
Message-Id: 1659575112.76bc88470120dd04f6a0f45d5e19c9ef8ec5de82.sam@gentoo
1 commit: 76bc88470120dd04f6a0f45d5e19c9ef8ec5de82
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 4 01:01:50 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 4 01:05:12 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76bc8847
7
8 mail-filter/dcc: depend on libmilter
9
10 libmilter and sendmail no longer block each other, and we also need a := dep on
11 libmilter.
12
13 (Straight-to-stable is intentional as long been in stable anyway, but not dropping
14 old w/ git mv or similar yet in case folks want to downgrade to older sendmail for
15 now.)
16
17 Signed-off-by: Sam James <sam <AT> gentoo.org>
18
19 mail-filter/dcc/dcc-1.3.158-r2.ebuild | 139 ++++++++++++++++++++++++++++++++++
20 1 file changed, 139 insertions(+)
21
22 diff --git a/mail-filter/dcc/dcc-1.3.158-r2.ebuild b/mail-filter/dcc/dcc-1.3.158-r2.ebuild
23 new file mode 100644
24 index 000000000000..7a01e900a63e
25 --- /dev/null
26 +++ b/mail-filter/dcc/dcc-1.3.158-r2.ebuild
27 @@ -0,0 +1,139 @@
28 +# Copyright 1999-2022 Gentoo Authors
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +EAPI=7
32 +
33 +inherit flag-o-matic toolchain-funcs
34 +
35 +DESCRIPTION="Distributed Checksum Clearinghouse"
36 +HOMEPAGE="https://www.rhyolite.com/dcc/"
37 +SRC_URI="https://www.rhyolite.com/dcc/source/old/${P}.tar.Z"
38 +
39 +LICENSE="DCC GPL-2"
40 +SLOT="0"
41 +KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ppc ppc64 sparc x86"
42 +IUSE="cgi ipv6 rrdtool milter"
43 +
44 +RDEPEND="
45 + dev-lang/perl
46 + || (
47 + net-ftp/ftp
48 + net-misc/curl
49 + net-misc/wget
50 + www-client/fetch
51 + )
52 + milter? ( mail-filter/libmilter:= )
53 + rrdtool? ( net-analyzer/rrdtool )"
54 +DEPEND="${RDEPEND}"
55 +
56 +dcc_cgibin=var/www/localhost/cgi-bin/dcc
57 +dcc_homedir=var/dcc
58 +dcc_libexec=usr/sbin
59 +dcc_man=usr/share/man
60 +dcc_rundir=var/run/dcc
61 +
62 +PATCHES=(
63 + "${FILESDIR}"/${PN}-1.3.140-freebsd.patch
64 + "${FILESDIR}"/${P}-fno-common.patch
65 +)
66 +
67 +src_configure() {
68 + tc-export CC AR RANLIB
69 + local myconf=(
70 + --bindir="${EPREFIX}"/usr/bin
71 + --homedir="${EPREFIX}"/${dcc_homedir}
72 + --libexecdir="${EPREFIX}"/${dcc_libexec}
73 + --mandir="${EPREFIX}"/usr/share/man
74 + --enable-dccifd
75 + --enable-server
76 + --with-DDC-MD5
77 + --with-installroot="${D}"
78 + --with-rundir="${EPREFIX}"/${dcc_rundir}
79 + --with-uid=root
80 + --with-updatedcc_pfile="${EPREFIX}"/${dcc_homedir}/updatecc.pfile
81 + --with-db-memory=64
82 + --with-max-db-mem=128
83 + --with-max-log-size=0
84 + --with-make-cmd=${MAKE:-make}
85 + $(use_enable ipv6 IPv6)
86 + $(use_enable milter dccm)
87 + $(use_with cgi cgibin ${dcc_cgibin})
88 + $(use_with milter sendmail)
89 + )
90 +
91 + einfo "Using config: ${myconf[@]}"
92 +
93 + # This is NOT a normal configure script.
94 + ./configure "${myconf[@]}" || die "configure failed!"
95 +}
96 +
97 +moveconf() {
98 + local i
99 + for i in $@; do
100 + mv "${ED}/${dcc_homedir}/${i}" "${ED}"/etc/dcc || die
101 + dosym ../../etc/dcc/"${i}" "${dcc_homedir}/${i}"
102 + done
103 +}
104 +
105 +src_install() {
106 + # stolen from the RPM .spec and modified for gentoo
107 + export MANOWN=root
108 + export MANGRP=$(id -g -n root)
109 + export BINOWN="${MANOWN}"
110 + export BINGRP="${MANGRP}"
111 + export DCC_PROTO_HOMEDIR="${ED}/${dcc_homedir}"
112 + export DCC_CGIBINDIR="${ED}/${dcc_cgibin}"
113 + export DCC_SUID="${BINOWN}"
114 + export DCC_OWN="${BINOWN}"
115 + export DCC_GRP="${BINGRP}"
116 +
117 + dodir /etc/cron.daily "${dcc_homedir}" /usr/bin /usr/sbin /usr/share/man/man{0,8} /etc/dcc
118 + if use cgi ; then
119 + dodir "${dcc_cgibin}"
120 + fi
121 + keepdir /var/log/dcc
122 +
123 + emake install
124 +
125 + # branding and setting reasonable defaults
126 + sed -e "s/BRAND=\$/BRAND='Gentoo ${PF}'/;" \
127 + -e "s/GREY_ENABLE=\$/GREY_ENABLE=off/;" \
128 + -e "s/DCCM_LOG_AT=5\$/DCCM_LOG_AT=50/;" \
129 + -e "s,DCCM_LOGDIR=\"log\"\$,DCCM_LOGDIR=\"/var/log/dcc\",;" \
130 + -e "s/DCCM_ARGS=\$/DCCM_ARGS='-SHELO -Smail_host -SSender -SList-ID'/;" \
131 + -e "s/DCCIFD_ARGS=\$/DCCIFD_ARGS=\"\$DCCM_ARGS\"/;" \
132 + -e 's/DCCIFD_ENABLE=off/DCCIFD_ENABLE=on/' \
133 + -e 's/DBCLEAN_LOGDAYS=14/DBCLEAN_LOGDAYS=1/' \
134 + -i "${ED}/${dcc_homedir}/dcc_conf" || die
135 +
136 + if use milter ; then
137 + # enable milter
138 + sed -i -e "s:^[\t #]*\(DCCM_ENABLE[\t ]*=[\t ]*\).*:\1on:g" \
139 + "${ED}/${dcc_homedir}"/dcc_conf || die
140 + fi
141 +
142 + # provide cronjob
143 + mv "${ED}"/usr/sbin/cron-dccd "${ED}"/etc/cron.daily/dccd || die "mv failed"
144 +
145 + # clean up
146 + mv "${ED}"/usr/sbin/logger "${ED}"/usr/sbin/logger-dcc || die "mv failed"
147 +
148 + if ! use rrdtool; then
149 + # remove rrdtool interface scripts
150 + rm "${ED}"/usr/sbin/dcc-stats-{collect,graph,init} || die "Failed to clean up rrdtool scripts"
151 + fi
152 +
153 + # clean up
154 + rm "${ED}"/usr/sbin/{rcDCC,updatedcc} || die
155 +
156 + # place configuration files into /etc instead of /var/dcc
157 + moveconf dcc_conf flod grey_flod grey_whitelist ids map map.txt whiteclnt whitecommon whitelist
158 +
159 + newinitd "${FILESDIR}"/dcc.initd-1.3.154 dcc
160 + newconfd "${FILESDIR}"/dcc.confd dcc
161 +
162 + rmdir "${ED}"/var/dcc/log/ || die
163 +
164 + dodoc CHANGES RESTRICTIONS
165 + doman *.{0,8}
166 +}