diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-08-25 10:45:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-08-25 10:45:55 +0100 |
commit | 3cf7c3ef441822c889356fd1812ebf2944a59851 (patch) | |
tree | c513fe68548b40365c1c2ebfe35c58ad431cdd77 /mail-filter/dspam | |
parent | 05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff) |
gentoo resync : 25.08.2020
Diffstat (limited to 'mail-filter/dspam')
-rw-r--r-- | mail-filter/dspam/Manifest | 2 | ||||
-rw-r--r-- | mail-filter/dspam/dspam-3.10.2-r3.ebuild | 223 | ||||
-rw-r--r-- | mail-filter/dspam/files/dspam-3.10.2-mysql8-my_bool-typedef.patch | 13 |
3 files changed, 238 insertions, 0 deletions
diff --git a/mail-filter/dspam/Manifest b/mail-filter/dspam/Manifest index 9a3ce8d84f27..eb26dc68648b 100644 --- a/mail-filter/dspam/Manifest +++ b/mail-filter/dspam/Manifest @@ -1,7 +1,9 @@ +AUX dspam-3.10.2-mysql8-my_bool-typedef.patch 395 BLAKE2B 36c85ea2f2b2c9a4bd207b34194baffd9cc923dfeedd0441fb9b950a0ad0a80a453d4e9ddb774de82397402e75bc0b89a22aa09569df051f31af97b623cce7ef SHA512 d562bc266ff751b8b4dcd6ac198a237f73c75731868224ab558b8207809302b61491c86ad72cefa4199d31e127339c3dd2830fb013025a0e3b015beb8c075027 AUX dspam.confd 299 BLAKE2B aab266bbf21ec63e668ee0ec88f3d8b1c7d2bf34f5dac43c063869ad2d2151767ae9c58e58bfc3709161322730f9590553d1b264bf0b1d875aa27b7c81d634af SHA512 fed17bf8b053924b42d7eaf11508ce3a75ca065c495c68a41016d82456cc8055bbd19c67135ab3d0d8cffe9717487c7000c8600a8dc1e077d18052919d98b433 AUX dspam.cron-r4 160 BLAKE2B 55a8bc86a1ea34ea8a17a8dd41cb21625682e94d02086060a58c26e9a553579fbb344b8fe364ed717591be9af7cda7e2270b86fce0428d72fd30e48fe576af5c SHA512 b00260fb3017c34d6c37ac97139dda82a609740ee751f8e97487e9bbdb27582715adab418fcf4650c34a0b0d04ebad9c2aac14580e29a5cfca78b783b3e8c14c AUX dspam.initd 867 BLAKE2B c0dd2e67cb57b646b95b2b5cdf12aeea647166fde24036497e5e528e2bb6b66312e12c9895397f3dafb525dd12d528cb0550250e25d320ea133098be50adba88 SHA512 19d9abe29187612e358f4d7c428cf7313254e06e378f8ab5b6996871e80b6ceaf7c63763a6f6a4c3e4c0ff5d0d303a341c8995d87927f8f5b38580583af9a8f8 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-r2.ebuild 5933 BLAKE2B 124d4a8e3bcc45c75df78a47a895f97717662c8026e889dbaa7b70ffba4277fc2a126e8e2f46903299567f886295823083d037726c345974d5403dff910b1b64 SHA512 b140a514d4257d9aa40206879563e27b30d8287810a41fbd1a78d656618d7e68b1bcfe429c8a666069c8cac3e5f6d979303757bedd38f40418435921702d4db7 +EBUILD dspam-3.10.2-r3.ebuild 5996 BLAKE2B efbe8799c7b1d1083856647cd138600d4a1a8a889965d56430faad46c7c27f6ce6b0a7d97e4267b46b41ba1337741f36e8a05bab983cf283bceefe5dbd03547e SHA512 11bd8f1eb385ae8696836a188b091752a6d2b5fac196ce365cbd6f24bf99c5221ea86c0ad2f669f76c452e70285f779645204ae3222f7f97acaaa3d518961ccf MISC metadata.xml 1080 BLAKE2B 99fe9506bc845c43f298230a531ea6e463dae9ffa353b7e55c1133f0ee37d10e2b0846f6edc726fd690e1ec637809e4e2fdb5a04456b80b7382fd767b39b44e3 SHA512 963fd0fc0c898ad12877e5905917d0b733cf8e52c62d254955455b60e60eacd1b909c998e3e88c030cfd9024786da80920222369939a189d8e142500a13a636f diff --git a/mail-filter/dspam/dspam-3.10.2-r3.ebuild b/mail-filter/dspam/dspam-3.10.2-r3.ebuild new file mode 100644 index 000000000000..5343bc91d6d3 --- /dev/null +++ b/mail-filter/dspam/dspam-3.10.2-r3.ebuild @@ -0,0 +1,223 @@ +# Copyright 1999-2020 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 ~arm64 ~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 ) +" + +PATCHES=( "${FILESDIR}/${P}-mysql8-my_bool-typedef.patch" ) + +# 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 +} diff --git a/mail-filter/dspam/files/dspam-3.10.2-mysql8-my_bool-typedef.patch b/mail-filter/dspam/files/dspam-3.10.2-mysql8-my_bool-typedef.patch new file mode 100644 index 000000000000..8edafbdf0dab --- /dev/null +++ b/mail-filter/dspam/files/dspam-3.10.2-mysql8-my_bool-typedef.patch @@ -0,0 +1,13 @@ +--- a/src/mysql_drv.c 2020-07-07 10:40:33.871152228 -0400 ++++ b/src/mysql_drv.c 2020-07-07 10:43:16.187818893 -0400 +@@ -35,6 +35,10 @@ + #include <fcntl.h> + #include <signal.h> + #include <mysql.h> ++#if defined(LIBMYSQL_VERSION_ID) && (LIBMYSQL_VERSION_ID >= 80000) ++ typedef bool my_bool; ++#endif ++ + #include <limits.h> + + /* Work around broken limits.h on debian etch (and possibly others?) */ |