diff options
author | eadler <eadler@FreeBSD.org> | 2012-03-05 07:01:08 +0800 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2012-03-05 07:01:08 +0800 |
commit | 3cf97ae1b1e75f28b8e04b0573accae3a7152350 (patch) | |
tree | b98f90f1bfab6c7346bc0bec3c8d1bed6d23fde6 /mail/dma | |
parent | cd33622ca7c12997fe910820b64d93449fa50c94 (diff) | |
download | freebsd-ports-gnome-3cf97ae1b1e75f28b8e04b0573accae3a7152350.tar.gz freebsd-ports-gnome-3cf97ae1b1e75f28b8e04b0573accae3a7152350.tar.zst freebsd-ports-gnome-3cf97ae1b1e75f28b8e04b0573accae3a7152350.zip |
Update dma to 0.7
Also build and install the dma-mbox-create tool, which sets permissions and uid/gid on /var/mail files as needed by dma.
Changes:
Adds maasquerading support
PR: ports/165697
Submitted by: bz
Diffstat (limited to 'mail/dma')
-rw-r--r-- | mail/dma/Makefile | 58 | ||||
-rw-r--r-- | mail/dma/distinfo | 4 | ||||
-rw-r--r-- | mail/dma/files/patch-BSDMakefile | 30 | ||||
-rw-r--r-- | mail/dma/files/patch-Makefile | 6 | ||||
-rw-r--r-- | mail/dma/files/patch-aliases_scan.l | 22 | ||||
-rw-r--r-- | mail/dma/files/patch-conf.c | 11 | ||||
-rw-r--r-- | mail/dma/files/patch-crypto.c | 11 | ||||
-rw-r--r-- | mail/dma/files/patch-dma-Makefile | 17 | ||||
-rw-r--r-- | mail/dma/files/patch-dma-mbox-create-Makefile | 12 | ||||
-rw-r--r-- | mail/dma/files/patch-dma.c | 26 | ||||
-rw-r--r-- | mail/dma/files/patch-dma.conf | 11 | ||||
-rw-r--r-- | mail/dma/files/patch-dma.h | 15 | ||||
-rw-r--r-- | mail/dma/files/patch-mail.c | 22 | ||||
-rw-r--r-- | mail/dma/pkg-descr | 2 | ||||
-rw-r--r-- | mail/dma/pkg-plist | 3 |
15 files changed, 186 insertions, 64 deletions
diff --git a/mail/dma/Makefile b/mail/dma/Makefile index 43b6a5bd4be8..343c7605a99e 100644 --- a/mail/dma/Makefile +++ b/mail/dma/Makefile @@ -4,58 +4,70 @@ # # $FreeBSD$ # -# Based on git checkout from git://gitorious.org/dma/dma.git rather than -# from Dragonfly. +# Based on a tarball from https://github.com/corecode/dma/tarball/<version> +# rather than from Dragonfly. # -PORTNAME= dma -# commit f54b5114efc65d0e31c7b612bd59cc1b7c8cd8dc -PORTVERSION= 20101004 -PORTREVISION= 2 -CATEGORIES= mail ipv6 -MASTER_SITES= LOCAL/bz +PORTNAME= dma +PORTVERSION= v0.7 +PORTEPOCH= 1 +CATEGORIES= mail ipv6 +#MASTER_SITES= https://github.com/ # 302 temp move +MASTER_SITES= https://nodeload.github.com/${GITHUB_USER}/${PORTNAME}/tarball/ +DISTNAME= ${PORTVERSION} +EXTRACT_SUFX= +DIST_SUBDIR= ${PORTNAME} MAINTAINER= bz@FreeBSD.org COMMENT= DragonFly Mail Agent, a small MTA for local/outbound mail -USE_BZIP2= yes -USE_OPENSSL= yes LICENSE= BSD +LICENSE_FILE= ${WRKSRC}/LICENSE + +WRKSRC= ${WRKDIR}/${GITHUB_USER}-${PORTNAME}-${GITHUB_HASH} -WRKSRC= ${WRKDIR}/${PORTNAME} +USE_OPENSSL= yes MAN8= dma.8 -CFLAGS+= -I${OPENSSLINC} +GITHUB_HASH= db9a42b +GITHUB_USER= corecode + +CFLAGS+= -I${OPENSSLINC} \ + -DCONF_PATH='\"${PREFIX}/etc/dma\"' \ + -DDMA_ROOT_USER='\"mailnull\"' \ + -DDMA_GROUP='\"mail\"' LDFLAGS+= -L${OPENSSLLIB} USE_RC_SUBR= dma_flushq SUB_FILES= pkg-message +# Allow subports to extend. +CONFFILES+= dma.conf auth.conf + .include <bsd.port.pre.mk> -.if ${OSVERSION} <= 700000 -BROKEN= Does not build on 6.X -.endif +pre-patch: + @${MKDIR} ${WRKSRC}/dma ${WRKSRC}/dma-mbox-create + @${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.dist post-patch: @${REINPLACE_CMD} -e 's,/etc/dma,${PREFIX}/etc/dma,g' \ - ${WRKSRC}/dma.8 \ - ${WRKSRC}/dma.h + ${WRKSRC}/dma.8 @${REINPLACE_CMD} -e 's, /etc/dma, ${PREFIX}/etc/dma,g' \ ${WRKSRC}/dma.conf - @${MV} ${WRKSRC}/BSDmakefile ${WRKSRC}/Makefile do-install: - ${INSTALL} -o root -g mail -m 2555 ${WRKSRC}/dma ${PREFIX}/libexec + ${INSTALL} -o root -g mail -m 2555 ${WRKSRC}/dma/dma ${PREFIX}/libexec + ${INSTALL} -o root -g mail -m 4550 \ + ${WRKSRC}/dma-mbox-create/dma-mbox-create ${PREFIX}/libexec ${INSTALL_MAN} ${WRKSRC}/dma.8 ${PREFIX}/man/man8/ ${MKDIR} ${PREFIX}/etc/dma -.for i in dma.conf +.for i in ${CONFFILES} ${INSTALL_DATA} -m 0644 ${WRKSRC}/${i} ${PREFIX}/etc/dma/${i}.sample .endfor - ${INSTALL} -o root -g mail -m 0640 ${WRKSRC}/auth.conf \ - ${PREFIX}/etc/dma/auth.conf.sample -.for i in dma.conf auth.conf + ${CHMOD} o-r ${PREFIX}/etc/dma/auth.conf.sample +.for i in ${CONFFILES} if [ ! -f ${PREFIX}/etc/dma/${i} ]; then \ ${CP} -p ${PREFIX}/etc/dma/${i}.sample \ ${PREFIX}/etc/dma/${i} ; \ diff --git a/mail/dma/distinfo b/mail/dma/distinfo index f4f0d2a33fff..97081415c0b4 100644 --- a/mail/dma/distinfo +++ b/mail/dma/distinfo @@ -1,2 +1,2 @@ -SHA256 (dma-20101004.tar.bz2) = 32218152690bcb935526194c5f9c9b6475eb4f480e3f95e8ab71a72e27df9c51 -SIZE (dma-20101004.tar.bz2) = 24895 +SHA256 (dma/v0.7) = 56a84a2a00b89f1abe6761657036a553aa9f1e9b0826abbace13609aea545e50 +SIZE (dma/v0.7) = 43961 diff --git a/mail/dma/files/patch-BSDMakefile b/mail/dma/files/patch-BSDMakefile new file mode 100644 index 000000000000..686595d5bb67 --- /dev/null +++ b/mail/dma/files/patch-BSDMakefile @@ -0,0 +1,30 @@ +--- BSDmakefile.orig 2012-01-03 13:54:05.000000000 +0000 ++++ BSDmakefile 2012-01-28 20:47:09.000000000 +0000 +@@ -1,20 +1,12 @@ + # $DragonFly: src/libexec/dma/Makefile,v 1.5 2008/09/19 00:36:57 corecode Exp $ + # + +-version!= sh get-version.sh ++version!= (cd .. && sh get-version.sh) + +-CFLAGS+= -I${.CURDIR} ++CFLAGS+= -I${.CURDIR} -I${.CURDIR}/.. + CFLAGS+= -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME + CFLAGS+= -DLIBEXEC_PATH='"${LIBEXEC}"' -DDMA_VERSION='"${version}"' + +-DPADD= ${LIBSSL} ${LIBCRYPTO} +-LDADD= -lssl -lcrypto +- +-PROG= dma +-SRCS= aliases_parse.y aliases_scan.l base64.c conf.c crypto.c +-SRCS+= dma.c dns.c local.c mail.c net.c spool.c util.c +-MAN= dma.8 +- + PREFIX?= /usr/local + LIBEXEC?= ${PREFIX}/libexec + +@@ -23,4 +15,3 @@ BINGRP= mail + BINMODE=2555 + WARNS?= 6 + +-.include <bsd.prog.mk> diff --git a/mail/dma/files/patch-Makefile b/mail/dma/files/patch-Makefile new file mode 100644 index 000000000000..5e22504879b2 --- /dev/null +++ b/mail/dma/files/patch-Makefile @@ -0,0 +1,6 @@ +--- Makefile.orig 2012-01-28 20:35:32.000000000 +0000 ++++ Makefile 2012-01-28 20:31:56.000000000 +0000 +@@ -0,0 +1,3 @@ ++SUBDIR= dma dma-mbox-create ++ ++.include <bsd.subdir.mk> diff --git a/mail/dma/files/patch-aliases_scan.l b/mail/dma/files/patch-aliases_scan.l deleted file mode 100644 index 840e92cd41bc..000000000000 --- a/mail/dma/files/patch-aliases_scan.l +++ /dev/null @@ -1,22 +0,0 @@ ---- ./aliases_scan.l.orig 2010-10-04 21:03:33.000000000 +0200 -+++ ./aliases_scan.l 2010-12-26 22:03:33.000000000 +0000 -@@ -3,8 +3,6 @@ - #include <string.h> - #include "aliases_parse.h" - --#define YY_NO_INPUT -- - int yylex(void); - %} - -@@ -13,9 +11,9 @@ int yylex(void); - - %% - -+^([[:blank:]]*(#.*)?\n)+ ;/* ignore empty lines */ - [^:,#[:space:][:cntrl:]]+ {yylval.ident = strdup(yytext); return T_IDENT;} - [:,\n] return yytext[0]; --^([[:blank:]]*(#.*)?\n)+ ;/* ignore empty lines */ - (\n?[[:blank:]]+|#.*)+ ;/* ignore whitespace and continuation */ - \\\n ;/* ignore continuation. not allowed in comments */ - . return T_ERROR; diff --git a/mail/dma/files/patch-conf.c b/mail/dma/files/patch-conf.c new file mode 100644 index 000000000000..dd138781c82a --- /dev/null +++ b/mail/dma/files/patch-conf.c @@ -0,0 +1,11 @@ +--- ./conf.c.orig 2012-01-03 13:54:05.000000000 +0000 ++++ ./conf.c 2012-01-24 22:57:41.000000000 +0000 +@@ -121,7 +121,7 @@ + + au = calloc(1, sizeof(*au)); + if (au == NULL) +- errlog(1, NULL); ++ errlog(1, "calloc failed"); + + data = strdup(line); + au->login = strsep(&data, "|"); diff --git a/mail/dma/files/patch-crypto.c b/mail/dma/files/patch-crypto.c new file mode 100644 index 000000000000..b4fe877a54cd --- /dev/null +++ b/mail/dma/files/patch-crypto.c @@ -0,0 +1,11 @@ +--- ./crypto.c.orig 2012-01-03 13:54:05.000000000 +0000 ++++ ./crypto.c 2012-01-24 22:57:41.000000000 +0000 +@@ -80,7 +80,7 @@ + smtp_init_crypto(int fd, int feature) + { + SSL_CTX *ctx = NULL; +- const SSL_METHOD *meth = NULL; ++ SSL_METHOD *meth = NULL; + X509 *cert; + int error; + diff --git a/mail/dma/files/patch-dma-Makefile b/mail/dma/files/patch-dma-Makefile new file mode 100644 index 000000000000..06b0f213853c --- /dev/null +++ b/mail/dma/files/patch-dma-Makefile @@ -0,0 +1,17 @@ +--- dma/Makefile.orig 2012-01-28 20:33:55.000000000 +0000 ++++ dma/Makefile 2012-01-28 20:33:55.608531000 +0000 +@@ -0,0 +1,14 @@ ++# $FreeBSD$ ++ ++.PATH: ${.CURDIR} ${.CURDIR}/../ ++ ++PROG= dma ++SRCS= aliases_parse.y aliases_scan.l base64.c conf.c crypto.c ++SRCS+= dma.c dns.c local.c mail.c net.c spool.c util.c ++MAN= dma.8 ++ ++DPADD= ${LIBSSL} ${LIBCRYPTO} ++LDADD= -lssl -lcrypto ++ ++.include "../BSDmakefile" ++.include <bsd.prog.mk> diff --git a/mail/dma/files/patch-dma-mbox-create-Makefile b/mail/dma/files/patch-dma-mbox-create-Makefile new file mode 100644 index 000000000000..da43f7c0c74c --- /dev/null +++ b/mail/dma/files/patch-dma-mbox-create-Makefile @@ -0,0 +1,12 @@ +--- dma-mbox-create/Makefile.orig 2012-01-28 20:34:03.000000000 +0000 ++++ dma-mbox-create/Makefile 2012-01-28 20:33:27.000000000 +0000 +@@ -0,0 +1,9 @@ ++# $FreeBSD$ ++ ++.PATH: ${.CURDIR} ${.CURDIR}/../ ++ ++PROG= dma-mbox-create ++NO_MAN= ++ ++.include "../BSDmakefile" ++.include <bsd.prog.mk> diff --git a/mail/dma/files/patch-dma.c b/mail/dma/files/patch-dma.c index 0e31e14ebc50..7094c8e459ca 100644 --- a/mail/dma/files/patch-dma.c +++ b/mail/dma/files/patch-dma.c @@ -1,11 +1,29 @@ ---- ./dma.c.orig 2010-10-04 21:03:33.000000000 +0200 -+++ ./dma.c 2010-10-18 13:25:47.331077938 +0200 -@@ -293,7 +293,7 @@ +--- dma.c.orig 2012-01-28 22:36:55.000000000 +0000 ++++ dma.c 2012-01-28 22:46:06.000000000 +0000 +@@ -332,7 +332,7 @@ retry: exit(1); } if (gettimeofday(&now, NULL) == 0 && - (now.tv_sec - st.st_mtim.tv_sec > MAX_TIMEOUT)) { + (now.tv_sec - st.st_mtime > MAX_TIMEOUT)) { - asprintf(__DECONST(void *, &errmsg), + snprintf(errmsg, sizeof(errmsg), "Could not deliver for the last %d seconds. Giving up.", MAX_TIMEOUT); +@@ -534,7 +535,7 @@ main(int argc, char **argv) + skipopts: + if (logident_base == NULL) + logident_base = "dma"; +- setlogident(NULL); ++ setlogident(logident_base); + + act.sa_handler = sighup_handler; + act.sa_flags = 0; +@@ -571,7 +572,7 @@ skipopts: + errlog(1, "can not read aliases file `%s'", config.aliases); + + if ((sender = set_from(&queue, sender)) == NULL) +- errlog(1, NULL); ++ errlog(1, "set_from failed"); + + if (newspoolf(&queue) != 0) + errlog(1, "can not create temp file"); diff --git a/mail/dma/files/patch-dma.conf b/mail/dma/files/patch-dma.conf new file mode 100644 index 000000000000..d7130bda7747 --- /dev/null +++ b/mail/dma/files/patch-dma.conf @@ -0,0 +1,11 @@ +--- ./dma.conf.orig 2012-01-24 22:57:52.000000000 +0000 ++++ ./dma.conf 2012-01-24 22:58:08.000000000 +0000 +@@ -2,8 +2,6 @@ + # + # Your smarthost (also called relayhost). Leave blank if you don't want + # smarthost support. +-# NOTE: on Debian systems this is handled via debconf! +-# Please use dpkg-reconfigure dma to change this value. + #SMARTHOST + + # Use this SMTP port. Most users will be fine with the default (25) diff --git a/mail/dma/files/patch-dma.h b/mail/dma/files/patch-dma.h new file mode 100644 index 000000000000..e382147110e0 --- /dev/null +++ b/mail/dma/files/patch-dma.h @@ -0,0 +1,15 @@ +--- dma.h.orig 2012-01-03 13:54:05.000000000 +0000 ++++ dma.h 2012-01-28 11:02:57.000000000 +0000 +@@ -74,8 +75,12 @@ + #error Please define LIBEXEC_PATH + #endif + ++#ifndef DMA_ROOT_USER + #define DMA_ROOT_USER "mail" ++#endif ++#ifndef DMA_GROUP + #define DMA_GROUP "mail" ++#endif + + #ifndef MBOX_STRICT + #define MBOX_STRICT 0 diff --git a/mail/dma/files/patch-mail.c b/mail/dma/files/patch-mail.c index 1c43e7f575fc..e479d6d4352b 100644 --- a/mail/dma/files/patch-mail.c +++ b/mail/dma/files/patch-mail.c @@ -1,11 +1,11 @@ ---- ./mail.c.orig 2010-10-04 21:03:33.000000000 +0200 -+++ ./mail.c 2010-10-18 13:34:03.222470911 +0200 -@@ -415,7 +415,7 @@ - snprintf(line, sizeof(line), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n", - (uintmax_t)time(NULL), - queue->id, -- random(), -+ (uintmax_t)random(), - hostname()); - } else if (!had_from) { - had_from = 1; +--- ./mail.c.orig 2012-01-03 13:54:05.000000000 +0000 ++++ ./mail.c 2012-01-24 22:57:41.000000000 +0000 +@@ -332,7 +332,7 @@ + ps->pos = 0; + addr = strdup(ps->addr); + if (addr == NULL) +- errlog(1, NULL); ++ errlog(1, "strdup failed"); + + if (add_recp(queue, addr, EXPAND_WILDCARD) != 0) + errlogx(1, "invalid recipient `%s'", addr); diff --git a/mail/dma/pkg-descr b/mail/dma/pkg-descr index 2619aece09d0..946d62d33933 100644 --- a/mail/dma/pkg-descr +++ b/mail/dma/pkg-descr @@ -13,4 +13,4 @@ Since dma is not intended as a replacement for real, big MTAs like sendmail(8) or postfix(1), it does not listen on port 25 for incoming connections. -WWW: http://gitorious.org/dma +WWW: https://github.com/corecode/dma diff --git a/mail/dma/pkg-plist b/mail/dma/pkg-plist index 377e1f4b645a..f9d4fa1cdd15 100644 --- a/mail/dma/pkg-plist +++ b/mail/dma/pkg-plist @@ -1,4 +1,5 @@ libexec/dma +libexec/dma-mbox-create @unexec if cmp -s %D/etc/dma/dma.conf.sample %D/etc/dma/dma.conf; then rm -f %D/etc/dma/dma.conf; fi etc/dma/dma.conf.sample @exec if [ ! -f %B/dma.conf ] ; then cp -p %B/%f %B/dma.conf; fi @@ -7,4 +8,4 @@ etc/dma/auth.conf.sample @exec if [ ! -f %B/auth.conf ] ; then cp -p %B/%f %B/auth.conf; fi @dirrmtry etc/dma @exec install -d -o root -g mail -m 770 /var/spool/dma -@dirrmtry /var/spool/dma +@dirrmtry rmdir /var/spool/dma |