From 9d467a0e64ef635873702cecbf8f614b164a6907 Mon Sep 17 00:00:00 2001
From: Hanno Böck <hanno@gentoo.org>
Date: Sat, 16 Nov 2019 08:32:31 +0100
Subject: mail-filter/libmilter: Bump and glibc 2.30 support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream versions aren't increased properly, so we have to
make this a _p1 version.
Newer build system patch from sendmail ebuild.
Patch for glibc 2.30 support extracted from OpenSUSE.

Closes: https://bugs.gentoo.org/691692
Signed-off-by: Hanno Böck <hanno@gentoo.org>
Package-Manager: Portage-2.3.79, Repoman-2.3.18
---
 mail-filter/libmilter/Manifest                     |   1 +
 .../libmilter/files/libmilter-glibc-2.30.patch     |  25 +++
 .../files/sendmail-8.14.6-build-system.patch       | 211 +++++++++++++++++++++
 mail-filter/libmilter/libmilter-1.0.2_p1.ebuild    |  72 +++++++
 4 files changed, 309 insertions(+)
 create mode 100644 mail-filter/libmilter/files/libmilter-glibc-2.30.patch
 create mode 100644 mail-filter/libmilter/files/sendmail-8.14.6-build-system.patch
 create mode 100644 mail-filter/libmilter/libmilter-1.0.2_p1.ebuild

(limited to 'mail-filter')

diff --git a/mail-filter/libmilter/Manifest b/mail-filter/libmilter/Manifest
index 1fc4bdf2b583..02a7dd7b9e97 100644
--- a/mail-filter/libmilter/Manifest
+++ b/mail-filter/libmilter/Manifest
@@ -1 +1,2 @@
 DIST sendmail.8.14.5.tar.gz 2092508 BLAKE2B 3d90fa9778ebb42f2f334b35e46d0f24e8fcfd46fe69d6032f246c90fc998fbeb21e70c70bc454c688a76ea00c90ee9b5f0e5e0fc9b89b9f16fa9c814a825f9c SHA512 178addd247f1c7c8ca90d70b9240db4cad4e55f0710d5df0fe979e5473a182d2035150c352836576a28bb2b9660b0d5ebfcd95269a156ac0d2c3dba3edb60452
