aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/bincimap/Makefile5
-rw-r--r--mail/bincimap/files/bincimapd.in41
2 files changed, 46 insertions, 0 deletions
diff --git a/mail/bincimap/Makefile b/mail/bincimap/Makefile
index d11b5c86a57e..fc945b2743c5 100644
--- a/mail/bincimap/Makefile
+++ b/mail/bincimap/Makefile
@@ -12,6 +12,7 @@
PORTNAME= bincimap
PORTVERSION= 1.2.13
+PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= http://www.bincimap.org/%SUBDIR%/ \
http://www.bincimap.andreas.hanssen.name/%SUBDIR%/ \
@@ -22,6 +23,10 @@ DISTNAME= ${PORTNAME}-${PORTVERSION}final
MAINTAINER= ports@FreeBSD.org
COMMENT= Light-weight IMAP server for Maildir
+RUN_DEPENDS= checkpassword-pam:${PORTSDIR}/security/checkpassword-pam \
+ tcpserver:${PORTSDIR}/sysutils/ucspi-tcp
+
+USE_RC_SUBR= bincimapd
USE_BZIP2= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --sysconfdir=${CONFDIR}
diff --git a/mail/bincimap/files/bincimapd.in b/mail/bincimap/files/bincimapd.in
new file mode 100644
index 000000000000..5b8e8a4c6f6e
--- /dev/null
+++ b/mail/bincimap/files/bincimapd.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Copyright 2007, AnyWi Technologies
+#
+# PROVIDE: bincimapd
+# REQUIRE: LOGIN cleanvar
+#
+# Note: tcpserver can be found in the sysutils/ucspi-tcp package.
+. /etc/rc.subr
+name="bincimapd"
+rcvar=`set_rcvar`
+load_rc_config $name
+: ${bincimapd_enable="NO"}
+: ${bincimapd_tcpserver="%%PREFIX%%/bin/tcpserver"}
+: ${bincimapd_tcpserver_flags="-R -H"}
+: ${bincimapd_host="0"}
+: ${bincimapd_port="imap"}
+: ${bincimapd_conf="%%PREFIX%%/etc/bincimap/bincimap.conf"}
+: ${bincimapd_pidfile="/var/run/bincimapd.pid"}
+: ${bincimapd_checkpassword="%%PREFIX%%/bin/checkpassword-pam"} # e.g. /usr/local/bin/checkpassword-pam
+: ${bincimapd_checksubprogram="/usr/bin/true"}
+
+bincimapd_start()
+{
+ echo -n "Starting bincimapd: "
+ $bincimapd_tcpserver $bincimapd_tcpserver_flags $bincimapd_host $bincimapd_port \
+ %%PREFIX%%/bin/bincimap-up --conf=$bincimapd_conf -- \
+ %%PREFIX%%/bin/checkpassword-pam -s imap -- %%PREFIX%%/bin/bincimapd &
+ echo $! > $bincimapd_pidfile
+ echo "."
+}
+
+bincimapd_stop()
+{
+ echo "Stopping bincimapd"
+ pkill -F $bincimapd_pidfile
+}
+
+start_cmd="bincimapd_start"
+stop_cmd="bincimapd_stop"
+run_rc_command "$1"