summaryrefslogtreecommitdiff
path: root/mail/enma
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2010-05-28 07:26:48 +0000
committerobache <obache@pkgsrc.org>2010-05-28 07:26:48 +0000
commitf71e38db1009e5276a30f7d7734ea2422e17503a (patch)
tree078bbe615765040f70428a12728f010fe0305bc7 /mail/enma
parent6d1f6353320309ecba336275963235e8de8b4fc5 (diff)
downloadpkgsrc-f71e38db1009e5276a30f7d7734ea2422e17503a.tar.gz
Create required directory in pre-start stage,
/var/run may be cleared at boot.
Diffstat (limited to 'mail/enma')
-rw-r--r--mail/enma/Makefile7
-rw-r--r--mail/enma/files/enma.sh14
2 files changed, 18 insertions, 3 deletions
diff --git a/mail/enma/Makefile b/mail/enma/Makefile
index 78ac521319c..bef3ddcbb01 100644
--- a/mail/enma/Makefile
+++ b/mail/enma/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2010/05/16 00:46:34 obache Exp $
+# $NetBSD: Makefile,v 1.6 2010/05/28 07:26:48 obache Exp $
#
DISTNAME= enma-1.1.0
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=enma/}
@@ -49,6 +49,9 @@ SUBST_STAGE.daemon= post-configure
SUBST_FILES.daemon= enma/etc/enma.conf.sample
SUBST_SED.daemon= -e 's;daemon;${ENMA_USER};g'
+FILES_SUBST+= ENMA_USER=${ENMA_USER:Q}
+FILES_SUBST+= ENMA_GROUP=${ENMA_GROUP:Q}
+
OWN_DIRS_PERMS+= ${VARBASE}/run/enma ${ENMA_USER} ${ENMA_GROUP} 0700
INSTALLATION_DIRS+= share/examples/enma
diff --git a/mail/enma/files/enma.sh b/mail/enma/files/enma.sh
index 68b83c82a32..cb618bba0d8 100644
--- a/mail/enma/files/enma.sh
+++ b/mail/enma/files/enma.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: enma.sh,v 1.2 2009/04/09 02:25:37 obache Exp $
+# $NetBSD: enma.sh,v 1.3 2010/05/28 07:26:48 obache Exp $
#
# PROVIDE: enma
# REQUIRE: NETWORK
@@ -15,5 +15,17 @@ pidfile="@VARBASE@/run/enma/${name}.pid"
required_files="@PKG_SYSCONFDIR@/enma.conf"
command_args="-c @PKG_SYSCONFDIR@/enma.conf"
+start_precmd="${name}_prestart"
+
+enma_prestart()
+{
+ if [ ! -d @VARBASE@/run/enma ]; then
+ @MKDIR@ @VARBASE@/run/enma
+ @CHOWN@ @ENMA_USER@ @VARBASE@/run/enma
+ @CHGRP@ @ENMA_GROUP@ @VARBASE@/run/enma
+ @CHMOD@ 0700 @VARBASE@/run/enma
+ fi
+}
+
load_rc_config ${name}
run_rc_command "$1"