diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2003-01-30 14:04:02 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2003-01-30 14:04:02 +0000 |
commit | fda290ce5cc52720b72f08cbf1c0cbe32f8e7776 (patch) | |
tree | 00aef3f0ffb75f480ef7c9b2103f2fb72917dd0d /mail/cyrus-imapd23 | |
parent | Fix minor mistake in prev. commit (diff) |
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>
Notes
Notes:
svn path=/head/; revision=74277
Diffstat (limited to 'mail/cyrus-imapd23')
-rw-r--r-- | mail/cyrus-imapd23/Makefile | 22 | ||||
-rw-r--r-- | mail/cyrus-imapd23/files/patch-dg | 30 | ||||
-rw-r--r-- | mail/cyrus-imapd23/pkg-deinstall | 4 | ||||
-rw-r--r-- | mail/cyrus-imapd23/pkg-install | 4 |
4 files changed, 44 insertions, 16 deletions
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 |