aboutsummaryrefslogtreecommitdiff
path: root/mail/tpop3d
diff options
context:
space:
mode:
Diffstat (limited to 'mail/tpop3d')
-rw-r--r--mail/tpop3d/Makefile41
-rw-r--r--mail/tpop3d/files/tpop3d.sh.in41
-rw-r--r--mail/tpop3d/files/tpop3d.sh.sample45
-rw-r--r--mail/tpop3d/pkg-plist12
4 files changed, 70 insertions, 69 deletions
diff --git a/mail/tpop3d/Makefile b/mail/tpop3d/Makefile
index 35a09e12972b..9427970fb872 100644
--- a/mail/tpop3d/Makefile
+++ b/mail/tpop3d/Makefile
@@ -12,7 +12,7 @@ CATEGORIES= mail
MASTER_SITES= http://www.ex-parrot.com/~chris/tpop3d/
MAINTAINER= chris@shagged.org
-COMMENT= Virtual-domain capable POP3 server supporting MySQL auth
+COMMENT= Virtual-domain capable POP3 server supporting MySQL,PgSQL etc auth
USE_OPENSSL= yes
USE_REINPLACE= yes
@@ -23,37 +23,58 @@ CONFIGURE_ARGS= --enable-auth-other \
--with-mailspool-directory=/var/mail
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+OPTIONS= MYSQL "Use MySQL authentication" off \
+ PGSQL "Use PgSQL authentication" off \
+ LDAP "Use LDAP authentication" off \
+ PERLAUTH "Use Perl authentication" off \
+ FLATAUTH "Enable /etc/passwd-style authentication" off \
+ MAILDIR "Compile Maildir support" on
+
# MySQL authentication
-.if !defined(WITHOUT_MYSQL)
+.if defined(WITH_MYSQL) && !defined(WITHOUT_MYSQL)
USE_MYSQL= yes
+DEFAULT_MYSQL_VER= 41
CONFIGURE_ARGS+= --enable-auth-mysql \
--with-mysql-lib-dir=${LOCALBASE}/lib/mysql \
--with-mysql-include-dir=${LOCALBASE}/include/mysql
.endif
-.if defined(WITH_LDAP)
+.if defined(WITH_PGSQL) && !defined(WITHOUT_PGSQL)
+USE_PGSQL= yes
+DEFAULT_PGSQL_VER= 80
+CONFIGURE_ARGS+= --enable-auth-pgsql \
+ --with-pgsql-lib-dir=${LOCALBASE}/lib \
+ --with-pgsql-include-dir=${LOCALBASE}/include
+.endif
+
+.if defined(WITH_LDAP) && !defined(WITHOUT_LDAP)
LIB_DEPENDS+= ldap-2.2:${PORTSDIR}/net/openldap22-client
CONFIGURE_ARGS+= --enable-auth-ldap --with-openldap-root=${LOCALBASE}
.endif
# Perl authentication
-.if defined(WITH_PERLAUTH)
+.if defined(WITH_PERLAUTH) && !defined(WITHOUT_PERLAUTH)
USE_PERL5= yes
CONFIGURE_ARGS+= --enable-auth-perl
.endif
+.if defined(WITH_FLATAUTH) && !defined(WITHOUT_FLATAUTH)
+CONFIGURE_ARGS+= --enable-auth-flatfile
+.endif
+
.if !defined(WITHOUT_MAILDIR)
CONFIGURE_ARGS+= --enable-mbox-maildir
.endif
-SAMPLE_RCD= tpop3d.sh.sample
-STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/${SAMPLE_RCD}
+USE_RC_SUBR= tpop3d.sh
DEFAULT_CONFIG= ${PREFIX}/etc/tpop3d.conf.dist
MAN5= tpop3d.conf.5
MAN8= tpop3d.8
-DOCS= CHANGES CREDITS FAQ HACKING INSTALL PORTABILITY \
+.if !defined(NOPORTDOCS)
+PORTDOCS= CHANGES CREDITS FAQ HACKING INSTALL PORTABILITY \
README README.POP-before-SMTP README.auth_mysql TODO
+.endif
post-patch:
@${REINPLACE_CMD} 's,^CFLAGS =, CFLAGS = \@CFLAGS\@,' \
@@ -63,17 +84,13 @@ post-patch:
post-install:
${INSTALL_SCRIPT} ${FILESDIR}/tpop3d.conf.dist ${DEFAULT_CONFIG}
- @if [ ! -f ${STARTUP_SCRIPT} ]; then \
- ${INSTALL_SCRIPT} ${FILESDIR}/${SAMPLE_RCD} \
- ${STARTUP_SCRIPT} ; \
- fi
@if [ ! -f ${PREFIX}/etc/tpop3d.conf ]; then \
${INSTALL_SCRIPT} ${FILESDIR}/tpop3d.conf.dist \
${PREFIX}/etc/tpop3d.conf ; \
fi
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
- cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
.include <bsd.port.mk>
diff --git a/mail/tpop3d/files/tpop3d.sh.in b/mail/tpop3d/files/tpop3d.sh.in
new file mode 100644
index 000000000000..449eacd2d133
--- /dev/null
+++ b/mail/tpop3d/files/tpop3d.sh.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+
+# PROVIDE: tpop3d
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD
+
+#
+# Add the following line to /etc/rc.conf to enable tpop3d:
+#tpop3d_enable="YES"
+#
+# You may also wish to use the following variables to fine-tune startup:
+#tpop3d_flags="..."
+#
+
+. %%RC_SUBR%%
+
+name="tpop3d"
+rcvar=`set_rcvar`
+
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+ rm -f $pidfile
+}
+
+# set defaults
+
+tpop3d_enable=${tpop3d_enable:-"NO"}
+tpop3d_flags=${tpop3d_flags:-""}
+load_rc_config $name
+
+command=%%PREFIX%%/sbin/tpop3d
+required_files=%%PREFIX%%/tpop3d.conf
+pidfile=/var/run/tpop3d.pid
+
+tpop3d_flags="${tpop3d_flags} -f ${required_files} -p ${pidfile}"
+
+run_rc_command "$1"
diff --git a/mail/tpop3d/files/tpop3d.sh.sample b/mail/tpop3d/files/tpop3d.sh.sample
deleted file mode 100644
index 97dbd2514da1..000000000000
--- a/mail/tpop3d/files/tpop3d.sh.sample
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-#
-# tpop3d:
-# Init script for starting/stopping tpop3d.
-#
-# Copyright (c) 2001 Chris Lightfoot. All rights reserved.
-# Portability enhanced by Chris Elsworth, July 2001
-#
-# $FreeBSD$
-#
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-DAEMON=$PREFIX/sbin/tpop3d
-
-[ -f $DAEMON ] || exit 0
-
-# See how we were called.
-case "$1" in
- start)
- # Start daemons.
- $DAEMON -f $PREFIX/etc/tpop3d.conf -p /var/run/tpop3d.pid \
- && echo -n " tpop3d"
- ;;
- stop)
- # Stop daemons.
- [ -r /var/run/tpop3d.pid ] && kill `cat /var/run/tpop3d.pid` \
- && echo -n " tpop3d"
- ;;
- restart)
- $0 stop
- $0 start
- ;;
- reload)
- [ -r /var/run/tpop3d.pid ] && kill -HUP `cat /var/run/tpop3d.pid`
- ;;
- *)
- echo "Usage: `basename $0` {start|stop|restart|reload}"
- exit 1
-esac
-
-exit 0
diff --git a/mail/tpop3d/pkg-plist b/mail/tpop3d/pkg-plist
index 7e95fe4816f7..4ad9235cd3ee 100644
--- a/mail/tpop3d/pkg-plist
+++ b/mail/tpop3d/pkg-plist
@@ -1,17 +1,5 @@
@comment $FreeBSD$
sbin/tpop3d
-etc/rc.d/tpop3d.sh.sample
@unexec if cmp -s %D/etc/tpop3d.conf.dist %D/etc/tpop3d.conf; then rm -f %D/etc/tpop3d.conf; fi
etc/tpop3d.conf.dist
@exec if [ ! -f %D/etc/tpop3d.conf ]; then cp %D/etc/%f %D/etc/tpop3d.conf; fi
-%%PORTDOCS%%%%DOCSDIR%%/CHANGES
-%%PORTDOCS%%%%DOCSDIR%%/CREDITS
-%%PORTDOCS%%%%DOCSDIR%%/FAQ
-%%PORTDOCS%%%%DOCSDIR%%/HACKING
-%%PORTDOCS%%%%DOCSDIR%%/INSTALL
-%%PORTDOCS%%%%DOCSDIR%%/PORTABILITY
-%%PORTDOCS%%%%DOCSDIR%%/README
-%%PORTDOCS%%%%DOCSDIR%%/README.POP-before-SMTP
-%%PORTDOCS%%%%DOCSDIR%%/README.auth_mysql
-%%PORTDOCS%%%%DOCSDIR%%/TODO
-%%PORTDOCS%%@dirrm %%DOCSDIR%%