mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
libmilter: import as clamav's new makedepends
This commit is contained in:
parent
9d3810a136
commit
19d2326339
52
libmilter/PKGBUILD
Normal file
52
libmilter/PKGBUILD
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# $Id$
|
||||||
|
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
|
||||||
|
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
|
||||||
|
# Contributor: mutantmonkey <mutantmonkey@gmail.com>
|
||||||
|
|
||||||
|
pkgname=libmilter
|
||||||
|
_pkgname=sendmail
|
||||||
|
pkgver=8.15.2
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='Implementation of the sendmail Mail Filter API'
|
||||||
|
url='https://www.proofpoint.com/us/sendmail-open-source'
|
||||||
|
arch=('x86_64')
|
||||||
|
options=('staticlibs')
|
||||||
|
license=('custom:Sendmail open source license')
|
||||||
|
validpgpkeys=('30BCA74705FA415455731D7BAAF5B5DE05BDCC53')
|
||||||
|
source=("http://ftp.sendmail.org/${_pkgname}.${pkgver}.tar.gz"{,.sig}
|
||||||
|
'fd-passing-libmilter.patch')
|
||||||
|
sha256sums=('24f94b5fd76705f15897a78932a5f2439a32b1a2fdc35769bb1a5f5d9b4db439'
|
||||||
|
'SKIP'
|
||||||
|
'b856ebc17e39151652bda93f40f79756ac83eb4a0b67e6d55c049f3ebde42983')
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "${srcdir}/${_pkgname}-${pkgver}"
|
||||||
|
patch -p1 -i ../fd-passing-libmilter.patch # FS#49421
|
||||||
|
|
||||||
|
# From http://www.j-chkmail.org/wiki/doku.php/doc/installation/start#libmilter
|
||||||
|
cat >> devtools/Site/site.config.m4 <<EOF
|
||||||
|
dnl Include our flags
|
||||||
|
APPENDDEF(\`conf_libmilter_ENVDEF',\`${CPPFLAGS} ${CFLAGS}')
|
||||||
|
dnl Enable libmilter with a pool of workers
|
||||||
|
APPENDDEF(\`conf_libmilter_ENVDEF',\`-D_FFR_WORKERS_POOL=1 -DMIN_WORKERS=4')
|
||||||
|
dnl Use poll instead of select
|
||||||
|
APPENDDEF(\`conf_libmilter_ENVDEF',\`-DSM_CONF_POLL=1')
|
||||||
|
dnl Enable IPv6
|
||||||
|
APPENDDEF(\`conf_libmilter_ENVDEF',\`-DNETINET6=1')
|
||||||
|
dnl Add -fPIC
|
||||||
|
APPENDDEF(\`conf_libmilter_ENVDEF',\`-fPIC')
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}/${_pkgname}-${pkgver}/${pkgname}"
|
||||||
|
./Build
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "${srcdir}/${_pkgname}-${pkgver}/${pkgname}"
|
||||||
|
install -d "${pkgdir}/usr/lib"
|
||||||
|
./Build DESTDIR="${pkgdir}" install
|
||||||
|
install -Dm644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||||
|
chown -R root:root "${pkgdir}"
|
||||||
|
}
|
80
libmilter/fd-passing-libmilter.patch
Normal file
80
libmilter/fd-passing-libmilter.patch
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
Description: systemd-like socket activation support for libmilter
|
||||||
|
Author: Mikhail Gusarov <dottedmag@debian.org
|
||||||
|
diff --git a/libmilter/docs/smfi_setconn.html b/libmilter/docs/smfi_setconn.html
|
||||||
|
index 70a510e..013f04e 100644
|
||||||
|
--- a/libmilter/docs/smfi_setconn.html
|
||||||
|
+++ b/libmilter/docs/smfi_setconn.html
|
||||||
|
@@ -43,6 +43,7 @@ Set the socket through which this filter should communicate with sendmail.
|
||||||
|
<LI><CODE>{unix|local}:/path/to/file</CODE> -- A named pipe.
|
||||||
|
<LI><CODE>inet:port@{hostname|ip-address}</CODE> -- An IPV4 socket.
|
||||||
|
<LI><CODE>inet6:port@{hostname|ip-address}</CODE> -- An IPV6 socket.
|
||||||
|
+ <LI><CODE>fd:number</CODE> -- Pre-opened file descriptor.
|
||||||
|
</UL>
|
||||||
|
</TD></TR>
|
||||||
|
</TABLE>
|
||||||
|
diff --git a/libmilter/listener.c b/libmilter/listener.c
|
||||||
|
index 48c552f..2249a1f 100644
|
||||||
|
--- a/libmilter/listener.c
|
||||||
|
+++ b/libmilter/listener.c
|
||||||
|
@@ -197,6 +197,11 @@ mi_milteropen(conn, backlog, rmsocket, name)
|
||||||
|
L_socksize = sizeof addr.sin6;
|
||||||
|
}
|
||||||
|
#endif /* NETINET6 */
|
||||||
|
+ else if (strcasecmp(p, "fd") == 0)
|
||||||
|
+ {
|
||||||
|
+ addr.sa.sa_family = AF_UNSPEC;
|
||||||
|
+ L_socksize = sizeof (_SOCK_ADDR);
|
||||||
|
+ }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
smi_log(SMI_LOG_ERR, "%s: unknown socket type %s",
|
||||||
|
@@ -443,7 +448,21 @@ mi_milteropen(conn, backlog, rmsocket, name)
|
||||||
|
}
|
||||||
|
#endif /* NETINET || NETINET6 */
|
||||||
|
|
||||||
|
- sock = socket(addr.sa.sa_family, SOCK_STREAM, 0);
|
||||||
|
+ if (addr.sa.sa_family == AF_UNSPEC)
|
||||||
|
+ {
|
||||||
|
+ char *end;
|
||||||
|
+ sock = strtol(colon, &end, 10);
|
||||||
|
+ if (*end != '\0' || sock < 0)
|
||||||
|
+ {
|
||||||
|
+ smi_log(SMI_LOG_ERR, "%s: expected positive integer as fd, got %s", name, colon);
|
||||||
|
+ return INVALID_SOCKET;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ sock = socket(addr.sa.sa_family, SOCK_STREAM, 0);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (!ValidSocket(sock))
|
||||||
|
{
|
||||||
|
smi_log(SMI_LOG_ERR,
|
||||||
|
@@ -466,6 +485,7 @@ mi_milteropen(conn, backlog, rmsocket, name)
|
||||||
|
#if NETUNIX
|
||||||
|
addr.sa.sa_family != AF_UNIX &&
|
||||||
|
#endif /* NETUNIX */
|
||||||
|
+ addr.sa.sa_family != AF_UNSPEC &&
|
||||||
|
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt,
|
||||||
|
sizeof(sockopt)) == -1)
|
||||||
|
{
|
||||||
|
@@ -511,7 +531,8 @@ mi_milteropen(conn, backlog, rmsocket, name)
|
||||||
|
}
|
||||||
|
#endif /* NETUNIX */
|
||||||
|
|
||||||
|
- if (bind(sock, &addr.sa, L_socksize) < 0)
|
||||||
|
+ if (addr.sa.sa_family != AF_UNSPEC &&
|
||||||
|
+ bind(sock, &addr.sa, L_socksize) < 0)
|
||||||
|
{
|
||||||
|
smi_log(SMI_LOG_ERR,
|
||||||
|
"%s: Unable to bind to port %s: %s",
|
||||||
|
@@ -817,7 +838,7 @@ mi_listener(conn, dbg, smfi, timeout, backlog)
|
||||||
|
# ifdef BSD4_4_SOCKADDR
|
||||||
|
cliaddr.sa.sa_len == 0 ||
|
||||||
|
# endif /* BSD4_4_SOCKADDR */
|
||||||
|
- cliaddr.sa.sa_family != L_family))
|
||||||
|
+ (L_family != AF_UNSPEC && cliaddr.sa.sa_family != L_family)))
|
||||||
|
{
|
||||||
|
(void) closesocket(connfd);
|
||||||
|
connfd = INVALID_SOCKET;
|
Loading…
Reference in New Issue
Block a user