aboutsummaryrefslogtreecommitdiffstats
path: root/mail/cyrus-imapd2
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-08-30 22:17:22 +0800
committerume <ume@FreeBSD.org>2003-08-30 22:17:22 +0800
commit0f4361bb3af7fed1bae314a01303b7c62da0e3e8 (patch)
tree2df1804e498b3523e473065a864d2cd21d2a5799 /mail/cyrus-imapd2
parent0458f8bef0d095a79d66ca4c78e56175ea6848cf (diff)
downloadfreebsd-ports-gnome-0f4361bb3af7fed1bae314a01303b7c62da0e3e8.tar.gz
freebsd-ports-gnome-0f4361bb3af7fed1bae314a01303b7c62da0e3e8.tar.zst
freebsd-ports-gnome-0f4361bb3af7fed1bae314a01303b7c62da0e3e8.zip
Use USE_RC_SUBR.
Diffstat (limited to 'mail/cyrus-imapd2')
-rw-r--r--mail/cyrus-imapd2/Makefile2
-rw-r--r--mail/cyrus-imapd2/files/imapd.sh51
2 files changed, 33 insertions, 20 deletions
diff --git a/mail/cyrus-imapd2/Makefile b/mail/cyrus-imapd2/Makefile
index 93316243cdc1..20f1065af07e 100644
--- a/mail/cyrus-imapd2/Makefile
+++ b/mail/cyrus-imapd2/Makefile
@@ -24,6 +24,8 @@ CONFLICTS= cyrus-1.* cyrus-imapd-2.[^1].*
LIB_DEPENDS= sasl2.2:${PORTSDIR}/security/cyrus-sasl2
BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend
+USE_RC_SUBR= YES
+
USE_PERL5= yes
USE_REINPLACE= YES
GNU_CONFIGURE= YES
diff --git a/mail/cyrus-imapd2/files/imapd.sh b/mail/cyrus-imapd2/files/imapd.sh
index d34317dd5501..c3e61b10917d 100644
--- a/mail/cyrus-imapd2/files/imapd.sh
+++ b/mail/cyrus-imapd2/files/imapd.sh
@@ -3,24 +3,35 @@
# Start or stop cyrus-imapd
# $FreeBSD$
-case "$1" in
-start)
- if [ -x /usr/local/cyrus/bin/master -a \
- -f /usr/local/etc/cyrus.conf -a \
- -f /usr/local/etc/imapd.conf ]; then
- /usr/local/cyrus/bin/master -d
- echo -n ' imapd'
- fi
- ;;
-stop)
- if [ -r /var/run/cyrus-master.pid ]; then
- kill `cat /var/run/cyrus-master.pid` && echo -n ' imapd'
- rm /var/run/cyrus-master.pid
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
+# PROVIDE: cyrus_imapd
+# REQUIRE: DAEMON
+# BEFORE: mail
+# KEYWORD: FreeBSD shutdown
+#
+# NOTE for FreeBSD 5.0+:
+# If you want this script to start with the base rc scripts
+# move imapd.sh to /etc/rc.d/cyrus_imapd
-exit 0
+prefix=%%PREFIX%%
+
+# Define these imapd_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/cyrus_imapd
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+cyrus_imapd_enable="YES" # Enable imapd
+#cyrus_imapd_program="${prefix}/cyrus/bin/master" # Location of imapd
+cyrus_imapd_flags="-d" # Flags to imapd program
+
+. %%RC_SUBR%%
+
+name="cyrus_imapd"
+rcvar=`set_rcvar`
+command="${prefix}/cyrus/bin/master"
+pidfile="/var/run/cyrus-master.pid"
+required_files="${prefix}/etc/cyrus.conf ${prefix}/etc/imapd.conf"
+
+load_rc_config $name
+run_rc_command "$1"