public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/
Date: Sat,  2 Dec 2023 07:13:12 +0000 (UTC)	[thread overview]
Message-ID: <1701501015.e92325dddea86232ac9577049695a9f11522a58c.sam@gentoo> (raw)

commit:     e92325dddea86232ac9577049695a9f11522a58c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  2 06:05:44 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec  2 07:10:15 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e92325dd

mail-filter/procmail: update EAPI 6 -> 8, gnu89, no LTO

* Filter LTO (bug #859517, bug #874375 - the latter is a somewhat real bug but
  it only happens with races and not worth fixing for procmail anyway given
  the first bug & it's dead)

* Set -std=gnu89 (bug #875251, bug #896052) for modern C compilers.

Closes: https://bugs.gentoo.org/859517
Closes: https://bugs.gentoo.org/875251
Closes: https://bugs.gentoo.org/896052
Closes: https://bugs.gentoo.org/874375
Signed-off-by: Sam James <sam <AT> gentoo.org>

 mail-filter/procmail/procmail-3.22-r16.ebuild | 135 ++++++++++++++++++++++++++
 1 file changed, 135 insertions(+)

diff --git a/mail-filter/procmail/procmail-3.22-r16.ebuild b/mail-filter/procmail/procmail-3.22-r16.ebuild
new file mode 100644
index 000000000000..b53f7b58ddfe
--- /dev/null
+++ b/mail-filter/procmail/procmail-3.22-r16.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs prefix
+
+DESCRIPTION="Mail delivery agent/filter"
+HOMEPAGE="http://www.procmail.org/"
+SRC_URI="http://www.procmail.org/${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="mbox selinux"
+
+DEPEND="
+	acct-group/mail
+	virtual/mta
+"
+RDEPEND="
+	${DEPEND}
+	selinux? ( sec-policy/selinux-procmail )
+"
+
+src_prepare() {
+	# disable flock, using both fcntl and flock style locking
+	# doesn't work with NFS with 2.6.17+ kernels, bug #156493
+
+	sed -e "s|/\*#define NO_flock_LOCK|#define NO_flock_LOCK|" \
+		-i config.h || die "sed failed"
+
+	if ! use mbox ; then
+		echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc || die
+		echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc || die
+		cd "${S}" || die
+		eapply "${FILESDIR}/gentoo-maildir3.diff"
+	else
+		echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc || die
+		echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc || die
+	fi
+
+	# Do not use lazy bindings on lockfile and procmail
+	if [[ ${CHOST} != *-darwin* ]]; then
+		eapply -p0 "${FILESDIR}/${PN}-lazy-bindings.diff"
+	fi
+
+	# Fix for bug #102340
+	eapply -p0 "${FILESDIR}/${PN}-comsat-segfault.diff"
+
+	# Fix for bug #119890
+	eapply -p0 "${FILESDIR}/${PN}-maxprocs-fix.diff"
+
+	# Prefixify config.h
+	eapply -p0 "${FILESDIR}"/${PN}-prefix.patch
+	eprefixify config.h Makefile src/autoconf src/recommend.c
+
+	# Fix for bug #200006
+	eapply "${FILESDIR}/${PN}-pipealloc.diff"
+
+	# Fix for bug #270551
+	eapply "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
+
+	# Fix security bugs #522114 and #638108
+	eapply "${FILESDIR}/${PN}-3.22-CVE-2014-3618.patch"
+	eapply "${FILESDIR}/${PN}-3.22-CVE-2017-16844.patch"
+
+	eapply "${FILESDIR}/${PN}-3.22-crash-fix.patch"
+
+	eapply_user
+}
+
+src_compile() {
+	# bug #875251, bug #896052
+	append-flags -std=gnu89
+	# bug #859517
+	filter-lto
+
+	# -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
+	# To work around this, we append -fno-inline-functions to CFLAGS
+	# Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
+	# If it's clang, ignore -fno-ipa-cp-clone, as clang doesn't support this
+	append-flags -fno-inline-functions
+	tc-is-clang || append-flags -fno-ipa-cp-clone
+
+	sed -e "s|CFLAGS0 = -O|CFLAGS0 = ${CFLAGS}|" \
+		-e "s|LDFLAGS0= -s|LDFLAGS0 = ${LDFLAGS}|" \
+		-e "s|LOCKINGTEST=__defaults__|#LOCKINGTEST=__defaults__|" \
+		-e "s|#LOCKINGTEST=/tmp|LOCKINGTEST=/tmp|" \
+		-i Makefile || die "sed failed"
+
+	emake CC="$(tc-getCC)"
+}
+
+src_install() {
+	cd "${S}"/new || die
+	insinto /usr/bin
+	insopts -m 6755
+	doins procmail
+
+	doins lockfile
+	fowners root:mail /usr/bin/lockfile
+	fperms 2755 /usr/bin/lockfile
+
+	dobin formail mailstat
+	insopts -m 0644
+
+	doman *.1 *.5
+
+	cd "${S}" || die
+	dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
+
+	insinto /etc
+	doins procmailrc
+
+	docinto examples
+	dodoc examples/*
+}
+
+pkg_postinst() {
+	if ! use mbox ; then
+		elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
+		elog "that you configure a mail storage location using DEFAULT in"
+		elog "/etc/procmailrc, for example:"
+		elog "\tDEFAULT=\$HOME/.maildir/"
+	fi
+	if has sfperms ${FEATURES}; then
+		ewarn "FEATURES=sfperms removes the read-bit for others from"
+		ewarn "  /usr/bin/procmail"
+		ewarn "  /usr/bin/lockfile"
+		ewarn "If you use procmail from an MTA like Exim, you need to"
+		ewarn "re-add the read-bit or avoid the MTA checking the binary"
+		ewarn "exists."
+	fi
+}


             reply	other threads:[~2023-12-02  7:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02  7:13 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-06 20:14 [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/ Sam James
2024-11-01  6:37 Joonas Niilola
2024-11-01  6:35 Arthur Zamarin
2024-11-01  2:55 Sam James
2024-11-01  2:55 Sam James
2024-10-31 21:29 Sam James
2024-10-31 19:32 Arthur Zamarin
2024-01-22 13:12 Sam James
2024-01-13 17:39 Sam James
2024-01-13 14:30 Sam James
2024-01-13 12:49 Arthur Zamarin
2024-01-13 12:49 Arthur Zamarin
2024-01-13 12:49 Arthur Zamarin
2022-06-03  8:11 Fabian Groffen
2021-07-23 18:28 Marek Szuba
2021-04-20 11:39 Mikle Kolyada
2021-01-06 13:50 Fabian Groffen
2020-07-16  8:45 Mikle Kolyada
2020-02-21 18:33 Mikle Kolyada
2019-09-15 20:50 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-06 16:40 Mikle Kolyada
2019-04-02  9:41 Mikle Kolyada
2019-04-02  9:41 Mikle Kolyada
2019-04-02  1:37 Thomas Deutschmann
2019-03-28  7:01 Mikle Kolyada
2019-03-26 22:44 Aaron Bauman
2019-03-26 21:09 Sergei Trofimovich
2019-03-25 22:18 Sergei Trofimovich
2019-03-25 11:49 Mikle Kolyada
2019-03-24 20:12 Sergei Trofimovich
2019-03-24 19:44 Sergei Trofimovich
2019-03-24 12:02 Richard Freeman
2017-10-02  7:10 Fabian Groffen
2016-06-15  3:35 Austin English

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1701501015.e92325dddea86232ac9577049695a9f11522a58c.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox