[csw-devel] SF.net SVN: gar:[11742] csw/mgar/pkg/cyrus_imapd/trunk

chninkel at users.sourceforge.net chninkel at users.sourceforge.net
Mon Nov 29 23:21:53 CET 2010


Revision: 11742
          http://gar.svn.sourceforge.net/gar/?rev=11742&view=rev
Author:   chninkel
Date:     2010-11-29 22:21:53 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
cyrus_imapd: moved to dynamic prototype, moved from /opt/csw/{etc,var} to /{etc,var}/opt/csw

Modified Paths:
--------------
    csw/mgar/pkg/cyrus_imapd/trunk/Makefile
    csw/mgar/pkg/cyrus_imapd/trunk/files/CSWcyrusimapd.preinstall
    csw/mgar/pkg/cyrus_imapd/trunk/files/README.CSW
    csw/mgar/pkg/cyrus_imapd/trunk/files/cswcyrus
    csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus.conf
    csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus_imapd.changelog.CSW
    csw/mgar/pkg/cyrus_imapd/trunk/files/imapd.conf

Added Paths:
-----------
    csw/mgar/pkg/cyrus_imapd/trunk/files/0002-fix-config2header.patch

Modified: csw/mgar/pkg/cyrus_imapd/trunk/Makefile
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/Makefile	2010-11-28 19:35:29 UTC (rev 11741)
+++ csw/mgar/pkg/cyrus_imapd/trunk/Makefile	2010-11-29 22:21:53 UTC (rev 11742)
@@ -33,7 +33,7 @@
 
 SPKG_DESC_CSWcyrusimapd = Pop and Imap server from the Cyrus mail system
 CATALOGNAME_CSWcyrusimapd = cyrus_imapd
-RUNTIME_DEP_PKGS_CSWcyrusimapd = CSWosslrt CSWsasl CSWbdb42 CSWkrb5lib CSWnetsnmp CSWpcrert CSWzlib
+RUNTIME_DEP_PKGS_CSWcyrusimapd = CSWosslrt CSWsasl CSWbdb42 CSWkrb5lib CSWnetsnmp CSWpcrert CSWzlib CSWtcpwrap
 #SPKG_CLASSES_CSWcyrusimapd = none services cswpreserveconf cswinitsmf
 
 SPKG_DESC_CSWcyrusimapdutils = Various admin utilities for Cyrus Imapd/Popd
@@ -46,56 +46,33 @@
 RUNTIME_DEP_PKGS_CSWpmcyrus = CSWperl CSWbdb42 CSWosslrt CSWsasl CSWzlib
 #SPKG_CLASSES_CSWpmcyrus = none
 
-PKGFILES_CSWcyrusimapd = $(sbindir)/arbitronsort 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyrus-dohash 
-PKGFILES_CSWcyrusimapd += $(sbindir)/masssievec 
-PKGFILES_CSWcyrusimapd += $(sbindir)/migrate-metadata 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyrus-mkdirs 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyrus-mknewsgroups 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyrus-rehash 
-PKGFILES_CSWcyrusimapd += $(sbindir)/translatesieve 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyrus-undohash 
-PKGFILES_CSWcyrusimapd += $(sbindir)/sievec 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyrus-master 
-PKGFILES_CSWcyrusimapd += $(sbindir)/make_md5 
-PKGFILES_CSWcyrusimapd += $(sbindir)/make_sha1 
-PKGFILES_CSWcyrusimapd += $(sbindir)/reconstruct 
-PKGFILES_CSWcyrusimapd += $(sbindir)/quota 
-PKGFILES_CSWcyrusimapd += $(sbindir)/ipurge 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyrdump 
-PKGFILES_CSWcyrusimapd += $(sbindir)/chk_cyrus 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cvt_cyrusdb 
-PKGFILES_CSWcyrusimapd += $(sbindir)/deliver 
-PKGFILES_CSWcyrusimapd += $(sbindir)/ctl_mboxlist 
-PKGFILES_CSWcyrusimapd += $(sbindir)/ctl_deliver 
-PKGFILES_CSWcyrusimapd += $(sbindir)/ctl_cyrusdb 
-PKGFILES_CSWcyrusimapd += $(sbindir)/squatter 
-PKGFILES_CSWcyrusimapd += $(sbindir)/mbexamine 
-PKGFILES_CSWcyrusimapd += $(sbindir)/mbpath 
-PKGFILES_CSWcyrusimapd += $(sbindir)/cyr_expire 
-PKGFILES_CSWcyrusimapd += $(sbindir)/arbitron 
-PKGFILES_CSWcyrusimapd += $(sbindir)/tls_prune
+PKGFILES_CSWcyrusimapd = $(sbindir)/.*
 PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus
 PKGFILES_CSWcyrusimapd += $(docdir)/cyrus_imapd/.*
 PKGFILES_CSWcyrusimapd += $(mandir)/man5/.*
 PKGFILES_CSWcyrusimapd += $(mandir)/man8/.*
