aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/cyrus-imapd2/Makefile22
-rw-r--r--mail/cyrus-imapd2/files/patch-dg30
-rw-r--r--mail/cyrus-imapd2/pkg-deinstall4
-rw-r--r--mail/cyrus-imapd2/pkg-install4
-rw-r--r--mail/cyrus-imapd22/Makefile22
-rw-r--r--mail/cyrus-imapd22/files/patch-dg30
-rw-r--r--mail/cyrus-imapd22/pkg-deinstall4
-rw-r--r--mail/cyrus-imapd22/pkg-install4
-rw-r--r--mail/cyrus-imapd23/Makefile22
-rw-r--r--mail/cyrus-imapd23/files/patch-dg30
-rw-r--r--mail/cyrus-imapd23/pkg-deinstall4
-rw-r--r--mail/cyrus-imapd23/pkg-install4
-rw-r--r--mail/cyrus-imapd24/Makefile22
-rw-r--r--mail/cyrus-imapd24/files/patch-dg30
-rw-r--r--mail/cyrus-imapd24/pkg-deinstall4
-rw-r--r--mail/cyrus-imapd24/pkg-install4
-rw-r--r--security/cyrus-sasl2/Makefile9
-rw-r--r--security/cyrus-sasl2/pkg-deinstall11
-rw-r--r--security/cyrus-sasl2/pkg-install13
19 files changed, 199 insertions, 74 deletions
diff --git a/mail/cyrus-imapd2/Makefile b/mail/cyrus-imapd2/Makefile
index 308f219c740e..e862cab06bb7 100644
--- a/mail/cyrus-imapd2/Makefile
+++ b/mail/cyrus-imapd2/Makefile
@@ -25,7 +25,8 @@ BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend \
USE_PERL5= yes
GNU_CONFIGURE= YES
CONFIGURE_ARGS= --with-cyrus-prefix=${PREFIX}/cyrus \
- --with-cyrus-group=cyrus \
+ --with-cyrus-user=${CYRUS_USER} \
+ --with-cyrus-group=${CYRUS_GROUP} \
--with-sasl=${LOCALBASE} \
--with-dbdir=${LOCALBASE} \
--with-auth=unix \
@@ -52,6 +53,9 @@ LIB_DEPENDS+= netsnmp.5:${PORTSDIR}/net/net-snmp
CONFIGURE_ARGS+=--with-ucdsnmp=no
.endif
+CYRUS_USER?= cyrus
+CYRUS_GROUP?= cyrus
+
MAN1= cyradm.1 imtest.1 installsieve.1 lmtptest.1 mupdatetest.1 \
pop3test.1 sieveshell.1 sivtest.1 smtptest.1
MAN3= imclient.3
@@ -69,6 +73,9 @@ DOCS= altnamespace anoncvs bugs changes faq feedback index \
install-upgrade mailing-list man notes os overview questions \
readme sieve sieve-protocol specs
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+PKGINSTALL= ${WRKDIR}/pkg-install
+
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500800
@@ -79,8 +86,14 @@ RUN_DEPENDS+= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Pod/Parser.pm:${PORTS
.endif
post-patch:
- @${SED} -e "s|/etc/|${PREFIX}/etc/|" ${WRKSRC}/tools/mkimap \
- > ${WRKSRC}/tools/mkimap.new
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-install > ${PKGINSTALL}
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL}
+ @${SED} -e "s|/etc/|${PREFIX}/etc/|" \
+ -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ -e "s|%%CYRUS_GROUP%%|${CYRUS_GROUP}|g" \
+ ${WRKSRC}/tools/mkimap > ${WRKSRC}/tools/mkimap.new
@${MV} ${WRKSRC}/tools/mkimap.new ${WRKSRC}/tools/mkimap
@${CP} ${WRKSRC}/man/quota.8 ${WRKSRC}/man/cyrquota.8
.if ${PERL_LEVEL} < 500600
@@ -130,7 +143,8 @@ post-install:
${PREFIX}/etc/cyrus.conf.dist
${INSTALL_SCRIPT} ${WRKSRC}/tools/mkimap \
${PREFIX}/cyrus/bin/mkimap
- @PKG_PREFIX=${PREFIX} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} \
+ POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/mail/cyrus-imapd2/files/patch-dg b/mail/cyrus-imapd2/files/patch-dg
index 94682461fa25..b413044ffd6c 100644
--- a/mail/cyrus-imapd2/files/patch-dg
+++ b/mail/cyrus-imapd2/files/patch-dg
@@ -1,29 +1,39 @@
Index: tools/mkimap
diff -u tools/mkimap.orig tools/mkimap
---- tools/mkimap.orig Thu Jan 25 06:26:51 2001
-+++ tools/mkimap Sat Apr 7 05:42:24 2001
-@@ -119,6 +119,8 @@
- mkdir "deliverdb", 0755;
- mkdir "deliverdb/db", 0755;
+--- tools/mkimap.orig Fri Sep 28 01:02:34 2001
++++ tools/mkimap Tue Jan 28 18:00:32 2003
+@@ -64,6 +64,9 @@
+ $nosievedir = 0;
+ $hashispool = 0;
-+system "/usr/sbin/chown -R cyrus:cyrus .";
++$cyrus_user = $ENV{CYRUS_USER} || "%%CYRUS_USER%%";
++$cyrus_group = $ENV{CYRUS_GROUP} || "%%CYRUS_GROUP%%";
++
+ open CONF, $imapdconf or die "can't open $imapdconf";
+ print "reading configure file...\n";
+ while (<CONF>) {
+@@ -117,6 +120,8 @@
+ mkdir "log", 0755;
+ mkdir "msg", 0755;
+
++system "/usr/sbin/chown -R $cyrus_user:$cyrus_group .";
+
# create the sieve stuff
if (!$nosievedir) {
print "creating $sievedir...\n";
-@@ -127,6 +129,7 @@
+@@ -125,6 +130,7 @@
if (chdir $sievedir) {
foreach $i ("a".."z") { mkdir "$i", 0755; }
}
-+ system "/usr/sbin/chown -R cyrus:cyrus $sievedir";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $sievedir";
}
$flag = 0;
-@@ -138,6 +141,7 @@
+@@ -136,6 +142,7 @@
chdir $part or die "couldn't change to partition $part";
mkdir "stage.", 0755;
if ($hashispool) { foreach $i ("a".."z") { mkdir $i, 0755; } }
-+ system "/usr/sbin/chown -R cyrus:cyrus $part";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $part";
}
print "done\n";
diff --git a/mail/cyrus-imapd2/pkg-deinstall b/mail/cyrus-imapd2/pkg-deinstall
index b2e3eb678c15..482b69d2f5c8 100644
--- a/mail/cyrus-imapd2/pkg-deinstall
+++ b/mail/cyrus-imapd2/pkg-deinstall
@@ -10,6 +10,8 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
checkfile() {
diff -bBqw $1 $1.dist >/dev/null 2>&1
case $? in
@@ -40,7 +42,7 @@ cyrus_conf() {
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
if [ -x /sbin/nologin ]; then
shell=/sbin/nologin
diff --git a/mail/cyrus-imapd2/pkg-install b/mail/cyrus-imapd2/pkg-install
index 20f1fbb0ff7c..21e473bac5db 100644
--- a/mail/cyrus-imapd2/pkg-install
+++ b/mail/cyrus-imapd2/pkg-install
@@ -6,12 +6,14 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
#
# Modify the 'cyrus' user created from the cyrus-sasl port
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
shell=/bin/csh
uhome=${PKG_PREFIX}/cyrus
diff --git a/mail/cyrus-imapd22/Makefile b/mail/cyrus-imapd22/Makefile
index 308f219c740e..e862cab06bb7 100644
--- a/mail/cyrus-imapd22/Makefile
+++ b/mail/cyrus-imapd22/Makefile
@@ -25,7 +25,8 @@ BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend \
USE_PERL5= yes
GNU_CONFIGURE= YES
CONFIGURE_ARGS= --with-cyrus-prefix=${PREFIX}/cyrus \
- --with-cyrus-group=cyrus \
+ --with-cyrus-user=${CYRUS_USER} \
+ --with-cyrus-group=${CYRUS_GROUP} \
--with-sasl=${LOCALBASE} \
--with-dbdir=${LOCALBASE} \
--with-auth=unix \
@@ -52,6 +53,9 @@ LIB_DEPENDS+= netsnmp.5:${PORTSDIR}/net/net-snmp
CONFIGURE_ARGS+=--with-ucdsnmp=no
.endif
+CYRUS_USER?= cyrus
+CYRUS_GROUP?= cyrus
+
MAN1= cyradm.1 imtest.1 installsieve.1 lmtptest.1 mupdatetest.1 \
pop3test.1 sieveshell.1 sivtest.1 smtptest.1
MAN3= imclient.3
@@ -69,6 +73,9 @@ DOCS= altnamespace anoncvs bugs changes faq feedback index \
install-upgrade mailing-list man notes os overview questions \
readme sieve sieve-protocol specs
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+PKGINSTALL= ${WRKDIR}/pkg-install
+
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500800
@@ -79,8 +86,14 @@ RUN_DEPENDS+= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Pod/Parser.pm:${PORTS
.endif
post-patch:
- @${SED} -e "s|/etc/|${PREFIX}/etc/|" ${WRKSRC}/tools/mkimap \
- > ${WRKSRC}/tools/mkimap.new
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-install > ${PKGINSTALL}
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL}
+ @${SED} -e "s|/etc/|${PREFIX}/etc/|" \
+ -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ -e "s|%%CYRUS_GROUP%%|${CYRUS_GROUP}|g" \
+ ${WRKSRC}/tools/mkimap > ${WRKSRC}/tools/mkimap.new
@${MV} ${WRKSRC}/tools/mkimap.new ${WRKSRC}/tools/mkimap
@${CP} ${WRKSRC}/man/quota.8 ${WRKSRC}/man/cyrquota.8
.if ${PERL_LEVEL} < 500600
@@ -130,7 +143,8 @@ post-install:
${PREFIX}/etc/cyrus.conf.dist
${INSTALL_SCRIPT} ${WRKSRC}/tools/mkimap \
${PREFIX}/cyrus/bin/mkimap
- @PKG_PREFIX=${PREFIX} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} \
+ POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/mail/cyrus-imapd22/files/patch-dg b/mail/cyrus-imapd22/files/patch-dg
index 94682461fa25..b413044ffd6c 100644
--- a/mail/cyrus-imapd22/files/patch-dg
+++ b/mail/cyrus-imapd22/files/patch-dg
@@ -1,29 +1,39 @@
Index: tools/mkimap
diff -u tools/mkimap.orig tools/mkimap
---- tools/mkimap.orig Thu Jan 25 06:26:51 2001
-+++ tools/mkimap Sat Apr 7 05:42:24 2001
-@@ -119,6 +119,8 @@
- mkdir "deliverdb", 0755;
- mkdir "deliverdb/db", 0755;
+--- tools/mkimap.orig Fri Sep 28 01:02:34 2001
++++ tools/mkimap Tue Jan 28 18:00:32 2003
+@@ -64,6 +64,9 @@
+ $nosievedir = 0;
+ $hashispool = 0;
-+system "/usr/sbin/chown -R cyrus:cyrus .";
++$cyrus_user = $ENV{CYRUS_USER} || "%%CYRUS_USER%%";
++$cyrus_group = $ENV{CYRUS_GROUP} || "%%CYRUS_GROUP%%";
++
+ open CONF, $imapdconf or die "can't open $imapdconf";
+ print "reading configure file...\n";
+ while (<CONF>) {
+@@ -117,6 +120,8 @@
+ mkdir "log", 0755;
+ mkdir "msg", 0755;
+
++system "/usr/sbin/chown -R $cyrus_user:$cyrus_group .";
+
# create the sieve stuff
if (!$nosievedir) {
print "creating $sievedir...\n";
-@@ -127,6 +129,7 @@
+@@ -125,6 +130,7 @@
if (chdir $sievedir) {
foreach $i ("a".."z") { mkdir "$i", 0755; }
}
-+ system "/usr/sbin/chown -R cyrus:cyrus $sievedir";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $sievedir";
}
$flag = 0;
-@@ -138,6 +141,7 @@
+@@ -136,6 +142,7 @@
chdir $part or die "couldn't change to partition $part";
mkdir "stage.", 0755;
if ($hashispool) { foreach $i ("a".."z") { mkdir $i, 0755; } }
-+ system "/usr/sbin/chown -R cyrus:cyrus $part";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $part";
}
print "done\n";
diff --git a/mail/cyrus-imapd22/pkg-deinstall b/mail/cyrus-imapd22/pkg-deinstall
index b2e3eb678c15..482b69d2f5c8 100644
--- a/mail/cyrus-imapd22/pkg-deinstall
+++ b/mail/cyrus-imapd22/pkg-deinstall
@@ -10,6 +10,8 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
checkfile() {
diff -bBqw $1 $1.dist >/dev/null 2>&1
case $? in
@@ -40,7 +42,7 @@ cyrus_conf() {
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
if [ -x /sbin/nologin ]; then
shell=/sbin/nologin
diff --git a/mail/cyrus-imapd22/pkg-install b/mail/cyrus-imapd22/pkg-install
index 20f1fbb0ff7c..21e473bac5db 100644
--- a/mail/cyrus-imapd22/pkg-install
+++ b/mail/cyrus-imapd22/pkg-install
@@ -6,12 +6,14 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
#
# Modify the 'cyrus' user created from the cyrus-sasl port
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
shell=/bin/csh
uhome=${PKG_PREFIX}/cyrus
diff --git a/mail/cyrus-imapd23/Makefile b/mail/cyrus-imapd23/Makefile
index 308f219c740e..e862cab06bb7 100644
--- a/mail/cyrus-imapd23/Makefile
+++ b/mail/cyrus-imapd23/Makefile
@@ -25,7 +25,8 @@ BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend \
USE_PERL5= yes
GNU_CONFIGURE= YES
CONFIGURE_ARGS= --with-cyrus-prefix=${PREFIX}/cyrus \
- --with-cyrus-group=cyrus \
+ --with-cyrus-user=${CYRUS_USER} \
+ --with-cyrus-group=${CYRUS_GROUP} \
--with-sasl=${LOCALBASE} \
--with-dbdir=${LOCALBASE} \
--with-auth=unix \
@@ -52,6 +53,9 @@ LIB_DEPENDS+= netsnmp.5:${PORTSDIR}/net/net-snmp
CONFIGURE_ARGS+=--with-ucdsnmp=no
.endif
+CYRUS_USER?= cyrus
+CYRUS_GROUP?= cyrus
+
MAN1= cyradm.1 imtest.1 installsieve.1 lmtptest.1 mupdatetest.1 \
pop3test.1 sieveshell.1 sivtest.1 smtptest.1
MAN3= imclient.3
@@ -69,6 +73,9 @@ DOCS= altnamespace anoncvs bugs changes faq feedback index \
install-upgrade mailing-list man notes os overview questions \
readme sieve sieve-protocol specs
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+PKGINSTALL= ${WRKDIR}/pkg-install
+
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500800
@@ -79,8 +86,14 @@ RUN_DEPENDS+= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Pod/Parser.pm:${PORTS
.endif
post-patch:
- @${SED} -e "s|/etc/|${PREFIX}/etc/|" ${WRKSRC}/tools/mkimap \
- > ${WRKSRC}/tools/mkimap.new
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-install > ${PKGINSTALL}
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL}
+ @${SED} -e "s|/etc/|${PREFIX}/etc/|" \
+ -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ -e "s|%%CYRUS_GROUP%%|${CYRUS_GROUP}|g" \
+ ${WRKSRC}/tools/mkimap > ${WRKSRC}/tools/mkimap.new
@${MV} ${WRKSRC}/tools/mkimap.new ${WRKSRC}/tools/mkimap
@${CP} ${WRKSRC}/man/quota.8 ${WRKSRC}/man/cyrquota.8
.if ${PERL_LEVEL} < 500600
@@ -130,7 +143,8 @@ post-install:
${PREFIX}/etc/cyrus.conf.dist
${INSTALL_SCRIPT} ${WRKSRC}/tools/mkimap \
${PREFIX}/cyrus/bin/mkimap
- @PKG_PREFIX=${PREFIX} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} \
+ POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/mail/cyrus-imapd23/files/patch-dg b/mail/cyrus-imapd23/files/patch-dg
index 94682461fa25..b413044ffd6c 100644
--- a/mail/cyrus-imapd23/files/patch-dg
+++ b/mail/cyrus-imapd23/files/patch-dg
@@ -1,29 +1,39 @@
Index: tools/mkimap
diff -u tools/mkimap.orig tools/mkimap
---- tools/mkimap.orig Thu Jan 25 06:26:51 2001
-+++ tools/mkimap Sat Apr 7 05:42:24 2001
-@@ -119,6 +119,8 @@
- mkdir "deliverdb", 0755;
- mkdir "deliverdb/db", 0755;
+--- tools/mkimap.orig Fri Sep 28 01:02:34 2001
++++ tools/mkimap Tue Jan 28 18:00:32 2003
+@@ -64,6 +64,9 @@
+ $nosievedir = 0;
+ $hashispool = 0;
-+system "/usr/sbin/chown -R cyrus:cyrus .";
++$cyrus_user = $ENV{CYRUS_USER} || "%%CYRUS_USER%%";
++$cyrus_group = $ENV{CYRUS_GROUP} || "%%CYRUS_GROUP%%";
++
+ open CONF, $imapdconf or die "can't open $imapdconf";
+ print "reading configure file...\n";
+ while (<CONF>) {
+@@ -117,6 +120,8 @@
+ mkdir "log", 0755;
+ mkdir "msg", 0755;
+
++system "/usr/sbin/chown -R $cyrus_user:$cyrus_group .";
+
# create the sieve stuff
if (!$nosievedir) {
print "creating $sievedir...\n";
-@@ -127,6 +129,7 @@
+@@ -125,6 +130,7 @@
if (chdir $sievedir) {
foreach $i ("a".."z") { mkdir "$i", 0755; }
}
-+ system "/usr/sbin/chown -R cyrus:cyrus $sievedir";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $sievedir";
}
$flag = 0;
-@@ -138,6 +141,7 @@
+@@ -136,6 +142,7 @@
chdir $part or die "couldn't change to partition $part";
mkdir "stage.", 0755;
if ($hashispool) { foreach $i ("a".."z") { mkdir $i, 0755; } }
-+ system "/usr/sbin/chown -R cyrus:cyrus $part";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $part";
}
print "done\n";
diff --git a/mail/cyrus-imapd23/pkg-deinstall b/mail/cyrus-imapd23/pkg-deinstall
index b2e3eb678c15..482b69d2f5c8 100644
--- a/mail/cyrus-imapd23/pkg-deinstall
+++ b/mail/cyrus-imapd23/pkg-deinstall
@@ -10,6 +10,8 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
checkfile() {
diff -bBqw $1 $1.dist >/dev/null 2>&1
case $? in
@@ -40,7 +42,7 @@ cyrus_conf() {
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
if [ -x /sbin/nologin ]; then
shell=/sbin/nologin
diff --git a/mail/cyrus-imapd23/pkg-install b/mail/cyrus-imapd23/pkg-install
index 20f1fbb0ff7c..21e473bac5db 100644
--- a/mail/cyrus-imapd23/pkg-install
+++ b/mail/cyrus-imapd23/pkg-install
@@ -6,12 +6,14 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
#
# Modify the 'cyrus' user created from the cyrus-sasl port
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
shell=/bin/csh
uhome=${PKG_PREFIX}/cyrus
diff --git a/mail/cyrus-imapd24/Makefile b/mail/cyrus-imapd24/Makefile
index 308f219c740e..e862cab06bb7 100644
--- a/mail/cyrus-imapd24/Makefile
+++ b/mail/cyrus-imapd24/Makefile
@@ -25,7 +25,8 @@ BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend \
USE_PERL5= yes
GNU_CONFIGURE= YES
CONFIGURE_ARGS= --with-cyrus-prefix=${PREFIX}/cyrus \
- --with-cyrus-group=cyrus \
+ --with-cyrus-user=${CYRUS_USER} \
+ --with-cyrus-group=${CYRUS_GROUP} \
--with-sasl=${LOCALBASE} \
--with-dbdir=${LOCALBASE} \
--with-auth=unix \
@@ -52,6 +53,9 @@ LIB_DEPENDS+= netsnmp.5:${PORTSDIR}/net/net-snmp
CONFIGURE_ARGS+=--with-ucdsnmp=no
.endif
+CYRUS_USER?= cyrus
+CYRUS_GROUP?= cyrus
+
MAN1= cyradm.1 imtest.1 installsieve.1 lmtptest.1 mupdatetest.1 \
pop3test.1 sieveshell.1 sivtest.1 smtptest.1
MAN3= imclient.3
@@ -69,6 +73,9 @@ DOCS= altnamespace anoncvs bugs changes faq feedback index \
install-upgrade mailing-list man notes os overview questions \
readme sieve sieve-protocol specs
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+PKGINSTALL= ${WRKDIR}/pkg-install
+
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500800
@@ -79,8 +86,14 @@ RUN_DEPENDS+= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Pod/Parser.pm:${PORTS
.endif
post-patch:
- @${SED} -e "s|/etc/|${PREFIX}/etc/|" ${WRKSRC}/tools/mkimap \
- > ${WRKSRC}/tools/mkimap.new
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-install > ${PKGINSTALL}
+ @${SED} -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL}
+ @${SED} -e "s|/etc/|${PREFIX}/etc/|" \
+ -e "s|%%CYRUS_USER%%|${CYRUS_USER}|g" \
+ -e "s|%%CYRUS_GROUP%%|${CYRUS_GROUP}|g" \
+ ${WRKSRC}/tools/mkimap > ${WRKSRC}/tools/mkimap.new
@${MV} ${WRKSRC}/tools/mkimap.new ${WRKSRC}/tools/mkimap
@${CP} ${WRKSRC}/man/quota.8 ${WRKSRC}/man/cyrquota.8
.if ${PERL_LEVEL} < 500600
@@ -130,7 +143,8 @@ post-install:
${PREFIX}/etc/cyrus.conf.dist
${INSTALL_SCRIPT} ${WRKSRC}/tools/mkimap \
${PREFIX}/cyrus/bin/mkimap
- @PKG_PREFIX=${PREFIX} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} \
+ POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/mail/cyrus-imapd24/files/patch-dg b/mail/cyrus-imapd24/files/patch-dg
index 94682461fa25..b413044ffd6c 100644
--- a/mail/cyrus-imapd24/files/patch-dg
+++ b/mail/cyrus-imapd24/files/patch-dg
@@ -1,29 +1,39 @@
Index: tools/mkimap
diff -u tools/mkimap.orig tools/mkimap
---- tools/mkimap.orig Thu Jan 25 06:26:51 2001
-+++ tools/mkimap Sat Apr 7 05:42:24 2001
-@@ -119,6 +119,8 @@
- mkdir "deliverdb", 0755;
- mkdir "deliverdb/db", 0755;
+--- tools/mkimap.orig Fri Sep 28 01:02:34 2001
++++ tools/mkimap Tue Jan 28 18:00:32 2003
+@@ -64,6 +64,9 @@
+ $nosievedir = 0;
+ $hashispool = 0;
-+system "/usr/sbin/chown -R cyrus:cyrus .";
++$cyrus_user = $ENV{CYRUS_USER} || "%%CYRUS_USER%%";
++$cyrus_group = $ENV{CYRUS_GROUP} || "%%CYRUS_GROUP%%";
++
+ open CONF, $imapdconf or die "can't open $imapdconf";
+ print "reading configure file...\n";
+ while (<CONF>) {
+@@ -117,6 +120,8 @@
+ mkdir "log", 0755;
+ mkdir "msg", 0755;
+
++system "/usr/sbin/chown -R $cyrus_user:$cyrus_group .";
+
# create the sieve stuff
if (!$nosievedir) {
print "creating $sievedir...\n";
-@@ -127,6 +129,7 @@
+@@ -125,6 +130,7 @@
if (chdir $sievedir) {
foreach $i ("a".."z") { mkdir "$i", 0755; }
}
-+ system "/usr/sbin/chown -R cyrus:cyrus $sievedir";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $sievedir";
}
$flag = 0;
-@@ -138,6 +141,7 @@
+@@ -136,6 +142,7 @@
chdir $part or die "couldn't change to partition $part";
mkdir "stage.", 0755;
if ($hashispool) { foreach $i ("a".."z") { mkdir $i, 0755; } }
-+ system "/usr/sbin/chown -R cyrus:cyrus $part";
++ system "/usr/sbin/chown -R $cyrus_user:$cyrus_group $part";
}
print "done\n";
diff --git a/mail/cyrus-imapd24/pkg-deinstall b/mail/cyrus-imapd24/pkg-deinstall
index b2e3eb678c15..482b69d2f5c8 100644
--- a/mail/cyrus-imapd24/pkg-deinstall
+++ b/mail/cyrus-imapd24/pkg-deinstall
@@ -10,6 +10,8 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
checkfile() {
diff -bBqw $1 $1.dist >/dev/null 2>&1
case $? in
@@ -40,7 +42,7 @@ cyrus_conf() {
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
if [ -x /sbin/nologin ]; then
shell=/sbin/nologin
diff --git a/mail/cyrus-imapd24/pkg-install b/mail/cyrus-imapd24/pkg-install
index 20f1fbb0ff7c..21e473bac5db 100644
--- a/mail/cyrus-imapd24/pkg-install
+++ b/mail/cyrus-imapd24/pkg-install
@@ -6,12 +6,14 @@ PKG_BATCH=${BATCH:=NO}
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
+CYRUS_USER=${CYRUS_USER:=%%CYRUS_USER%%}
+
#
# Modify the 'cyrus' user created from the cyrus-sasl port
#
modify_cyrus_user() {
- USER=cyrus
+ USER=${CYRUS_USER}
PW=/usr/sbin/pw
shell=/bin/csh
uhome=${PKG_PREFIX}/cyrus
diff --git a/security/cyrus-sasl2/Makefile b/security/cyrus-sasl2/Makefile
index ee91c0492953..1aec02ed394d 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 3934276141a9..605204426f06 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 609c9becfba2..0ba4edab6ede 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