summaryrefslogtreecommitdiffstats
path: root/security/cyrus-sasl2
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-01-30 14:04:02 +0000
committerume <ume@FreeBSD.org>2003-01-30 14:04:02 +0000
commit1ee12b52dbeca25c802a997cd6de226cca1b0d3c (patch)
treef66052896ca9dbacd93962e3e6a9d3924dd2e3a5 /security/cyrus-sasl2
parent0f27788e08d15ce592702005b41df83d23cd09fc (diff)
downloadFreeBSD-ports-1ee12b52dbeca25c802a997cd6de226cca1b0d3c.zip
FreeBSD-ports-1ee12b52dbeca25c802a997cd6de226cca1b0d3c.tar.gz
Add CYRUS_USER and CYRUS_GROUP options to be able to configure
psuedo user for cyrus. Requested by: Cyrus Anderson Yunker <cayunker@unity.ncsu.edu>
Diffstat (limited to 'security/cyrus-sasl2')
-rw-r--r--security/cyrus-sasl2/Makefile9
-rw-r--r--security/cyrus-sasl2/pkg-deinstall11
-rw-r--r--security/cyrus-sasl2/pkg-install13
3 files changed, 23 insertions, 10 deletions
diff --git a/security/cyrus-sasl2/Makefile b/security/cyrus-sasl2/Makefile
index ee91c04..1aec02e 100644
--- a/security/cyrus-sasl2/Makefile
+++ b/security/cyrus-sasl2/Makefile
@@ -95,6 +95,9 @@ CONFIGURE_ENV+= LOCALBASE=${LOCALBASE} \
OPENSSLINC=${OPENSSLINC} \
OPENSSLLIB=${OPENSSLLIB}
+CYRUS_USER?= cyrus
+CYRUS_GROUP?= cyrus
+
DOCS= AUTHORS COPYING ChangeLog INSTALL NEWS README
DOC2= ONEWS TODO draft-burdis-cat-srp-sasl-06.txt \
@@ -135,9 +138,13 @@ pre-fetch:
post-patch:
@${SED} -e "s;%%SASLDB%%;${SASLDB_NAME};g" \
-e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \
+ -e "s;%%CYRUS_USER%%;${CYRUS_USER};g" \
+ -e "s;%%CYRUS_GROUP%%;${CYRUS_GROUP};g" \
${.CURDIR}/pkg-install > ${PKGINSTALL}
@${SED} -e "s;%%SASLDB%%;${SASLDB_NAME};g" \
-e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \
+ -e "s;%%CYRUS_USER%%;${CYRUS_USER};g" \
+ -e "s;%%CYRUS_GROUP%%;${CYRUS_GROUP};g" \
${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL}
@${SED} -e "s;%%PWCHECK_METHOD%%;${PWCHECK_METHOD};g" \
-e "s;%%PREFIX%%;${PREFIX};g" \
@@ -158,7 +165,7 @@ post-install:
${FILESDIR}/saslauthd.sh > ${PREFIX}/etc/rc.d/saslauthd.sh
@${CHMOD} 755 ${PREFIX}/etc/rc.d/saslauthd.sh
${MKDIR} -m 770 /var/state/saslauthd
- ${CHOWN} cyrus:cyrus /var/state/saslauthd
+ ${CHOWN} ${CYRUS_USER}:${CYRUS_GROUP} /var/state/saslauthd
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@${MKDIR} ${DOCSDIR}/html
diff --git a/security/cyrus-sasl2/pkg-deinstall b/security/cyrus-sasl2/pkg-deinstall
index 3934276..6052044 100644
--- a/security/cyrus-sasl2/pkg-deinstall
+++ b/security/cyrus-sasl2/pkg-deinstall
@@ -12,6 +12,9 @@ PKG_PREFIX=${PKG_PREFIX:=/usr/local}
SASLDB_NAME=${PKG_PREFIX}/etc/%%SASLDB%%
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+CYRUS_GROUP=${CYRUS_GROUP:=%%CYRUS_GROUP%%}
+
# delete sasldb database
delete_sasldb() {
@@ -25,11 +28,11 @@ delete_sasldb() {
}
delete_user() {
- if pw usershow cyrus 2>/dev/null 1>&2; then
- echo "To delete Cyrus user permanently, use 'pw userdel cyrus'"
+ if pw usershow ${CYRUS_USER} 2>/dev/null 1>&2; then
+ echo "To delete Cyrus user permanently, use 'pw userdel ${CYRUS_USER}'"
fi
- if pw groupshow cyrus 2>/dev/null 1>&2; then
- echo "To delete Cyrus group permanently, use 'pw groupdel cyrus'"
+ if pw groupshow ${CYRUS_GROUP} 2>/dev/null 1>&2; then
+ echo "To delete Cyrus group permanently, use 'pw groupdel ${CYRUS_GROUP}'"
fi
}
diff --git a/security/cyrus-sasl2/pkg-install b/security/cyrus-sasl2/pkg-install
index 609c9be..0ba4eda 100644
--- a/security/cyrus-sasl2/pkg-install
+++ b/security/cyrus-sasl2/pkg-install
@@ -13,13 +13,16 @@ PKG_PREFIX=${PKG_PREFIX:=/usr/local}
SASLDB_NAME=${PKG_PREFIX}/etc/%%SASLDB%%
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+CYRUS_GROUP=${CYRUS_GROUP:=%%CYRUS_GROUP%%}
+
#
# create 'cyrus' user and group before installing
#
create_user() {
- USER=cyrus
- GROUP=cyrus
+ USER=${CYRUS_USER}
+ GROUP=${CYRUS_GROUP}
PW=/usr/sbin/pw
if [ -x /sbin/nologin ]; then
@@ -77,12 +80,12 @@ create_user() {
create_sasldb() {
if [ ! -f ${SASLDB_NAME} ]; then
- echo "test" | ${PKG_PREFIX}/sbin/saslpasswd2 -p -c cyrus
+ echo "test" | ${PKG_PREFIX}/sbin/saslpasswd2 -p -c ${CYRUS_USER}
if [ `${PKG_PREFIX}/sbin/sasldblistusers2 | wc -l` -eq 0 ] ; then
echo "WARNING: Failed to create ${PKG_PREFIX}/etc/$SASLDB_NAME}"
else
- ${PKG_PREFIX}/sbin/saslpasswd2 -d cyrus
- chown cyrus:mail ${SASLDB_NAME}
+ ${PKG_PREFIX}/sbin/saslpasswd2 -d ${CYRUS_USER}
+ chown ${CYRUS_USER}:mail ${SASLDB_NAME}
chmod 640 ${SASLDB_NAME}
fi
fi
OpenPOWER on IntegriCloud