-PKGFILES_CSWcyrusimapd += $(libexecdir)/cyrus
+PKGFILES_CSWcyrusimapd += $(libexecdir)/cyrus.*
 PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus/imapd.conf.CSW
 PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus/cyrus.conf.CSW
-PKGFILES_CSWcyrusimapd += $(localstatedir)/cyrus
-PKGFILES_CSWcyrusimapd += $(sysconfdir)/init.d/cswcyrus
-PKGFILES_CSWcyrusimapd += $(localstatedir)/svc/manifest/network/cswcyrus.xml
+PKGFILES_CSWcyrusimapd += /etc$(prefix)/init.d/cswcyrus
+PKGFILES_CSWcyrusimapd += /var/$(prefix)/svc/manifest/network/cswcyrus.xml
+PKGFILES_CSWcyrusimapd += $(localstatedir)/cyrus.*
 
+PROTOTYPE_MODIFIERS = cyrusdir
+PROTOTYPE_FILES_cyrusdir = $(localstatedir)/cyrus.*
+PROTOTYPE_USER_cyrusdir = cyrus
+PROTOTYPE_GROUP_cyrusdir = mail
+
 PRESERVECONF = $(sysconfdir)/cyrus/imapd.conf
 PRESERVECONF += $(sysconfdir)/cyrus/cyrus.conf
-INITSMF = $(sysconfdir)/init.d/cswcyrus
-ETCSERVICES = /etc/opt/csw/pkg/CSWcyrusimapd/services
+INITSMF = /etc$(prefix)/init.d/cswcyrus
+ETCSERVICES = /etc/$(prefix)/pkg/CSWcyrusimapd/services
 
 LICENSE = COPYRIGHT
 
 PKGFILES_CSWcyrusimapdutils = $(bindir)/.*
-PKGFILES_CSWcyrusimapd += $(mandir)/man1/.*
-PKGFILES_CSWcyrusimapd += $(docdir)/cyrus_imapd_utils/.*
+PKGFILES_CSWcyrusimapdutils += $(mandir)/man1/.*
+PKGFILES_CSWcyrusimapdutils += $(docdir)/cyrus_imapd_utils/.*
 
 PKGFILES_CSWpmcyrus = $(perllib)/.*
 PKGFILES_CSWpmcyrus += $(mandir)/man3/Cyrus::.*
@@ -123,6 +100,9 @@
 DISTFILES += cyrus_imapd_utils.changelog.CSW
 DISTFILES += pm_cyrus.changelog.CSW
 
+# We move from /opt/csw/{etc,var} to /{etc,var}/opt/csw
+MIGRATE_FILES_CSWcyrusimapd = cyrus
+
 # compile_et is not provided by krb5lib_dev so we must provide our own version
 # taken from the krb5 source.
 DISTFILES += compile_et et_c.awk et_h.awk
@@ -163,6 +143,11 @@
 
 ##### Build and installation information #####
 
+# to support shared /opt/csw setup
+# see http://wiki.opencsw.org/shared-opt-csw-setup
+localstatedir   = /var$(prefix)
+sysconfdir      = /etc$(prefix)
+
 CONFIGURE_ARGS = $(DIRPATHS)
 CONFIGURE_ARGS += --with-cyrus-prefix=$(prefix)
 CONFIGURE_ARGS += --with-service-path=$(libexecdir)/cyrus 
@@ -185,6 +170,8 @@
 
 TEST_SCRIPTS = 
 
+CYRUS_DAEMONS = fud idled imapd lmtpd lmtpproxyd mupdate notifyd pop3d pop3proxyd proxyd sieved smmapd timsieved
+
 include gar/category.mk
 
 # compile_et is missing so we want our to be used
