aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/Makefile1
-rw-r--r--mail/opensmtpd-devel/Makefile94
-rw-r--r--mail/opensmtpd-devel/distinfo2
-rw-r--r--mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in18
-rw-r--r--mail/opensmtpd-devel/files/patch-smtpd_backends_table__mysql.c13
-rw-r--r--mail/opensmtpd-devel/files/patch-smtpd_backends_table__postgres.c20
-rw-r--r--mail/opensmtpd-devel/files/patch-smtpd_backends_table__sqlite.c13
-rw-r--r--mail/opensmtpd-devel/files/pkg-deinstall.in14
-rw-r--r--mail/opensmtpd-devel/files/pkg-install.in17
-rw-r--r--mail/opensmtpd-devel/files/smtpd.in35
-rw-r--r--mail/opensmtpd-devel/pkg-descr8
-rw-r--r--mail/opensmtpd-devel/pkg-plist24
12 files changed, 259 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile
index 9669f77fd944..dab456cb9b58 100644
--- a/mail/Makefile
+++ b/mail/Makefile
@@ -317,6 +317,7 @@
SUBDIR += opendkim
SUBDIR += opendmarc
SUBDIR += opensmtpd
+ SUBDIR += opensmtpd-devel
SUBDIR += openwebmail
SUBDIR += osbf-lua
SUBDIR += ovs
diff --git a/mail/opensmtpd-devel/Makefile b/mail/opensmtpd-devel/Makefile
new file mode 100644
index 000000000000..d8d445045755
--- /dev/null
+++ b/mail/opensmtpd-devel/Makefile
@@ -0,0 +1,94 @@
+# Created by: Ashish SHUKLA <ashish@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= opensmtpd
+PORTVERSION= 201306271531
+CATEGORIES= mail
+MASTER_SITES= http://www.opensmtpd.org/archives/ \
+ http://distfiles.pirateparty.in/ashish/
+PKGNAMESUFFIX= -devel
+DISTNAME= ${PORTNAME}-${PORTVERSION}p1
+
+MAINTAINER= ashish@FreeBSD.org
+COMMENT= OpenSMTPD is a free MTA (development snapshot)
+
+LICENSE= ISCL
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= event-1:${PORTSDIR}/devel/libevent
+
+OPENSMTPD_SNAPSHOT_VER= p1
+
+OPTIONS_DEFINE= PAM SQLITE MYSQL PGSQL LDAP
+
+OPTIONS_DEFAULT= PAM
+
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --with-libevent-dir=${LOCALBASE} --sysconfdir=${PREFIX}/etc/mail/
+
+USE_RC_SUBR= smtpd
+SUB_FILES= pkg-install pkg-deinstall
+
+CONFLICTS_INSTALL= postfix-[0-9]* sendmail-[0-9]* opensmtpd-[0-9]*
+
+MAN8= makemap.8 newaliases.8 smtpctl.8 smtpd.8
+MAN5= smtpd.conf.5 aliases.5 forward.5
+
+USERS= _smtpd _smtpq
+GROUPS= _smtpd
+
+.include <bsd.port.options.mk>
+
+USE_OPENSSL= yes
+
+.if ${PORT_OPTIONS:MMYSQL}
+USE_MYSQL= yes
+CFLAGS+= -I${LOCALBASE}/include/mysql
+LDFLAGS+= -L${LOCALBASE}/lib/mysql
+CONFIGURE_ARGS+= --with-experimental-mysql
+PLIST_SUB+= MYSQL=""
+.else
+PLIST_SUB+= MYSQL="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MSQLITE}
+USE_SQLITE= 3
+CONFIGURE_ARGS+= --with-experimental-sqlite
+PLIST_SUB+= SQLITE=""
+CFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+.else
+PLIST_SUB+= SQLITE="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MPGSQL}
+USE_PGSQL= yes
+CONFIGURE_ARGS+= --with-experimental-postgres
+PLIST_SUB+= PGSQL=""
+.else
+PLIST_SUB+= PGSQL="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MLDAP}
+CONFIGURE_ARGS+= --with-experimental-ldap
+PLIST_SUB+= LDAP=""
+.else
+PLIST_SUB+= LDAP="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MPAM}
+CONFIGURE_ARGS+= --with-pam
+.endif
+
+# FreeBSD 7.3 and earlier need to use OpenSSL from ports
+.if ${OSVERSION} < 704000
+WITH_OPENSSL_PORT= yes
+.endif
+
+post-install:
+ @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
+post-deinstall:
+ @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-DEINSTALL
+
+.include <bsd.port.mk>
diff --git a/mail/opensmtpd-devel/distinfo b/mail/opensmtpd-devel/distinfo
new file mode 100644
index 000000000000..08bc56d35b4f
--- /dev/null
+++ b/mail/opensmtpd-devel/distinfo
@@ -0,0 +1,2 @@
+SHA256 (opensmtpd-201306271531p1.tar.gz) = 4c831a87b0d6834410b01a0ef13adeca9539391b341b50648aca1a53f6df062c
+SIZE (opensmtpd-201306271531p1.tar.gz) = 771055
diff --git a/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in b/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in
new file mode 100644
index 000000000000..8c3c1b4a8a26
--- /dev/null
+++ b/mail/opensmtpd-devel/files/patch-mk_smtpd_Makefile.in
@@ -0,0 +1,18 @@
+
+$FreeBSD$
+
+--- mk/smtpd/Makefile.in.orig
++++ mk/smtpd/Makefile.in
+@@ -1837,11 +1837,7 @@
+ $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
+ $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
+
+- @if [ ! -f $(DESTDIR)$(sysconfdir)/smtpd.conf ]; then \
+- $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf; \
+- else \
+- echo "$(DESTDIR)$(sysconfdir)/smtpd.conf already exists, install will not overwrite"; \
+- fi
++ $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf.sample
+
+ $(INSTALL) -m 644 aliases.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/aliases.5
+ $(INSTALL) -m 644 forward.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/forward.5
diff --git a/mail/opensmtpd-devel/files/patch-smtpd_backends_table__mysql.c b/mail/opensmtpd-devel/files/patch-smtpd_backends_table__mysql.c
new file mode 100644
index 000000000000..58c253dbbe7f
--- /dev/null
+++ b/mail/opensmtpd-devel/files/patch-smtpd_backends_table__mysql.c
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- smtpd/backends/table_mysql.c.orig
++++ smtpd/backends/table_mysql.c
+@@ -22,6 +22,7 @@
+
+ #include <ctype.h>
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/mail/opensmtpd-devel/files/patch-smtpd_backends_table__postgres.c b/mail/opensmtpd-devel/files/patch-smtpd_backends_table__postgres.c
new file mode 100644
index 000000000000..83802263c28e
--- /dev/null
+++ b/mail/opensmtpd-devel/files/patch-smtpd_backends_table__postgres.c
@@ -0,0 +1,20 @@
+
+$FreeBSD$
+
+--- smtpd/backends/table_postgres.c.orig
++++ smtpd/backends/table_postgres.c
+@@ -22,12 +22,13 @@
+
+ #include <ctype.h>
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
+
+-#include <postgresql/libpq-fe.h>
++#include <libpq-fe.h>
+
+ #include "smtpd-defines.h"
+ #include "smtpd-api.h"
diff --git a/mail/opensmtpd-devel/files/patch-smtpd_backends_table__sqlite.c b/mail/opensmtpd-devel/files/patch-smtpd_backends_table__sqlite.c
new file mode 100644
index 000000000000..24a2ec4c3c62
--- /dev/null
+++ b/mail/opensmtpd-devel/files/patch-smtpd_backends_table__sqlite.c
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- smtpd/backends/table_sqlite.c.orig
++++ smtpd/backends/table_sqlite.c
+@@ -22,6 +22,7 @@
+
+ #include <ctype.h>
+ #include <fcntl.h>
++#include <getopt.h>
+ #include <sqlite3.h>
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/mail/opensmtpd-devel/files/pkg-deinstall.in b/mail/opensmtpd-devel/files/pkg-deinstall.in
new file mode 100644
index 000000000000..3c939c99eee1
--- /dev/null
+++ b/mail/opensmtpd-devel/files/pkg-deinstall.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+PKGNAME=$1
+TARGET=$2
+
+PREFIX=$(echo %%PREFIX%% |sed -e 's,/,\\/,g')
+
+if [ "$TARGET" = POST-DEINSTALL ]; then
+ sed -e '/[[:space:]]'$PREFIX'\/sbin\/smtpctl/d' \
+ -e '/[[:space:]]'$PREFIX'\/libexec\/opensmtpd\/makemap/d' \
+ -e 's/^### smtpd: //g' -i '' /etc/mail/mailer.conf
+fi
+
+exit 0
diff --git a/mail/opensmtpd-devel/files/pkg-install.in b/mail/opensmtpd-devel/files/pkg-install.in
new file mode 100644
index 000000000000..899ad234742e
--- /dev/null
+++ b/mail/opensmtpd-devel/files/pkg-install.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+PKGNAME=$1
+TARGET=$2
+
+if [ "$TARGET" = POST-INSTALL ]; then
+ sed -e '/^[^#]/s/^/### smtpd: /g' -i '' /etc/mail/mailer.conf
+ cat >>/etc/mail/mailer.conf <<EOF
+sendmail %%PREFIX%%/sbin/smtpctl
+send-mail %%PREFIX%%/sbin/smtpctl
+mailq %%PREFIX%%/sbin/smtpctl
+makemap %%PREFIX%%/libexec/opensmtpd/makemap
+newaliases %%PREFIX%%/libexec/opensmtpd/makemap
+EOF
+fi
+
+exit 0
diff --git a/mail/opensmtpd-devel/files/smtpd.in b/mail/opensmtpd-devel/files/smtpd.in
new file mode 100644
index 000000000000..a471c06b7090
--- /dev/null
+++ b/mail/opensmtpd-devel/files/smtpd.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: smtpd mail
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable smtpd:
+# smtpd_enable (bool): Set it to "YES" to enable postfix.
+# Default is "NO".
+# smtpd_config (string): Path to OpenSMTPD configuration file.
+# Default is "%%PREFIX%%/etc/mail/smtpd.conf"
+# smtpd_flags (string): Additional flags to be passed to smtpd.
+# Default is "".
+#
+#
+
+. /etc/rc.subr
+
+name="smtpd"
+rcvar=smtpd_enable
+
+load_rc_config $name
+
+: ${smtpd_enable:="NO"}
+: ${smtpd_config:="%%PREFIX%%/etc/mail/smtpd.conf"}
+: ${smtpd_procname:="%%PREFIX%%/sbin/smtpd"}
+: ${smtpd_flags:=""}
+
+command=${smtpd_procname}
+
+procname=${smtpd_procname}
+
+run_rc_command "$1"
diff --git a/mail/opensmtpd-devel/pkg-descr b/mail/opensmtpd-devel/pkg-descr
new file mode 100644
index 000000000000..0c38e93edb98
--- /dev/null
+++ b/mail/opensmtpd-devel/pkg-descr
@@ -0,0 +1,8 @@
+OpenSMTPD is a FREE implementation of the server-side SMTP protocol as
+defined by RFC 5321, with some additional standard extensions. It
+allows ordinary machines to exchange e-mails with other systems
+speaking the SMTP protocol.
+
+This port packages the development snapshots released by OpenSMTPD team.
+
+WWW: http://www.OpenSMTPD.org/
diff --git a/mail/opensmtpd-devel/pkg-plist b/mail/opensmtpd-devel/pkg-plist
new file mode 100644
index 000000000000..a764b2ccbd59
--- /dev/null
+++ b/mail/opensmtpd-devel/pkg-plist
@@ -0,0 +1,24 @@
+bin/mailq
+bin/newaliases
+etc/mail/smtpd.conf.sample
+libexec/mail.local
+libexec/opensmtpd/makemap
+libexec/opensmtpd/backend-queue-null
+libexec/opensmtpd/backend-queue-ram
+libexec/opensmtpd/backend-queue-stub
+libexec/opensmtpd/backend-table-stub
+%%MYSQL%%libexec/opensmtpd/backend-table-mysql
+%%SQLITE%%libexec/opensmtpd/backend-table-sqlite
+%%LDAP%%libexec/opensmtpd/backend-table-ldap
+%%PGSQL%%libexec/opensmtpd/backend-table-postgres
+libexec/opensmtpd/backend-scheduler-ram
+libexec/opensmtpd/backend-scheduler-stub
+libexec/opensmtpd/filter-dnsbl
+libexec/opensmtpd/filter-monkey
+libexec/opensmtpd/filter-stub
+libexec/opensmtpd/filter-trace
+sbin/makemap
+sbin/smtpctl
+sbin/smtpd
+@dirrm libexec/opensmtpd
+@dirrmtry etc/mail