diff options
author | jperkin <jperkin@pkgsrc.org> | 2014-03-11 14:34:36 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2014-03-11 14:34:36 +0000 |
commit | 76740313a3ac624b6ff51288f485f40d39d80cb1 (patch) | |
tree | 7ee5b13abb9f96749121a307db970b8b85e953da /mail/courier-imap | |
parent | 6bcea5495c4b03080e1f7cff4f0d1898590b2317 (diff) | |
download | pkgsrc-76740313a3ac624b6ff51288f485f40d39d80cb1.tar.gz |
Import initial SMF support for individual packages.
Diffstat (limited to 'mail/courier-imap')
-rw-r--r-- | mail/courier-imap/Makefile | 3 | ||||
-rw-r--r-- | mail/courier-imap/files/smf/courier-imap.sh | 122 | ||||
-rw-r--r-- | mail/courier-imap/files/smf/manifest.xml | 43 |
3 files changed, 167 insertions, 1 deletions
diff --git a/mail/courier-imap/Makefile b/mail/courier-imap/Makefile index f2502e4be77..96b06ad356a 100644 --- a/mail/courier-imap/Makefile +++ b/mail/courier-imap/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.78 2013/07/12 10:44:55 jperkin Exp $ +# $NetBSD: Makefile,v 1.79 2014/03/11 14:34:38 jperkin Exp $ DISTNAME= courier-imap-4.10.0 PKGREVISION= 3 @@ -52,6 +52,7 @@ CONF_FILES_PERMS+= ${EGDIR}/${_file_} \ ${COURIER_FILE_PERMS} .endfor RCD_SCRIPTS= courierimap courierimaps courierpop courierpops +SMF_METHODS= courier-imap SUBST_CLASSES+= courier SUBST_FILES.courier= imap/imapd-ssl.dist.in imap/imapd.8.in \ diff --git a/mail/courier-imap/files/smf/courier-imap.sh b/mail/courier-imap/files/smf/courier-imap.sh new file mode 100644 index 00000000000..2f4dc767178 --- /dev/null +++ b/mail/courier-imap/files/smf/courier-imap.sh @@ -0,0 +1,122 @@ +#!@SMF_METHOD_SHELL@ +# +# $NetBSD: courier-imap.sh,v 1.1 2014/03/11 14:34:38 jperkin Exp $ +# +# Init script for Courier-IMAP. +# + +. /lib/svc/share/smf_include.sh + +prefix=@PREFIX@ +exec_prefix=@PREFIX@ +bindir=${exec_prefix}/bin +sbindir=${exec_prefix}/sbin + +case "$1" in +start) + cd / + . $prefix/etc/courier/imapd + + printf "Starting Courier-IMAP server:" + + case x$IMAPDSTART in + x[yY]*) + # Start daemons. + $sbindir/imapd start + printf "\n imap" + ;; + esac + + . $prefix/etc/courier/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 $TLS_CERTFILE + then + printf "\n generating-SSL-certificate..." + $prefix/share/courier/mkimapdcert >/dev/null 2>&1 + fi + $sbindir/imapd-ssl start + printf "\n imap-ssl" + fi + ;; + esac + + POP3DSTART="" + POP3DSSLSTART="" + + if test -f $prefix/etc/courier/pop3d + then + . $prefix/etc/courier/pop3d + fi + + case x$POP3DSTART in + x[yY]*) + # Start daemons. + $sbindir/pop3d start + printf "\n pop3" + ;; + esac + + if test -f $prefix/etc/courier/pop3d-ssl + then + . $prefix/etc/courier/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 $TLS_CERTFILE + then + printf "\n generating-SSL-certificate..." + $prefix/share/courier/mkpop3dcert >/dev/null 2>&1 + fi + $sbindir/pop3d-ssl start + printf "\n pop3-ssl" + fi + ;; + esac + + echo "" + ;; +stop) + printf "Stopping Courier-IMAP server:" + . $prefix/etc/courier/imapd + . $prefix/etc/courier/imapd-ssl + $sbindir/imapd stop + printf "\n imap" + if test -x $COURIERTLS + then + $sbindir/imapd-ssl stop + printf "\n imap-ssl" + fi + + if test -f $prefix/etc/courier/pop3d + then + $sbindir/pop3d stop + printf "\n pop3" + + if test -x $COURIERTLS + then + $sbindir/pop3d-ssl stop + printf "\n pop3-ssl" + fi + fi + + echo "" + ;; +restart) + $0 stop + sleep 3 + $0 start + ;; +esac +exit 0 diff --git a/mail/courier-imap/files/smf/manifest.xml b/mail/courier-imap/files/smf/manifest.xml new file mode 100644 index 00000000000..06c7fff895d --- /dev/null +++ b/mail/courier-imap/files/smf/manifest.xml @@ -0,0 +1,43 @@ +<?xml version='1.0'?> +<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> +<service_bundle type='manifest' name='@SMF_NAME@'> + <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'> + <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'> + <service_fmri value='svc:/system/filesystem/local' /> + </dependency> + <dependency name='network-service' grouping='require_all' restart_on='none' type='service'> + <service_fmri value='svc:/network/service' /> + </dependency> + <dependency name='system-log' grouping='optional_all' restart_on='none' type='service'> + <service_fmri value='svc:/system/system-log' /> + </dependency> + <instance name='@SMF_INSTANCE@' enabled='false'> + <dependency name='config-files' grouping='require_any' restart_on='refresh' type='path'> + <service_fmri value='file://localhost@PKG_SYSCONFDIR@/pop3d-ssl' /> + <service_fmri value='file://localhost@PKG_SYSCONFDIR@/pop3d' /> + <service_fmri value='file://localhost@PKG_SYSCONFDIR@/imapd-ssl' /> + <service_fmri value='file://localhost@PKG_SYSCONFDIR@/imapd' /> + </dependency> + <dependency name='authlib' grouping='require_all' restart_on='none' type='service'> + <service_fmri value='svc:/@SMF_PREFIX@/courier:authlib' /> + </dependency> + <exec_method name='start' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.courier-imap@ start' timeout_seconds='120' /> + <exec_method name='stop' type='method' exec='@PREFIX@/@SMF_METHOD_FILE.courier-imap@ stop' timeout_seconds='60' /> + <property_group name='startd' type='framework'> + <propval name='ignore_error' type='astring' value='core,signal' /> + </property_group> + <property_group name='general' type='framework'> + <propval name='action_authorization' type='astring' value='solaris.smf.manage.courier-imap' /> + </property_group> + <template> + <common_name> + <loctext xml:lang='C'>imap - Courier IMAP provides access to Maildirs</loctext> + </common_name> + <documentation> + <manpage title='imapd' section='8' manpath='@PREFIX@/@PKGMANDIR@' /> + </documentation> + </template> + </instance> + <stability value='Evolving' /> + </service> +</service_bundle> |