diff options
author | ume <ume@FreeBSD.org> | 2003-01-30 14:04:02 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-01-30 14:04:02 +0000 |
commit | 1ee12b52dbeca25c802a997cd6de226cca1b0d3c (patch) | |
tree | f66052896ca9dbacd93962e3e6a9d3924dd2e3a5 /mail/cyrus-imapd2 | |
parent | 0f27788e08d15ce592702005b41df83d23cd09fc (diff) | |
download | FreeBSD-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 'mail/cyrus-imapd2')
-rw-r--r-- | mail/cyrus-imapd2/Makefile | 22 | ||||
-rw-r--r-- | mail/cyrus-imapd2/files/patch-dg | 30 | ||||
-rw-r--r-- | mail/cyrus-imapd2/pkg-deinstall | 4 | ||||
-rw-r--r-- | mail/cyrus-imapd2/pkg-install | 4 |
4 files changed, 44 insertions, 16 deletions
diff --git a/mail/cyrus-imapd2/Makefile b/mail/cyrus-imapd2/Makefile index 308f219..e862cab 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 9468246..b413044 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 b2e3eb6..482b69d 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 20f1fbb..21e473b 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 |