summaryrefslogtreecommitdiff
path: root/mail/courier-imap
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-08-14 21:42:14 +0000
committerjlam <jlam@pkgsrc.org>2001-08-14 21:42:14 +0000
commit04b5c4360c08dc8b23056cc444321f6d4fa88c59 (patch)
tree2149231798aebf922ab3ff8a1d402d09661b358c /mail/courier-imap
parentde6db1ce8153c27cd976d3dfba2a0223f89554e0 (diff)
downloadpkgsrc-04b5c4360c08dc8b23056cc444321f6d4fa88c59.tar.gz
Remove useless courier-imap.sh that was a work-in-progress, and add
four scripts (courier-{imap,imaps,pop,pops}) that are rc.d-style scripts to start/stop the various Courier IMAP and POP3 services. They were modelled after the samba scripts which may be invoked on systems without rc.d.
Diffstat (limited to 'mail/courier-imap')
-rw-r--r--mail/courier-imap/Makefile6
-rw-r--r--mail/courier-imap/files/courier-imap.sh175
-rwxr-xr-xmail/courier-imap/files/courierimap.sh40
-rwxr-xr-xmail/courier-imap/files/courierimaps.sh40
-rwxr-xr-xmail/courier-imap/files/courierpop.sh40
-rwxr-xr-xmail/courier-imap/files/courierpops.sh40
-rw-r--r--mail/courier-imap/pkg/PLIST6
7 files changed, 170 insertions, 177 deletions
diff --git a/mail/courier-imap/Makefile b/mail/courier-imap/Makefile
index 17461d811a4..62f65e7677f 100644
--- a/mail/courier-imap/Makefile
+++ b/mail/courier-imap/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2001/08/12 18:17:15 jlam Exp $
+# $NetBSD: Makefile,v 1.3 2001/08/14 21:42:14 jlam Exp $
DISTNAME= courier-imap-1.3.8.2
CATEGORIES= mail
@@ -79,6 +79,10 @@ pre-install:
${SED} ${FILES_SUBST_SED} ${PKGDIR}/INSTALL > ${INSTALL_FILE}
post-install:
+ ${INSTALL_SCRIPT} ${FILESDIR}/courierimap.sh ${PREFIX}/etc/courierimap
+ ${INSTALL_SCRIPT} ${FILESDIR}/courierimaps.sh ${PREFIX}/etc/courierimaps
+ ${INSTALL_SCRIPT} ${FILESDIR}/courierpop.sh ${PREFIX}/etc/courierpop
+ ${INSTALL_SCRIPT} ${FILESDIR}/courierpops.sh ${PREFIX}/etc/courierpops
${INSTALL_SCRIPT} ${WRKSRC}/sysconftool ${PREFIX}/sbin
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/courier
${INSTALL_DATA} ${WRKSRC}/imap/README \
diff --git a/mail/courier-imap/files/courier-imap.sh b/mail/courier-imap/files/courier-imap.sh
deleted file mode 100644
index a5fd4232048..00000000000
--- a/mail/courier-imap/files/courier-imap.sh
+++ /dev/null
@@ -1,175 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: courier-imap.sh,v 1.1.1.1 2001/07/31 22:48:51 jlam Exp $
-#
-# PROVIDE: courier
-# REQUIRE: DAEMON
-#
-# To start courier-imap at startup, copy this script to /etc/rc.d and set
-# courier=YES in /etc/rc.conf.
-
-name="courier"
-rcvar=$name
-command="@PREFIX@/sbin/apachectl"
-
-# set defaults
-if [ -r /etc/rc.conf ]
-then
- . /etc/rc.conf
-else
- eval ${rcvar}=YES
-fi
-
-# $flags from environment overrides ${rcvar}_flags
-if [ -n "${flags}" ]
-then
- eval ${rcvar}_flags="${flags}"
-fi
-
-checkyesno()
-{
- eval _value=\$${1}
- case $_value in
- [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 ;;
- [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1 ;;
- *)
- echo "\$${1} is not set properly."
- return 1
- ;;
- esac
-}
-
-cmd=${1:-start}
-case ${cmd} in
-force*)
- cmd=${cmd#force}
- eval ${rcvar}=YES
- ;;
-esac
-
-if checkyesno ${rcvar}
-then
- if [ -x ${command} ]
- then
- case ${cmd} in
- restart|start|stop|status)
- ${rcvar}_doit ${cmd}
- ;;
- *)
- echo 1>&2 "Usage: $0 [restart|start|stop|status]"
- exit 1
- ;;
- esac
- fi
-fi
-
-prefix=/usr/pkg
-exec_prefix=${prefix}
-
-case "$1" in
-start)
- cd /
- . ${prefix}/etc/imapd
-
- echo -n "Starting Courier-IMAP server:"
-
- case x$IMAPDSTART in
- x[yY]*)
- # Start daemons.
- ${exec_prefix}/libexec/imapd.rc start
- echo -n " imap"
- ;;
- esac
-
- . ${prefix}/etc/imapd-ssl
- case x$IMAPDSSLSTART in
- x[yY]*)
- if test -x $COURIERTLS
- then
-
- # First time we start this, generate a dummy SSL certificate.
-
- if test ! -f ${prefix}/share/imapd.pem
- then
- echo -n " generating-SSL-certificate..."
- ${prefix}/share/mkimapdcert >/dev/null 2>&1
- fi
- ${exec_prefix}/libexec/imapd-ssl.rc start
- echo -n " imap-ssl"
- fi
- ;;
- esac
-
- POP3DSTART=""
- POP3DSSLSTART=""
-
- if test -f ${prefix}/etc/pop3d
- then
- . ${prefix}/etc/pop3d
- fi
-
- case x$POP3DSTART in
- x[yY]*)
- # Start daemons.
- ${exec_prefix}/libexec/pop3d.rc start
- echo -n " pop3"
- ;;
- esac
-
- if test -f ${prefix}/etc/pop3d-ssl
- then
- . ${prefix}/etc/pop3d-ssl
- fi
-
- case x$POP3DSSLSTART in
- x[yY]*)
- if test -x $COURIERTLS
- then
-
- # First time we start this, generate a dummy SSL certificate.
-
- if test ! -f ${prefix}/share/pop3d.pem
- then
- echo -n " generating-SSL-certificate..."
- ${prefix}/share/mkpop3dcert >/dev/null 2>&1
- fi
- ${exec_prefix}/libexec/pop3d-ssl.rc start
- echo -n " pop3-ssl"
- fi
- ;;
- esac
-
- echo ""
- ;;
-stop)
- echo -n "Stopping Courier-IMAP server:"
- . ${prefix}/etc/imapd
- . ${prefix}/etc/imapd-ssl
- ${exec_prefix}/libexec/imapd.rc stop
- echo -n " imap"
- if test -x $COURIERTLS
- then
- ${exec_prefix}/libexec/imapd-ssl.rc stop
- echo -n " imap-ssl"
- fi
-
- if test -f ${prefix}/etc/pop3d
- then
- ${exec_prefix}/libexec/pop3d.rc stop
- echo -n " pop3"
-
- if test -x $COURIERTLS
- then
- ${exec_prefix}/libexec/pop3d-ssl.rc stop
- echo -n " pop3-ssl"
- fi
- fi
-
- echo ""
- ;;
-restart)
- $0 stop
- $0 start
- ;;
-esac
-exit 0
diff --git a/mail/courier-imap/files/courierimap.sh b/mail/courier-imap/files/courierimap.sh
new file mode 100755
index 00000000000..31f9da5eaa5
--- /dev/null
+++ b/mail/courier-imap/files/courierimap.sh
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# Courier IMAP services daemon
+#
+# PROVIDE: courierimap
+# REQUIRE: DAEMON
+
+if [ ! -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="courierimap"
+rcvar=${name}
+command="/usr/pkg/libexec/courier/couriertcpd"
+ctl_command="/usr/pkg/libexec/courier/imapd.rc"
+pidfile="/var/run/imapd.pid"
+
+start_cmd="courier_doit start"
+stop_cmd="courier_doit stop"
+
+courier_doit()
+{
+ action=$1
+ case ${action} in
+ start) echo "Starting ${rcvar}." ;;
+ stop) echo "Stopping ${rcvar}." ;;
+ esac
+
+ ${ctl_command} ${action}
+}
+
+if [ ! -d /etc/rc.d ]
+then
+ echo -n " ${name}"
+ exec ${ctl_command} start
+fi
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/mail/courier-imap/files/courierimaps.sh b/mail/courier-imap/files/courierimaps.sh
new file mode 100755
index 00000000000..eeec7a72ea5
--- /dev/null
+++ b/mail/courier-imap/files/courierimaps.sh
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# Courier IMAP/SSL services daemon
+#
+# PROVIDE: courierimaps
+# REQUIRE: DAEMON
+
+if [ ! -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="courierimaps"
+rcvar=${name}
+command="/usr/pkg/libexec/courier/couriertcpd"
+ctl_command="/usr/pkg/libexec/courier/imapd-ssl.rc"
+pidfile="/var/run/imapd-ssl.pid"
+
+start_cmd="courier_doit start"
+stop_cmd="courier_doit stop"
+
+courier_doit()
+{
+ action=$1
+ case ${action} in
+ start) echo "Starting ${rcvar}." ;;
+ stop) echo "Stopping ${rcvar}." ;;
+ esac
+
+ ${ctl_command} ${action}
+}
+
+if [ ! -d /etc/rc.d ]
+then
+ echo -n " ${name}"
+ exec ${ctl_command} start
+fi
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/mail/courier-imap/files/courierpop.sh b/mail/courier-imap/files/courierpop.sh
new file mode 100755
index 00000000000..8cb371a891a
--- /dev/null
+++ b/mail/courier-imap/files/courierpop.sh
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# Courier POP services daemon
+#
+# PROVIDE: courierpop
+# REQUIRE: DAEMON
+
+if [ ! -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="courierpop"
+rcvar=${name}
+command="/usr/pkg/libexec/courier/couriertcpd"
+ctl_command="/usr/pkg/libexec/courier/pop3d.rc"
+pidfile="/var/run/pop3d.pid"
+
+start_cmd="courier_doit start"
+stop_cmd="courier_doit stop"
+
+courier_doit()
+{
+ action=$1
+ case ${action} in
+ start) echo "Starting ${rcvar}." ;;
+ stop) echo "Stopping ${rcvar}." ;;
+ esac
+
+ ${ctl_command} ${action}
+}
+
+if [ ! -d /etc/rc.d ]
+then
+ echo -n " ${name}"
+ exec ${ctl_command} start
+fi
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/mail/courier-imap/files/courierpops.sh b/mail/courier-imap/files/courierpops.sh
new file mode 100755
index 00000000000..73320dec8b8
--- /dev/null
+++ b/mail/courier-imap/files/courierpops.sh
@@ -0,0 +1,40 @@
+#! /bin/sh
+#
+# Courier POP3/SSL services daemon
+#
+# PROVIDE: courierpops
+# REQUIRE: DAEMON
+
+if [ ! -d /etc/rc.d -a -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="courierpops"
+rcvar=${name}
+command="/usr/pkg/libexec/courier/couriertcpd"
+ctl_command="/usr/pkg/libexec/courier/pop3d-ssl.rc"
+pidfile="/var/run/pop3d-ssl.pid"
+
+start_cmd="courier_doit start"
+stop_cmd="courier_doit stop"
+
+courier_doit()
+{
+ action=$1
+ case ${action} in
+ start) echo "Starting ${rcvar}." ;;
+ stop) echo "Stopping ${rcvar}." ;;
+ esac
+
+ ${ctl_command} ${action}
+}
+
+if [ ! -d /etc/rc.d ]
+then
+ echo -n " ${name}"
+ exec ${ctl_command} start
+fi
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/mail/courier-imap/pkg/PLIST b/mail/courier-imap/pkg/PLIST
index 9d413199ba1..cccd2675250 100644
--- a/mail/courier-imap/pkg/PLIST
+++ b/mail/courier-imap/pkg/PLIST
@@ -1,8 +1,12 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2001/07/31 22:48:50 jlam Exp $
+@comment $NetBSD: PLIST,v 1.2 2001/08/14 21:42:16 jlam Exp $
bin/couriertls
bin/imapd
bin/maildirmake
bin/pop3d
+etc/rc.d/courierimap
+etc/rc.d/courierimaps
+etc/rc.d/courierpop
+etc/rc.d/courierpops
libexec/courier/authlib/authcram
libexec/courier/authlib/authcustom
libexec/courier/authlib/authpwd