@@ -233,18 +220,25 @@
 	ginstall -D "$(WORKDIR_FIRSTMOD)/cyrus.conf" "$(PKGROOT)/$(sysconfdir)/cyrus/cyrus.conf.CSW"
 
 	( cd "$(PKGROOT)$(libexecdir)/cyrus/" && \
-		for E in sievec cyrus-master make_md5 make_sha1 \
-			reconstruct quota ipurge cyrdump chk_cyrus \
-			cvt_cyrusdb deliver ctl_mboxlist ctl_deliver \
-			ctl_cyrusdb squatter mbexamine mbpath cyr_expire \
-			arbitron tls_prune; do \
-			mv -f $$E ../../sbin/$$E && ln -sf ../../sbin/$$E; \
+		for E in *; do \
+			echo $(CYRUS_DAEMONS) | grep -w $$E >/dev/null && continue; \
+			[ -L $$E ] || ( mv -f $$E ../../sbin/$$E && ln -sf ../../sbin/$$E ); \
 		done )
-
+	
+	# let's create the directory structure where mails 
+	# and other cyrus stuffs will be stored
+	for D in sieve config/proc config/db config/socket config/log \
+		config/msg config/ptclient mail mail/stage.; do \
+		mkdir -p "$(PKGROOT)/$(localstatedir)/cyrus/$$D"; \
+	done
+	
 	# we install binary under tools as part of the package
 	cp -r $(WORKSRC_FIRSTMOD)/tools/* $(PKGROOT)$(sbindir)
-	ginstall -D $(PKGROOT)$(sbindir)/arbitronsort.pl $(PKGROOT)$(sbindir)/arbitronsort
-
+	[ -f "$(PKGROOT)$(sbindir)/arbitronsort.pl" ] && mv "$(PKGROOT)$(sbindir)/arbitronsort.pl" "$(PKGROOT)$(sbindir)/arbitronsort"
+	for F in config2header config2man not-mkdep migrate-metadata mupdate-loadgen.pl upgradesieve convert-sieve.pl; do \
+		rm -f $(PKGROOT)$(sbindir)/$$F; \
+	done
+	
 	# we want perl script to use opencsw perl
 	perl -pi -e 's/exec\s+perl/exec \/opt\/csw\/bin\/perl/g' $(PKGROOT)$(sbindir)/* $(PKGROOT)$(bindir)/*
 	( for FILE in convert-sieve.pl mupdate-loadgen.pl translatesieve undohash upgradesieve arbitronsort; do \
@@ -259,9 +253,9 @@
 	  done )
 
 	# we rename some tools with too generic names
-	ginstall -D $(PKGROOT)/$(sbindir)/mkimap $(PKGROOT)/$(sbindir)/mkdirs
+	mv $(PKGROOT)/$(sbindir)/mkimap $(PKGROOT)/$(sbindir)/mkdirs
 	( for FILE in mkdirs mknewsgroups dohash undohash rehash; do \
-		ginstall -D $(PKGROOT)/$(sbindir)/$$FILE $(PKGROOT)/$(sbindir)/cyrus-$$FILE; \
+		mv $(PKGROOT)/$(sbindir)/$$FILE $(PKGROOT)/$(sbindir)/cyrus-$$FILE; \
 	  done )
 	
 	# we fix some permission problems
@@ -269,5 +263,7 @@
 
 	# let's remove pod files
 	gfind $(PKGROOT)$(perllib) -name "perllocal.pod" -exec rm '{}' ';'
+	# and CVS directories
+	 gfind $(PKGROOT) -type d -depth -name "CVS" -exec rm -rf '{}' ';'
 	
 	@$(MAKECOOKIE)

Added: csw/mgar/pkg/cyrus_imapd/trunk/files/0002-fix-config2header.patch
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/files/0002-fix-config2header.patch	                        (rev 0)
+++ csw/mgar/pkg/cyrus_imapd/trunk/files/0002-fix-config2header.patch	2010-11-29 22:21:53 UTC (rev 11742)
@@ -0,0 +1,12 @@
+diff --speed-large-files --minimal -Nru ./tools/config2header ./tools/config2header.new
+--- ./tools/config2header	Sat Nov 20 00:11:21 2010
++++ ./tools/config2header.new	Sat Nov 20 00:11:11 2010
+@@ -71,7 +71,7 @@
+ # Look for CC=xxx "assigments" in the argument list.
+ #
+ while ($#ARGV >= 0) {
+-	last unless ($ARGV[0] =~ m/^(\S+)=(\S+)$/);
++	last unless ($ARGV[0] =~ m/^(\S+)=(.+)$/);
+ 	eval "\$$1='$2';";
+ 	die "$@" if ($@);
+ 	shift @ARGV;

Modified: csw/mgar/pkg/cyrus_imapd/trunk/files/CSWcyrusimapd.preinstall
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/files/CSWcyrusimapd.preinstall	2010-11-28 19:35:29 UTC (rev 11741)
+++ csw/mgar/pkg/cyrus_imapd/trunk/files/CSWcyrusimapd.preinstall	2010-11-29 22:21:53 UTC (rev 11742)
@@ -4,9 +4,9 @@
 if [ $? -ne 0 ] ; then
         echo "Creating cyrus user..."
         if [ -n "${BASEDIR}" ]; then
-                chroot ${BASEDIR} /usr/sbin/useradd -d /opt/csw/var/cyrus -g mail -c "Cyrus user" $CYRUS_USER
+                chroot ${BASEDIR} /usr/sbin/useradd -d /var/opt/csw/cyrus -g mail -c "Cyrus user" $CYRUS_USER
         else
-                /usr/sbin/useradd -d /opt/csw/var/cyrus -g mail -c "Cyrus user" $CYRUS_USER
+                /usr/sbin/useradd -d /var/opt/csw/cyrus -g mail -c "Cyrus user" $CYRUS_USER
         fi
 fi
 

Modified: csw/mgar/pkg/cyrus_imapd/trunk/files/README.CSW
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/files/README.CSW	2010-11-28 19:35:29 UTC (rev 11741)
+++ csw/mgar/pkg/cyrus_imapd/trunk/files/README.CSW	2010-11-29 22:21:53 UTC (rev 11742)
@@ -4,8 +4,8 @@
 
 - Cyrus configuration
 
-Rename /opt/csw/etc/cyrus/imapd.conf.CSW to /opt/csw/etc/cyrus/imapd.conf and
- /opt/csw/etc/cyrus/cyrus.conf.CSW to /opt/csw/etc/cyrus/cyrus.conf
+Rename /etc/opt/csw/cyrus/imapd.conf.CSW to /etc/opt/csw/cyrus/imapd.conf and
+ /etc/opt/csw/cyrus/cyrus.conf.CSW to /etc/opt/csw/cyrus/cyrus.conf
 and customize these files according to your needs.
 
 Warning: daemons which can only be launched from the master process live in
@@ -29,24 +29,24 @@
 	- configure it
 	- launch the daemon, /etc/init.d/cswsaslauthd start
 	- add the cyrus user to the sasl group, usermod -G sasl cyrus
-	- launch or relaunch cyrus, /etc/init.d/cswcyrus start
+	- launch or relaunch cyrus, /etc/init.d/cswcyrus start or svcadm restart cswcyrus
 
 Authentication should be working.
 
 You can also directly use Cyrus Imap directly with berkeleydb (or mysql, or postgres) 
 user databases. You must then change the sasl_pwcheck_method parameter to auxprop
-in /opt/csw/etc/cyrus/imapd.conf, but remember that Cyrus runs as the cyrus user, so
+in /etc/opt/csw/cyrus/imapd.conf, but remember that Cyrus runs as the cyrus user, so
 for example, berkeleydb databases files will have to be readable by the cyrus user.
 
 
 - Enable SSL/TLS
 
 To enable ssl and tls for Imap/Pop/..., create the certificate and fill accordingly the 
-paramaters tls_cert_file and tls_key_file in /opt/csw/etc/cyrus/imapd.conf.
+paramaters tls_cert_file and tls_key_file in /etc/opt/csw/cyrus/imapd.conf.
 You can use different certificates for each service by using parameters <service>_tls_cert_file 
 and <service>_tls_key_file (imap_tls_cert_file, pop3_tls_key_file, imaps_tls_key_file, ...).
 
-Then for ssl, also uncomment the lines concerning pops and imaps in /opt/csw/etc/cyrus/cyrus.conf
+Then for ssl, also uncomment the lines concerning pops and imaps in /etc/opt/csw/cyrus/cyrus.conf
 
 
 - Configure Sendmail to deliver to cyrus mailboxes
@@ -54,7 +54,7 @@
 You will have to add the following lines in  sendmail.mc:
 
 define(`confLOCAL_MAILER', `cyrusv2')dnl
-define(`CYRUSV2_MAILER_ARGS', `FILE /opt/csw/var/cyrus/config/socket/lmtp')dnl
+define(`CYRUSV2_MAILER_ARGS', `FILE /var/opt/csw/cyrus/config/socket/lmtp')dnl
 MAILER(`cyrusv2')dnl
 
 
@@ -63,7 +63,7 @@
 
 define(`CYRUSV2_MAILER_ARGS', `TCP name_of_the_cyrus_host lmtp')dnl
 
-and enable lmtp tcp listening by uncommenting this line in /opt/csw/etc/cyrus/cyrus.conf:
+and enable lmtp tcp listening by uncommenting this line in /etc/opt/csw/cyrus/cyrus.conf:
 
 lmtp         cmd="lmtpd" listen="lmtp" prefork=0
 
@@ -102,7 +102,7 @@
    available in the Fedora Core package and own-made.
    These patches make Cyrus more tolerant with non-standard emails sent by a lot of bad 
    mail user agent, they allow respectively to accept 8bits characters in header 
-   (configurable in /opt/csw/etc/cyrus/imapd.conf), to accept email with colon-less From 
+   (configurable in /etc/opt/csw/cyrus/imapd.conf), to accept email with colon-less From 
    ("From john at doe") header and to allow email with a bare newline in it.
  
  

Modified: csw/mgar/pkg/cyrus_imapd/trunk/files/cswcyrus
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/files/cswcyrus	2010-11-28 19:35:29 UTC (rev 11741)
+++ csw/mgar/pkg/cyrus_imapd/trunk/files/cswcyrus	2010-11-29 22:21:53 UTC (rev 11742)
@@ -15,7 +15,7 @@
 PID_FILE="/var/run/cyrus-master.pid"
 COMMAND=/opt/csw/sbin/cyrus-master
 
-[ -f /opt/csw/etc/cyrus/cyrus.conf ] || exit 0
+[ -f /etc/opt/csw/cyrus/cyrus.conf ] || exit 0
 
 check_proc ()
 {

Modified: csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus.conf
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus.conf	2010-11-28 19:35:29 UTC (rev 11741)
+++ csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus.conf	2010-11-29 22:21:53 UTC (rev 11742)
@@ -23,10 +23,10 @@
 
   # at least one LMTP is required for delivery
 #  lmtp		cmd="lmtpd" listen="lmtp" prefork=0
-  lmtpunix	cmd="lmtpd" listen="/opt/csw/var/cyrus/config/socket/lmtp" prefork=1
+  lmtpunix	cmd="lmtpd" listen="/var/opt/csw/cyrus/config/socket/lmtp" prefork=1
 
   # this is only necessary if using notifications
-#  notify	cmd="notifyd" listen="/opt/csw/var/cyrus/config/socket/notify" proto="udp" prefork=1
+#  notify	cmd="notifyd" listen="/var/opt/csw/cyrus/config/socket/notify" proto="udp" prefork=1
 }
 
 EVENTS {

Modified: csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus_imapd.changelog.CSW
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus_imapd.changelog.CSW	2010-11-28 19:35:29 UTC (rev 11741)
+++ csw/mgar/pkg/cyrus_imapd/trunk/files/cyrus_imapd.changelog.CSW	2010-11-29 22:21:53 UTC (rev 11742)
@@ -1,7 +1,8 @@
 cyrus_imapd (2.3.16,REV=2010.11.21) unstable
 
   * Added missing zlib dependancy.
-  * Removed useless tcpwrap depandancy.
+  * Moved configuration from /opt/csw/etc/cyrus to /etc/opt/csw/cyrus/.
+  * Moved default cyrus directiry from /opt/csw/var/cyrus to /var/opt/csw/cyrus.
   * [gar] switched do dynamic prototype.
 
  -- Yann Rouillard <yann at opencsw.org>  Sun, 21 Nov 2010 15:25:09 +0100

Modified: csw/mgar/pkg/cyrus_imapd/trunk/files/imapd.conf
===================================================================
--- csw/mgar/pkg/cyrus_imapd/trunk/files/imapd.conf	2010-11-28 19:35:29 UTC (rev 11741)
+++ csw/mgar/pkg/cyrus_imapd/trunk/files/imapd.conf	2010-11-29 22:21:53 UTC (rev 11742)
@@ -1,12 +1,12 @@
 # The path where cyrus store its database files for
 # mailboxes list, seen states, folder subscription lists, ...
-configdirectory: /opt/csw/var/cyrus/config
+configdirectory: /var/opt/csw/cyrus/config
 
 # The path where cyrus will store inboxes and folders
-partition-default: /opt/csw/var/cyrus/mail
+partition-default: /var/opt/csw/cyrus/mail
 
 # The path where cyrus store sieve filters
-sievedir: /opt/csw/var/cyrus/sieve
+sievedir: /var/opt/csw/cyrus/sieve
 
 # Names of admins user who will have right to delete and 
 # change acls of any mailboxes


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list