summaryrefslogtreecommitdiff
path: root/mail/postfix
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2016-10-28 16:10:51 +0000
committerjperkin <jperkin@pkgsrc.org>2016-10-28 16:10:51 +0000
commit35e38cb2f4134a8023661f062e7249a7b4d04136 (patch)
tree7f7225e7efe2889cd189c473d0466d2f871a48d1 /mail/postfix
parentbfc7d8e9a3ec9ba3b85178a012e311ee9fad76b6 (diff)
downloadpkgsrc-35e38cb2f4134a8023661f062e7249a7b4d04136.tar.gz
Make the postfix user/group names variables.
Diffstat (limited to 'mail/postfix')
-rw-r--r--mail/postfix/Makefile17
-rw-r--r--mail/postfix/Makefile.common14
2 files changed, 20 insertions, 11 deletions
diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile
index 2750e12db35..f9584c88ae0 100644
--- a/mail/postfix/Makefile
+++ b/mail/postfix/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.292 2016/09/18 17:10:28 taca Exp $
+# $NetBSD: Makefile,v 1.293 2016/10/28 16:10:51 jperkin Exp $
.include "../../mail/postfix/Makefile.common"
@@ -9,8 +9,8 @@ CONFLICTS+= esmtp>=1.2 nullmailer-[0-9]*
USE_TOOLS+= perl
-SPECIAL_PERMS+= sbin/postdrop postfix maildrop 2555
-SPECIAL_PERMS+= sbin/postqueue postfix maildrop 2555
+SPECIAL_PERMS+= sbin/postdrop ${POSTFIX_USER} ${MAILDROP_GROUP} 2555
+SPECIAL_PERMS+= sbin/postqueue ${POSTFIX_USER} ${MAILDROP_GROUP} 2555
REPLACE_PERL+= auxiliary/qshape/qshape.pl
@@ -31,13 +31,14 @@ PLIST_SRC+= ${PKGDIR}/PLIST
RCD_SCRIPTS= postfix
OWN_DIRS+= ${POSTFIX_QUEUE_DIR} ${POSTFIX_QUEUE_DIR}/etc
-OWN_DIRS_PERMS+= ${POSTFIX_DATA_DIR} postfix postfix 0700
+OWN_DIRS_PERMS+= ${POSTFIX_DATA_DIR} ${POSTFIX_USER} ${POSTFIX_GROUP} 0700
MAKE_DIRS+= ${METADIR}/dynamicmaps.cf.d ${METADIR}/postfix-files.d
-PKG_GROUPS?= postfix maildrop
-PKG_USERS?= postfix:postfix
-PKG_GECOS.postfix= Postfix User
-PKG_HOME.postfix= ${POSTFIX_QUEUE_DIR}
+PKG_GROUPS?= ${POSTFIX_GROUP} ${MAILDROP_GROUP}
+PKG_USERS?= ${POSTFIX_USER}:${POSTFIX_GROUP}
+
+PKG_GECOS.${POSTFIX_USER}= Postfix User
+PKG_HOME.${POSTFIX_USER}= ${POSTFIX_QUEUE_DIR}
CONF_FILES= # empty
.for i in main.cf master.cf
diff --git a/mail/postfix/Makefile.common b/mail/postfix/Makefile.common
index 5744e869b17..00abfede130 100644
--- a/mail/postfix/Makefile.common
+++ b/mail/postfix/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.4 2016/10/09 12:28:19 taca Exp $
+# $NetBSD: Makefile.common,v 1.5 2016/10/28 16:10:51 jperkin Exp $
# used by mail/postfix/Makefile
# used by mail/postfix/Makefile.module
@@ -22,6 +22,10 @@ CHECK_HEADERS_SKIP+= src/global/mail_params.h
.include "../../mk/bsd.prefs.mk"
+POSTFIX_USER?= postfix
+POSTFIX_GROUP?= postfix
+MAILDROP_GROUP?= maildrop
+
# POSTFIX_QUEUE_DIR is the default queue directory for Postfix. This is
# merely a default, and may be changed by setting "queue_directory" in
# ${PKG_SYSCONFDIR}/main.cf.
@@ -84,7 +88,9 @@ SUBST_SED.postfix+= \
SUBST_SED.postfix+= \
-e 's|^\(mailq_path\) =.*|\1 = ${PREFIX}/bin/mailq|'
SUBST_SED.postfix+= \
- -e 's|^\(setgid_group\) =.*|\1 = maildrop|'
+ -e 's|^\(mail_owner\) =.*|\1 = ${POSTFIX_USER}|'
+SUBST_SED.postfix+= \
+ -e 's|^\(setgid_group\) =.*|\1 = ${MAILDROP_GROUP}|'
SUBST_SED.postfix+= \
-e 's|^\(manpage_directory\) =.*|\1 = ${PREFIX}/${PKGMANDIR}|'
SUBST_SED.postfix+= \
@@ -92,7 +98,9 @@ SUBST_SED.postfix+= \
SUBST_SED.postfix+= \
-e 's|^\(readme_directory\) =.*|\1 = ${DOCDIR}|'
SUBST_SED.postfix+= \
- -e '/^\#define DEF_SGID_GROUP[ ]/s,postdrop,maildrop,g'
+ -e '/^\#define DEF_MAIL_OWNER[ ]/s,postfix,${POSTFIX_USER},g'
+SUBST_SED.postfix+= \
+ -e '/^\#define DEF_SGID_GROUP[ ]/s,postdrop,${MAILDROP_GROUP},g'
PKG_SYSCONFSUBDIR= postfix
LIBEXECDIR= ${PREFIX}/libexec/postfix