+DIST sendmail.8.15.2.tar.gz 2207417 BLAKE2B 3d9dfb5bc2b535e30ef2fc61333e12a9b1fc45a5d730d2bed1ef956adb574721833f87aeba0475705b76e0c7d6cf00f9a10025bffb0de6c6b4dae606eb2ec399 SHA512 04feb37316c13b66b1518596507a7da7c16cb0bf1abf10367f7fd888a428fadb093a9efa55342fa55b936c3f0cbdc63b9e2505cd99201a69a0c05b8ad65f49f9
diff --git a/mail-filter/libmilter/files/libmilter-glibc-2.30.patch b/mail-filter/libmilter/files/libmilter-glibc-2.30.patch
new file mode 100644
index 000000000000..5ceac845b90e
--- /dev/null
+++ b/mail-filter/libmilter/files/libmilter-glibc-2.30.patch
@@ -0,0 +1,25 @@
+--- a/libmilter/sm_gethost.c	2014-03-05 01:59:45.000000000 +0100
++++ b/libmilter/sm_gethost.c	2019-11-14 18:59:41.885353232 +0100
+@@ -51,18 +51,20 @@ sm_getipnodebyname(name, family, flags,
+ {
+ 	bool resv6 = true;
+ 	struct hostent *h;
+-
++#ifdef RES_USE_INET6
+ 	if (family == AF_INET6)
+ 	{
+ 		/* From RFC2133, section 6.1 */
+ 		resv6 = bitset(RES_USE_INET6, _res.options);
+ 		_res.options |= RES_USE_INET6;
+ 	}
++#endif
+ 	SM_SET_H_ERRNO(0);
+ 	h = gethostbyname(name);
++#ifdef RES_USE_INET6
+ 	if (family == AF_INET6 && !resv6)
+ 		_res.options &= ~RES_USE_INET6;
+-
++#endif
+ 	/* the function is supposed to return only the requested family */
+ 	if (h != NULL && h->h_addrtype != family)
+ 	{
diff --git a/mail-filter/libmilter/files/sendmail-8.14.6-build-system.patch b/mail-filter/libmilter/files/sendmail-8.14.6-build-system.patch
new file mode 100644
index 000000000000..3348e921926c
--- /dev/null
+++ b/mail-filter/libmilter/files/sendmail-8.14.6-build-system.patch
@@ -0,0 +1,211 @@
+diff -Nru sendmail-8.14.3.orig/cf/cf/Makefile sendmail-8.14.3/cf/cf/Makefile
+--- sendmail-8.14.3.orig/cf/cf/Makefile	2005-06-14 04:16:34.000000000 +0200
++++ sendmail-8.14.3/cf/cf/Makefile	2009-09-20 10:55:50.000000000 +0200
+@@ -80,10 +80,10 @@
+ install-cf:  install-sendmail-cf install-submit-cf
+ 
+ install-sendmail-cf: $(CF).cf
+-	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(CF).cf ${DESTDIR}$(MAILDIR)/sendmail.cf
++	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(CF).cf "${DESTDIR}$(MAILDIR)/sendmail.cf"
+ 
+ install-submit-cf: $(SUBMIT).cf
+-	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(SUBMIT).cf ${DESTDIR}$(MAILDIR)/submit.cf
++	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(SUBMIT).cf "${DESTDIR}$(MAILDIR)/submit.cf"
+ 
+ depend:
+
+diff -Nru sendmail-8.14.6.orig/devtools/M4/UNIX/defines.m4 sendmail-8.14.6/devtools/M4/UNIX/defines.m4
+--- sendmail-8.14.6.orig/devtools/M4/UNIX/defines.m4	2012-01-21 00:07:08.000000000 +0000
++++ sendmail-8.14.6/devtools/M4/UNIX/defines.m4	2012-12-27 08:13:15.792214375 +0000
+@@ -26,7 +26,7 @@
+ CCLINK = ifdef(`confCCLINK', `confCCLINK', `confCC')
+ # Linker for libraries
+ LD=	ifdef(`confLD', `confLD', `confCC')
+-LDOPTS=	ifdef(`confLDOPTS', `confLDOPTS') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `')
++LDOPTS=	ifdef(`confLDOPTS', `confLDOPTS')
+ LDOPTS_SO= ${LDOPTS} ifdef(`confLDOPTS_SO', `confLDOPTS_SO', `-shared')
+ 
+ # Shell
+@@ -71,7 +71,7 @@
+ LIBADD= ifdef(`conf_'bldCURRENT_PRD`_LIBS', `conf_'bldCURRENT_PRD`_LIBS')
+ 
+ # libraries required on your system
+-LIBS= ${LIBADD} ifdef(`confLIBS', `confLIBS') ifdef(`conf_'bldCURRENT_PRD`_LIB_POST', `conf_'bldCURRENT_PRD`_LIB_POST')
++LIBS= ${LIBADD} ifdef(`confLIBS', `confLIBS') ifdef(`conf_'bldCURRENT_PRD`_LIB_POST', `conf_'bldCURRENT_PRD`_LIB_POST') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `')
+ 
+ # location of sendmail binary (usually /usr/sbin or /usr/lib)
+ BINDIR=	ifdef(`confMBINDIR', `confMBINDIR', `/usr/sbin')
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/executable.m4 sendmail-8.14.3/devtools/M4/UNIX/executable.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/executable.m4	2006-10-06 07:44:44.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/executable.m4	2009-09-20 10:50:36.000000000 +0200
+@@ -30,12 +30,12 @@
+ 
+ ifdef(`bldNO_INSTALL', ,
+ `install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT ifdef(`bldTARGET_INST_DEP', `bldTARGET_INST_DEP')
+-	ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'BINDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'BINDIR}; else :; fi ')
+-	${INSTALL} -c -o ${bldBIN_TYPE`'BINOWN} -g ${bldBIN_TYPE`'BINGRP} -m ${bldBIN_TYPE`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${bldINSTALL_DIR`'BINDIR}
++	ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'BINDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'BINDIR}"; else :; fi ')
++	${INSTALL} -c -o ${bldBIN_TYPE`'BINOWN} -g ${bldBIN_TYPE`'BINGRP} -m ${bldBIN_TYPE`'BINMODE} bldCURRENT_PRODUCT "${DESTDIR}${bldINSTALL_DIR`'BINDIR}"
+ ifdef(`bldTARGET_LINKS', `bldMAKE_TARGET_LINKS(${bldINSTALL_DIR`'BINDIR}/bldCURRENT_PRODUCT, ${bldCURRENT_PRODUCT`'TARGET_LINKS})')')
+ 
+ strip-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT
+-	${STRIP} ${STRIPOPTS} ${DESTDIR}${bldINSTALL_DIR`'BINDIR}`'/bldCURRENT_PRODUCT
++	${STRIP} ${STRIPOPTS} "${DESTDIR}${bldINSTALL_DIR`'BINDIR}`'/bldCURRENT_PRODUCT"
+ 
+ bldCURRENT_PRODUCT-clean:
+ 	rm -f ${OBJS} bldCURRENT_PRODUCT ${MANPAGES}
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/library.m4 sendmail-8.14.3/devtools/M4/UNIX/library.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/library.m4	2006-09-06 00:56:53.000000000 +0200
++++ sendmail-8.14.3/devtools/M4/UNIX/library.m4	2009-09-20 10:50:36.000000000 +0200
+@@ -27,8 +27,8 @@
+ ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
+ 
+ install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.a
+-ifdef(`bldINSTALLABLE', `	ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'LIBDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'LIBDIR}; else :; fi ')
+-	${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a ${DESTDIR}${LIBDIR}')
++ifdef(`bldINSTALLABLE', `	ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${LIBDIR}"; else :; fi ')
++	${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
+ 
+ bldCURRENT_PRODUCT-clean:
+ 	rm -f ${OBJS} bldCURRENT_PRODUCT.a ${MANPAGES}
+--- sendmail-8.14.6.orig/devtools/M4/UNIX/manpage.m4	2012-01-21 00:07:08.000000000 +0000
++++ sendmail-8.14.6/devtools/M4/UNIX/manpage.m4	2012-12-27 08:28:52.617502447 +0000
+@@ -68,11 +68,11 @@
+ ifdef(`confNO_MAN_INSTALL', `divert(-1)', `dnl')
+ define(`bldMAN_INSTALL_CMD',
+ `ifdef(`confDONT_INSTALL_CATMAN', `dnl',
+-`	ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC} ]; then confMKDIR -p ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}; else :; fi ')
+-	${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).`${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}' `${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}'')
++`	ifdef(`confMKDIR', `if [ ! -d "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}" ]; then confMKDIR -p "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}"; else :; fi ')
++	${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).`${MAN'bldGET_MAN_SOURCE_NUM($1)`SRC}' "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)}/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}''")
+ ifdef(`confINSTALL_RAWMAN',
+-`	ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN} ]; then confMKDIR -p ${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}; else :; fi ')
+-	${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).bldGET_MAN_SOURCE_NUM($1) `${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}'', `dnl')'
++`	ifdef(`confMKDIR', `if [ ! -d "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'" ]; then confMKDIR -p "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'"; else :; fi ')
++	${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} bldGET_MAN_BASE_NAME($1).bldGET_MAN_SOURCE_NUM($1) "`${DESTDIR}${MAN'bldGET_MAN_SOURCE_NUM($1)`MAN}'/bldGET_MAN_BASE_NAME($1)`.${MAN'bldGET_MAN_SOURCE_NUM($1)`EXT}''", `dnl')'
+ )dnl
+ bldFOREACH(`bldMAN_INSTALL_CMD(', `bldMAN_PAGES')
+ ifdef(`confNO_MAN_INSTALL', `divert(0)', `dnl')
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4	2008-04-08 07:23:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4	2009-09-20 10:50:36.000000000 +0200
+@@ -32,9 +32,9 @@
+ MFAPI=	${SRCDIR}/inc`'lude/libmilter/mfapi.h
+ MFDEF=	${SRCDIR}/inc`'lude/libmilter/mfdef.h
+ install-mfapi: ${MFAPI}
+-	if [ ! -d ${DESTDIR}${INCLUDEDIR}/libmilter ]; then mkdir -p ${DESTDIR}${INCLUDEDIR}/libmilter; else :; fi
+-	${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} ${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h
+-	${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFDEF} ${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h
++	if [ ! -d "${DESTDIR}${INCLUDEDIR}/libmilter" ]; then mkdir -p "${DESTDIR}${INCLUDEDIR}/libmilter"; else :; fi
++	${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} "${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h"
++	${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFDEF} "${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h"
+ divert(0)
+ 
+ bldFINISH
+diff -Nru sendmail-8.14.3.orig/mail.local/Makefile.m4 sendmail-8.14.3/mail.local/Makefile.m4
+--- sendmail-8.14.3.orig/mail.local/Makefile.m4	2006-06-28 23:08:02.000000000 +0200
++++ sendmail-8.14.3/mail.local/Makefile.m4	2009-09-20 10:56:24.000000000 +0200
+@@ -30,7 +30,7 @@
+ force-install: install-mail.local ifdef(`confNO_MAN_BUILD',, `install-docs')
+ 
+ install-mail.local: mail.local
+-	${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} mail.local ${DESTDIR}${EBINDIR}
++	${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} mail.local "${DESTDIR}${EBINDIR}"
+ divert
+ 
+ bldFINISH
+diff -Nru sendmail-8.14.3.orig/rmail/Makefile.m4 sendmail-8.14.3/rmail/Makefile.m4
+--- sendmail-8.14.3.orig/rmail/Makefile.m4	2006-06-28 23:08:04.000000000 +0200
++++ sendmail-8.14.3/rmail/Makefile.m4	2009-09-20 10:55:29.000000000 +0200
+@@ -31,7 +31,7 @@
+ force-install: install-rmail ifdef(`confNO_MAN_BUILD',, `install-docs')
+ 
+ install-rmail: rmail
+-	${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} rmail ${DESTDIR}${UBINDIR}
++	${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m ${UBINMODE} rmail "${DESTDIR}${UBINDIR}"
+ divert
+ 
+ bldFINISH
+diff -Nru sendmail-8.14.3.orig/sendmail/Makefile.m4 sendmail-8.14.3/sendmail/Makefile.m4
+--- sendmail-8.14.3.orig/sendmail/Makefile.m4.orig	2008-03-27 17:13:33.000000000 +0100
++++ sendmail-8.14.3/sendmail/Makefile.m4	2009-09-20 11:07:24.000000000 +0200
+@@ -14,9 +14,9 @@
+ 
+ dnl hack: /etc/mail is not defined as "location of .cf" in the build system
+ define(`bldTARGET_INST_DEP', ifdef(`confINST_DEP', `confINST_DEP',
+-`${DESTDIR}/etc/mail/submit.cf ${DESTDIR}${MSPQ}'))dnl
++`"${DESTDIR}/etc/mail/submit.cf" "${DESTDIR}${MSPQ}"'))dnl
+ define(`bldTARGET_LINKS', ifdef(`confLINKS', `confLINKS',
+-`${DESTDIR}${UBINDIR}/newaliases ${DESTDIR}${UBINDIR}/mailq ${DESTDIR}${UBINDIR}/hoststat ${DESTDIR}${UBINDIR}/purgestat')
++`"${DESTDIR}${UBINDIR}/newaliases" "${DESTDIR}${UBINDIR}/mailq" "${DESTDIR}${UBINDIR}/hoststat" "${DESTDIR}${UBINDIR}/purgestat"')
+ )dnl
+ 
+ # location of sendmail statistics file (usually /etc/mail/ or /var/log)
+@@ -43,21 +43,21 @@
+ statistics:
+ 	${CP} /dev/null statistics
+ 
+-${DESTDIR}/etc/mail/submit.cf:
++"${DESTDIR}/etc/mail/submit.cf":
+ 	@echo "Please read INSTALL if anything fails while installing the binary."
+ 	@echo "${DESTDIR}/etc/mail/submit.cf will be installed now."
+ 	cd ${SRCDIR}/cf/cf && make install-submit-cf
+ 
+ MSPQ=ifdef(`confMSP_QUEUE_DIR', `confMSP_QUEUE_DIR', `/var/spool/clientmqueue')
+ 
+-${DESTDIR}${MSPQ}:
++"${DESTDIR}${MSPQ}":
+ 	@echo "Please read INSTALL if anything fails while installing the binary."
+ 	@echo "You must have setup a new user ${MSPQOWN} and a new group ${GBINGRP}"
+ 	@echo "as explained in sendmail/SECURITY."
+-	mkdir -p ${DESTDIR}${MSPQ}
+-	chown ${MSPQOWN} ${DESTDIR}${MSPQ}
+-	chgrp ${GBINGRP} ${DESTDIR}${MSPQ}
+-	chmod 0770 ${DESTDIR}${MSPQ}
++	mkdir -p "${DESTDIR}${MSPQ}"
++	chown ${MSPQOWN} "${DESTDIR}${MSPQ}"
++	chgrp ${GBINGRP} "${DESTDIR}${MSPQ}"
++	chmod 0770 "${DESTDIR}${MSPQ}"
+ 
+ divert(0)
+ 
+@@ -68,30 +68,30 @@
+ divert(bldTARGETS_SECTION)
+ 
+ install-set-user-id: bldCURRENT_PRODUCT ifdef(`confNO_HELPFILE_INSTALL',, `install-hf') ifdef(`confNO_STATISTICS_INSTALL',, `install-st') ifdef(`confNO_MAN_BUILD',, `install-docs')
+-	${INSTALL} -c -o ${S`'BINOWN} -g ${S`'BINGRP} -m ${S`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}
++	${INSTALL} -c -o ${S`'BINOWN} -g ${S`'BINGRP} -m ${S`'BINMODE} bldCURRENT_PRODUCT "${DESTDIR}${M`'BINDIR}"
+ 	for i in ${sendmailTARGET_LINKS}; do \
+ 		rm -f $$i; \
+ 		${LN} ${LNOPTS} ${M`'BINDIR}/sendmail $$i; \
+ 	done
+ 
+-define(`confMTA_LINKS', `${DESTDIR}${UBINDIR}/newaliases ${DESTDIR}${UBINDIR}/mailq ${DESTDIR}${UBINDIR}/hoststat ${DESTDIR}${UBINDIR}/purgestat')
++define(`confMTA_LINKS', `"${DESTDIR}${UBINDIR}/newaliases" "${DESTDIR}${UBINDIR}/mailq" "${DESTDIR}${UBINDIR}/hoststat" "${DESTDIR}${UBINDIR}/purgestat"')
+ install-sm-mta: bldCURRENT_PRODUCT
+-	${INSTALL} -c -o ${M`'BINOWN} -g ${M`'BINGRP} -m ${M`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}/sm-mta
++	${INSTALL} -c -o ${M`'BINOWN} -g ${M`'BINGRP} -m ${M`'BINMODE} bldCURRENT_PRODUCT "${DESTDIR}${M`'BINDIR}/sm-mta"
+ 	for i in confMTA_LINKS; do \
+ 		rm -f $$i; \
+ 		${LN} ${LNOPTS} ${M`'BINDIR}/sm-mta $$i; \
+ 	done
+ 
+ install-hf:
+-	if [ ! -d ${DESTDIR}${HFDIR} ]; then mkdir -p ${DESTDIR}${HFDIR}; else :; fi
+-	${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m 444 helpfile ${DESTDIR}${HFFILE}
++	if [ ! -d "${DESTDIR}${HFDIR}" ]; then mkdir -p "${DESTDIR}${HFDIR}"; else :; fi
++	${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m 444 helpfile "${DESTDIR}${HFFILE}"
+ 
+ install-st: statistics
+-	if [ ! -d ${DESTDIR}${STDIR} ]; then mkdir -p ${DESTDIR}${STDIR}; else :; fi
+-	${INSTALL} -c -o ${SBINOWN} -g ${UBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics ${DESTDIR}${STPATH}
++	if [ ! -d "${DESTDIR}${STDIR}" ]; then mkdir -p "${DESTDIR}${STDIR}"; else :; fi
++	${INSTALL} -c -o ${SBINOWN} -g ${UBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics "${DESTDIR}${STPATH}"
+ 
+-install-submit-st: statistics ${DESTDIR}${MSPQ}
+-	${INSTALL} -c -o ${MSPQOWN} -g ${GBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics ${DESTDIR}${MSPQ}/${MSPSTFILE}
++install-submit-st: statistics "${DESTDIR}${MSPQ}"
++	${INSTALL} -c -o ${MSPQOWN} -g ${GBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics "${DESTDIR}${MSPQ}/${MSPSTFILE}"
+ 
+ divert(0)
+ bldPRODUCT_END
diff --git a/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild b/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild
new file mode 100644
index 000000000000..b7d5242cfdd5
--- /dev/null
+++ b/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib toolchain-funcs
+
+# This library is part of sendmail, but it does not share the version number with it.
+# In order to find the right libmilter version number, check SMFI_VERSION definition
+# that can be found in ${S}/include/libmilter/mfapi.h (see also SM_LM_VRS_* defines).
+# For example, version 1.0.1 has a SMFI_VERSION of 0x01000001.
+SENDMAIL_VER=8.15.2
+
+DESCRIPTION="The Sendmail Filter API (Milter)"
+HOMEPAGE="http://www.sendmail.org/"
+SRC_URI="ftp://ftp.sendmail.org/pub/sendmail/sendmail.${SENDMAIL_VER}.tar.gz"
+
+LICENSE="Sendmail"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="ipv6 poll"
+
+DEPEND="!mail-mta/sendmail
+	!mail-mta/sendmail"
+RDEPEND="!mail-mta/sendmail"
+
+S="${WORKDIR}/sendmail-${SENDMAIL_VER}"
+
+# build system patch copied from sendmail ebuild
+# glibc patch from opensuse
+PATCHES=(
+	"${FILESDIR}/sendmail-8.14.6-build-system.patch"
+	"${FILESDIR}/${PN}-sharedlib.patch"
+	"${FILESDIR}/${PN}-glibc-2.30.patch"
+	)
+
+src_prepare() {
+	default
+
+	local CC="$(tc-getCC)"
+	local ENVDEF="-DNETUNIX -DNETINET"
+	use ipv6 && ENVDEF="${ENVDEF} -DNETINET6"
+	use poll && ENVDEF="${ENVDEF} -DSM_CONF_POLL=1"
+
+	sed -e "s:@@CFLAGS@@:${CFLAGS}:" \
+		-e "s:@@LDFLAGS@@:${LDFLAGS}:" \
+		-e "s:@@CC@@:${CC}:" \
+		-e "s:@@ENVDEF@@:${ENVDEF}:" \
+		"${FILESDIR}/gentoo.config.m4" > "${S}/devtools/Site/site.config.m4" \
+		|| die "failed to generate site.config.m4"
+}
+
+src_compile() {
+	pushd libmilter
+	emake -j1 MILTER_SOVER=${PV}
+	popd
+}
+
+src_install () {
+	local MY_LIBDIR=/usr/$(get_libdir)
+	dodir "${MY_LIBDIR}"
+	emake DESTDIR="${D}" LIBDIR="${MY_LIBDIR}" MANROOT=/usr/share/man/man \
+		SBINOWN=root SBINGRP=0 UBINOWN=root UBINGRP=0 \
+		LIBOWN=root LIBGRP=0 GBINOWN=root GBINGRP=0 \
+		MANOWN=root MANGRP=0 INCOWN=root INCGRP=0 \
+		MSPQOWN=root CFOWN=root CFGRP=0 \
+		MILTER_SOVER=${PV} \
+		install -C obj.*/libmilter
+
+	dodoc libmilter/README
+	dodoc libmilter/docs/*
+}
-- 
cgit v1.2.3-65-gdbad