diff options
author | Jakov Smolic <jakov.smolic@sartura.hr> | 2021-01-12 13:03:59 +0100 |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2021-01-12 13:03:59 +0100 |
commit | 49241f1373444258fd5ad16b4f00c5b1510c19ac (patch) | |
tree | f1436b6d1ab05513848a25234ae49749ebd3b7e6 /mail-filter/dcc | |
parent | dev-python/wsaccel: Stabilize 0.6.3 arm64, #764569 (diff) | |
download | gentoo-49241f1373444258fd5ad16b4f00c5b1510c19ac.tar.gz gentoo-49241f1373444258fd5ad16b4f00c5b1510c19ac.tar.bz2 gentoo-49241f1373444258fd5ad16b4f00c5b1510c19ac.zip |
mail-filter/dcc: Port to EAPI 7
Closes: https://bugs.gentoo.org/706988
Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'mail-filter/dcc')
-rw-r--r-- | mail-filter/dcc/dcc-1.3.158-r1.ebuild | 144 | ||||
-rw-r--r-- | mail-filter/dcc/files/dcc-1.3.140-freebsd.patch | 2 | ||||
-rw-r--r-- | mail-filter/dcc/files/dcc-1.3.158-fno-common.patch | 23 |
3 files changed, 167 insertions, 2 deletions
diff --git a/mail-filter/dcc/dcc-1.3.158-r1.ebuild b/mail-filter/dcc/dcc-1.3.158-r1.ebuild new file mode 100644 index 000000000000..be9cf2452f69 --- /dev/null +++ b/mail-filter/dcc/dcc-1.3.158-r1.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="Distributed Checksum Clearinghouse" +HOMEPAGE="https://www.rhyolite.com/dcc/" +SRC_URI="https://www.rhyolite.com/dcc/source/old/${P}.tar.Z" + +LICENSE="DCC GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" # +IUSE="cgi ipv6 rrdtool milter" + +RDEPEND=" + dev-lang/perl + || ( + net-ftp/ftp + net-misc/curl + net-misc/wget + www-client/fetch + ) + milter? ( + || ( + mail-filter/libmilter + mail-mta/sendmail + ) + ) + rrdtool? ( net-analyzer/rrdtool )" +DEPEND="${RDEPEND}" + +dcc_cgibin=var/www/localhost/cgi-bin/dcc +dcc_homedir=var/dcc +dcc_libexec=usr/sbin +dcc_man=usr/share/man +dcc_rundir=var/run/dcc + +PATCHES=( + "${FILESDIR}"/${PN}-1.3.140-freebsd.patch + "${FILESDIR}"/${P}-fno-common.patch +) + +src_configure() { + tc-export CC AR RANLIB + local myconf=( + --bindir="${EPREFIX}"/usr/bin + --homedir="${EPREFIX}"/${dcc_homedir} + --libexecdir="${EPREFIX}"/${dcc_libexec} + --mandir="${EPREFIX}"/usr/share/man + --enable-dccifd + --enable-server + --with-DDC-MD5 + --with-installroot="${D}" + --with-rundir="${EPREFIX}"/${dcc_rundir} + --with-uid=root + --with-updatedcc_pfile="${EPREFIX}"/${dcc_homedir}/updatecc.pfile + --with-db-memory=64 + --with-max-db-mem=128 + --with-max-log-size=0 + --with-make-cmd=${MAKE:-make} + $(use_enable ipv6 IPv6) + $(use_enable milter dccm) + $(use_with cgi cgibin ${dcc_cgibin}) + $(use_with milter sendmail) + ) + + einfo "Using config: ${myconf[@]}" + + # This is NOT a normal configure script. + ./configure "${myconf[@]}" || die "configure failed!" +} + +moveconf() { + local i + for i in $@; do + mv "${ED}/${dcc_homedir}/${i}" "${ED}"/etc/dcc || die + dosym ../../etc/dcc/"${i}" "${dcc_homedir}/${i}" + done +} + +src_install() { + # stolen from the RPM .spec and modified for gentoo + export MANOWN=root + export MANGRP=$(id -g -n root) + export BINOWN="${MANOWN}" + export BINGRP="${MANGRP}" + export DCC_PROTO_HOMEDIR="${ED}/${dcc_homedir}" + export DCC_CGIBINDIR="${ED}/${dcc_cgibin}" + export DCC_SUID="${BINOWN}" + export DCC_OWN="${BINOWN}" + export DCC_GRP="${BINGRP}" + + dodir /etc/cron.daily "${dcc_homedir}" /usr/bin /usr/sbin /usr/share/man/man{0,8} /etc/dcc + if use cgi ; then + dodir "${dcc_cgibin}" + fi + keepdir /var/log/dcc + + emake install + + # branding and setting reasonable defaults + sed -e "s/BRAND=\$/BRAND='Gentoo ${PF}'/;" \ + -e "s/GREY_ENABLE=\$/GREY_ENABLE=off/;" \ + -e "s/DCCM_LOG_AT=5\$/DCCM_LOG_AT=50/;" \ + -e "s,DCCM_LOGDIR=\"log\"\$,DCCM_LOGDIR=\"/var/log/dcc\",;" \ + -e "s/DCCM_ARGS=\$/DCCM_ARGS='-SHELO -Smail_host -SSender -SList-ID'/;" \ + -e "s/DCCIFD_ARGS=\$/DCCIFD_ARGS=\"\$DCCM_ARGS\"/;" \ + -e 's/DCCIFD_ENABLE=off/DCCIFD_ENABLE=on/' \ + -e 's/DBCLEAN_LOGDAYS=14/DBCLEAN_LOGDAYS=1/' \ + -i "${ED}/${dcc_homedir}/dcc_conf" || die + + if use milter ; then + # enable milter + sed -i -e "s:^[\t #]*\(DCCM_ENABLE[\t ]*=[\t ]*\).*:\1on:g" \ + "${ED}/${dcc_homedir}"/dcc_conf || die + fi + + # provide cronjob + mv "${ED}"/usr/sbin/cron-dccd "${ED}"/etc/cron.daily/dccd || die "mv failed" + + # clean up + mv "${ED}"/usr/sbin/logger "${ED}"/usr/sbin/logger-dcc || die "mv failed" + + if ! use rrdtool; then + # remove rrdtool interface scripts + rm "${ED}"/usr/sbin/dcc-stats-{collect,graph,init} || die "Failed to clean up rrdtool scripts" + fi + + # clean up + rm "${ED}"/usr/sbin/{rcDCC,updatedcc} || die + + # place configuration files into /etc instead of /var/dcc + moveconf dcc_conf flod grey_flod grey_whitelist ids map map.txt whiteclnt whitecommon whitelist + + newinitd "${FILESDIR}"/dcc.initd-1.3.154 dcc + newconfd "${FILESDIR}"/dcc.confd dcc + + rmdir "${ED}"/var/dcc/log/ || die + + dodoc CHANGES RESTRICTIONS + doman *.{0,8} +} diff --git a/mail-filter/dcc/files/dcc-1.3.140-freebsd.patch b/mail-filter/dcc/files/dcc-1.3.140-freebsd.patch index e72224f41c2f..8d4a8d59c334 100644 --- a/mail-filter/dcc/files/dcc-1.3.140-freebsd.patch +++ b/mail-filter/dcc/files/dcc-1.3.140-freebsd.patch @@ -1,5 +1,3 @@ -diff --git a/configure b/configure -index 5efe49d..de8d6f2 100755 --- a/configure +++ b/configure @@ -3677,7 +3677,7 @@ case "$TARGET_SYS" in diff --git a/mail-filter/dcc/files/dcc-1.3.158-fno-common.patch b/mail-filter/dcc/files/dcc-1.3.158-fno-common.patch new file mode 100644 index 000000000000..0ff4cb599a17 --- /dev/null +++ b/mail-filter/dcc/files/dcc-1.3.158-fno-common.patch @@ -0,0 +1,23 @@ +https://bugs.gentoo.org/706988 +--- a/srvrlib/db.c ++++ b/srvrlib/db.c +@@ -65,7 +65,7 @@ struct timeval db_time; + + int db_debug; + +-u_char grey_on; ++extern u_char grey_on; + + DB_BUF_MODE db_buf_mode_hash, db_buf_mode_db; + +--- a/thrlib/cmn_defs.h ++++ b/thrlib/cmn_defs.h +@@ -237,7 +237,7 @@ extern u_int dcc_ctxt_sn; /* change X-DCC header server name */ + + extern RCPT_ST *rcpt_st_free; + +-const char *userdirs; ++extern const char *userdirs; + + extern u_char dcc_query_only; + extern u_char can_discard_1; /* 1=can trim targets after DATA */ |