diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-02-16 12:59:29 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-02-16 12:59:29 +0000 |
commit | 79599515788b85b18aa655e7b7f8cc05c1bbddd8 (patch) | |
tree | ade7cb031f363fad64c77139dea7aa3d81908537 /mail-filter/dspam | |
parent | 6bc2e4d7c5906e46a8f275a876ead6ec41aca5bb (diff) |
gentoo resync : 16.02.1018
Diffstat (limited to 'mail-filter/dspam')
-rw-r--r-- | mail-filter/dspam/Manifest | 1 | ||||
-rw-r--r-- | mail-filter/dspam/dspam-3.10.2-r2.ebuild | 221 |
2 files changed, 222 insertions, 0 deletions
diff --git a/mail-filter/dspam/Manifest b/mail-filter/dspam/Manifest index 1c9e5a2d2288..9882e32fa2bc 100644 --- a/mail-filter/dspam/Manifest +++ b/mail-filter/dspam/Manifest @@ -4,4 +4,5 @@ AUX dspam.initd 867 BLAKE2B c0dd2e67cb57b646b95b2b5cdf12aeea647166fde24036497e5e AUX dspam.logrotate 180 BLAKE2B 157570caf3ce9885ded6aaf99f189985a730306e7a15cdb77dfc050134e75722ac0d82b27f69ed9478b252e458a39b3705801d9829d4759cf439a892aaf66275 SHA512 8178e7ce02ca11171bc5650b70583fa02d2a84a25d184bbee1760618355578826c34a423d76310135f773e37d5ecab565a707ed1d33190005daf1851a756c389 DIST dspam-3.10.2.tar.gz 1035054 BLAKE2B 9200e6a3449feea3cec80572d7856597e487e553a69b52e7ecee1cd17c0792faf48fbda9e253d1fe52be40b8f0d4dcab4006b898abdcc62289550f17d7d876d3 SHA512 5fe53e1d0d7cabb3983f5c67274b074b7c647c1bae10ebc7ea3805542f99dbfb39abd4697e344e6eb80554522319a1253e1082ed6b389364bbaec1d6ddd43856 EBUILD dspam-3.10.2-r1.ebuild 5977 BLAKE2B f988cf01a109b7a96462c4de3e7e432f53a3e69533322e9bef453b651bbdd09ebe9cf18c65b2880ab2fbb6fdc697409205213ee50ffb0794c685ca69cd336a58 SHA512 f6f45d8fdd212442d289c535e260fe79274ebb84356a0dbb7b72b207278dc0ddd89d6fb255fd8d77945600bc9209b291737246a616caf89d9f3c44f9ed791554 +EBUILD dspam-3.10.2-r2.ebuild 5928 BLAKE2B edd2f70ee54ee49457912985f6b2e761294bce167191f0eb1a67ce5b56aecba19cec39cab82eaff74c42bf21f257cf4c97234d349410b9baaafb5eef3685ad17 SHA512 013d1d7409777899d12d001f4d7f2254d612af3e80c818dbc0479a1d7b2f4b2262567114a8bd8dd6a29e87af68bc8838cd342b5b46fe1c0755de1b03fbcf4735 MISC metadata.xml 1157 BLAKE2B c3f336c364a060100e45bf1a8439237900ac09dd087fadbfd36e1b0568f28a735d88fbe5e328497331a2bc037c0feef3375722c5a6ead493b3bb99eb9fdea219 SHA512 84b601656c40e8d1c2444736389c44f54e95c4e8f487728af82c65fdad26d2ecc875087e2d93b27126593514da8ea375f57dee1e8e7730f21ab9c0b988326f0c diff --git a/mail-filter/dspam/dspam-3.10.2-r2.ebuild b/mail-filter/dspam/dspam-3.10.2-r2.ebuild new file mode 100644 index 000000000000..427586b4be9e --- /dev/null +++ b/mail-filter/dspam/dspam-3.10.2-r2.ebuild @@ -0,0 +1,221 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit user + +DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter" +HOMEPAGE="http://dspam.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="AGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~x86" +DRIVERS_IUSE="+hash mysql postgres sqlite" +SCALES_IUSE="small-scale +domain-scale large-scale" +IUSE="clamav daemon debug ldap static-libs syslog virtual-users user-homedirs ${DRIVERS_IUSE} ${SCALES_IUSE}" + +DEPEND=" + net-mail/mailbase + ldap? ( net-nds/openldap ) + mysql? ( dev-db/mysql-connector-c:0= ) + postgres? ( dev-db/postgresql ) + sqlite? ( dev-db/sqlite:3 ) +" +RDEPEND=" + ${DEPEND} + clamav? ( app-antivirus/clamav ) + syslog? ( virtual/logger ) +" + +# Demands on sane USE flags: +# - find out what driver to use: select at least one +# - if static-libs is set, only one driver may be selected +# - find out what scale to use: select exactly one +# - user-homedirs does not work with virtual-users +REQUIRED_USE=" + || ( ${DRIVERS_IUSE//+} ) + static-libs? ( ^^ ( ${DRIVERS_IUSE//+} ) ) + ^^ ( ${SCALES_IUSE//+} ) + virtual-users? ( !user-homedirs ) +" + +# dspam setup defaults +DSPAM_HOME=/var/spool/dspam +DSPAM_CONF=/etc/dspam +DSPAM_LOG=/var/log/dspam +DSPAM_MODE=2510 +DSPAM_DRIVERS= +DSPAM_DRIVERS_EXTRAS= + +pkg_setup() { + # setup storage, this sets DSPAM_DRIVERS + dspam_setup_storage_drivers + + # create dspam user and group + dspam_setup_user +} + +src_configure() { + econf \ + --sysconfdir=${DSPAM_CONF} \ + --with-dspam-home=${DSPAM_HOME} \ + --with-dspam-home-group=dspam \ + --with-dspam-mode=${DSPAM_MODE} \ + --with-dspam-group=dspam \ + --with-logdir=${DSPAM_LOG} \ + --enable-external-lookup \ + --enable-long-usernames \ + --enable-split-configuration \ + $(use_enable clamav) \ + $(use_enable daemon) \ + $(use_enable debug) \ + $(use_enable debug bnr-debug) \ + $(use_enable debug verbose-debug) \ + $(use_enable domain-scale) \ + $(use_enable large-scale) \ + $(use_enable static-libs static) \ + $(use_enable syslog) \ + $(use_enable user-homedirs homedir) \ + $(use_enable virtual-users) \ + --with-storage-driver=${DSPAM_DRIVERS} ${DSPAM_DRIVERS_EXTRAS} \ + $(use mysql || use postgres && echo "--enable-preferences-extension") \ + $(use syslog || echo "--with-logfile=${DSPAM_LOG}/dspam.log") +} + +dspam_setup_user() { + # DSPAM CGI web gui (www-apps/dspam-web) needs to run as a regular user + # under suexec in apache, so DSPAM user/group need to be regular users too + + local euid egid + for euid in {1000..5000} ; do + [ -z "$(egetent passwd ${euid})" ] && break + done + for egid in {1000..5000} ; do + [ -z "$(egetent group ${egid})" ] && break + done + enewgroup dspam ${egid} + enewuser dspam ${euid} -1 "${DSPAM_HOMEDIR}" dspam,mail +} + +dspam_setup_storage_drivers() { + # Find out which storage drivers need to be enabled, and set some + # variables so that src_configure can pick them up + + if use hash; then + DSPAM_DRIVERS+=",hash_drv" + fi + + if use mysql; then + DSPAM_DRIVERS+=",mysql_drv" + DSPAM_DRIVERS_EXTRAS+="--with-mysql-includes=/usr/include/mysql " + fi + + if use postgres; then + DSPAM_DRIVERS+=",pgsql_drv" + fi + + if use sqlite; then + DSPAM_DRIVERS+=",sqlite3_drv" + fi + + if ! use static-libs; then + # set the driver name twice to avoid a static build + DSPAM_DRIVERS+=${DSPAM_DRIVERS} + fi + + # remove first comma separator + DSPAM_DRIVERS=${DSPAM_DRIVERS:1} + einfo "Building with drivers: ${DSPAM_DRIVERS}" + #echo DSPAM_DRIVERS_EXTRAS=$DSPAM_DRIVERS_EXTRAS +} + +src_install() { + default + + if use daemon; then + newinitd "${FILESDIR}/dspam.initd" dspam + newconfd "${FILESDIR}/dspam.confd" dspam + fi + + if use mysql; then + insinto "/usr/share/${PN}/mysql" + + local files="mysql_objects-4.1.sql mysql_objects-space.sql mysql_objects-speed.sql purge-4.1.sql purge.sql" + if use virtual-users; then + files+=" virtual_user_aliases.sql virtual_users.sql" + fi + + for file in $files; do + doins src/tools.mysql_drv/${file} + done + fi + + if use postgres; then + insinto "/usr/share/${PN}/pgsql" + + local files="pgsql_objects.sql purge-pe.sql purge.sql" + if use virtual-users; then + files+=" virtual_users.sql" + fi + + for file in $files; do + doins src/tools.pgsql_drv/${file} + done + fi + + if use sqlite; then + insinto "/usr/share/${PN}/sqlite" + newins src/tools.sqlite_drv/purge-3.sql purge.sql + fi + + insinto "${DSPAM_HOME}/txt" + doins txt/*.txt + local i + for i in spam nonspam; do + echo "Scanned and tagged with DSPAM ${PV} on Gentoo Linux as ${i} by ISP" > "${T}/msgtag.${i}" + doins "${T}/msgtag.${i}" + done + + newbin contrib/dspam_maintenance/dspam_maintenance.sh dspam_maintenance + exeinto /etc/cron.daily + newexe "${FILESDIR}/dspam.cron-r4" dspam + + insinto /etc/logrotate.d + newins "${FILESDIR}/dspam.logrotate" dspam + + dodoc CHANGELOG README* RELEASE.NOTES UPGRADING doc/*.txt + + # stop logrotate-3.8 from complaining + dodir /var/log/dspam + fowners dspam:dspam /var/log/dspam + fperms 0750 /var/log/dspam + + # Install dspamc setgid + fowners root:dspam /usr/bin/dspamc + fperms g+s /usr/bin/dspamc +} + +pkg_preinst() { + # dspam-3.10.0: config dir change, should be removed at some later point + if [ -d "${ROOT}/etc/mail/dspam" ]; then + ewarn "The configuration directory of DSPAM has been relocated from /etc/mail/dspam to ${DSPAM_CONF}." + if [ -h "${ROOT}${DSPAM_CONF}" ]; then + # symlink, this is the setup in older ebuilds + ewarn "Moving contents of /etc/mail/dspam to ${DSPAM_CONF} ..." + rm "${ROOT}${DSPAM_CONF}" && mv "${ROOT}/etc/mail/dspam" "${DSPAM_CONF}" + eend $? + + elif [ -d "${ROOT}${DSPAM_CONF}" ]; then + # directory and no symlink, do it manually since we cannot decide. + ewarn "You have both /etc/mail/dspam and ${DSPAM_CONF} directories, please delete the former." + + else + # nothing interesting in /etc/dspam + ewarn "Moving contents of /etc/mail/dspam to ${DSPAM_CONF} ..." + mv "${ROOT}/etc/mail/dspam" "${DSPAM_CONF}" + eend $? + fi + fi +} |