1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

root/csw/mgar/pkg/cyrus_imapd/trunk/Makefile

Revision 16916, 15.8 KB (checked in by dmichelsen, 4 months ago)

WHOLE TREE: Explicitly set GARTYPE to current default 'v2'

Line 
1#####################################################################
2# OpenCSW build recipe for Cyrus Imap
3#
4# Copyright 2009 Yann Rouillard <yann@pleiades.fr.eu.org>
5# All rights reserved.  Use is subject to license terms.
6#
7# Redistribution and/or use, with or without modification, is
8# permitted.  This software is without warranty of any kind.  The
9# author(s) shall not be liable in the event that use of the
10# software causes damage.
11#####################################################################
12
13###### Package information #######
14
15NAME = cyrus_imapd
16VERSION = 2.4.10
17CATEGORIES = server
18GARTYPE = v2
19
20DESCRIPTION = Pop and Imap server from the Cyrus mail system
21define BLURB
22  The Cyrus IMAP server is generally intended to be run on sealed systems,
23  where normal users are not permitted to log in. The mailbox database is
24  stored in parts of the filesystem that are private to Cyrus. All user
25  access to mail is through the IMAP, POP3, or KPOP protocols. The private
26  mailbox database design gives the server large advantages in efficiency,
27  scalability, and administratability. Multiple concurrent read/write
28  connections to the same mailbox are permitted. The server supports access
29  control lists on mailboxes and storage quotas on mailbox hierarchies,
30  multiple SASL mechanisms, and the Sieve mail filtering language.
31endef
32
33PACKAGES = CSWcyrusimapd CSWcyrusimapdutils CSWpmcyrus
34
35SPKG_DESC_CSWcyrusimapd = Pop and Imap server from the Cyrus mail system
36CATALOGNAME_CSWcyrusimapd = cyrus_imapd
37PKGFILES_CSWcyrusimapd = $(sbindir)/.*
38PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus
39PKGFILES_CSWcyrusimapd += $(docdir)/cyrus_imapd/.*
40PKGFILES_CSWcyrusimapd += $(mandir)/man5/.*
41PKGFILES_CSWcyrusimapd += $(mandir)/man1m/.*
42PKGFILES_CSWcyrusimapd += $(libexecdir)/cyrus.*
43PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus/imapd.conf.CSW
44PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus/cyrus.conf.CSW
45PKGFILES_CSWcyrusimapd += /etc$(prefix)/init.d/cswcyrus
46PKGFILES_CSWcyrusimapd += /var$(prefix)/svc/manifest/network/cswcyrus\.xml
47PKGFILES_CSWcyrusimapd += $(localstatedir)/cyrus.*
48RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWbdb48
49RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibcom-err3
50RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibgssapi-krb5-2
51RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibk5crypto3
52RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibkrb5-3
53RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibkrb5support0
54RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibpcre0
55RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibpcreposix0
56RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibwrap1
57RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibz1
58RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWnetsnmp
59RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWosslrt
60RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibsasl2-2
61
62# Expected catalogname: cyrusimapd, not cyrus_imapd
63CHECKPKG_OVERRIDES_CSWcyrusimapd += catalogname-does-not-match-pkgname
64
65SPKG_DESC_CSWcyrusimapdutils = Various admin utilities for Cyrus Imapd/Popd
66CATALOGNAME_CSWcyrusimapdutils = cyrus_imapd_utils
67PKGFILES_CSWcyrusimapdutils = $(bindir)/.*
68PKGFILES_CSWcyrusimapdutils += $(mandir)/man1/.*
69PKGFILES_CSWcyrusimapdutils += $(docdir)/cyrus_imapd_utils/.*
70RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWbdb48
71RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibcom-err3
72RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibgssapi-krb5-2
73RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibk5crypto3
74RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibkrb5-3
75RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibkrb5support0
76RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibpcre0
77RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibpcreposix0
78RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibz1
79RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWosslrt
80RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibsasl2-2
81# Expected catalogname: cyrusimapdutils, not cyrus_imapd_utils
82CHECKPKG_OVERRIDES_CSWcyrusimapdutils += catalogname-does-not-match-pkgname
83
84SPKG_DESC_CSWpmcyrus = Perl interface to Cyrus Imap functions
85CATALOGNAME_CSWpmcyrus = pm_cyrus
86PKGFILES_CSWpmcyrus = $(perllib)/.*
87PKGFILES_CSWpmcyrus += $(mandir)/man3/Cyrus::.*
88PKGFILES_CSWpmcyrus += $(docdir)/pm_cyrus/.*
89RUNTIME_DEP_PKGS_CSWpmcyrus += CSWbdb48
90RUNTIME_DEP_PKGS_CSWpmcyrus += CSWlibz1
91RUNTIME_DEP_PKGS_CSWpmcyrus += CSWosslrt
92RUNTIME_DEP_PKGS_CSWpmcyrus += CSWperl
93RUNTIME_DEP_PKGS_CSWpmcyrus += CSWlibsasl2-2
94
95PROTOTYPE_MODIFIERS = cyrusdir
96PROTOTYPE_FILES_cyrusdir = $(localstatedir)/cyrus.*
97PROTOTYPE_USER_cyrusdir = cyrus
98PROTOTYPE_GROUP_cyrusdir = mail
99
100PRESERVECONF = $(sysconfdir)/cyrus/imapd.conf
101PRESERVECONF += $(sysconfdir)/cyrus/cyrus.conf
102INITSMF = /etc$(prefix)/init.d/cswcyrus
103ETCSERVICES = /etc/$(prefix)/pkg/CSWcyrusimapd/services
104
105LICENSE = COPYRIGHT
106
107CHECKPKG_OVERRIDES_CSWcyrusimapdutils += surplus-dependency|CSWpmcyrus
108
109# it's just the path to the dtd file
110CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/share|root/var/opt/csw/svc/manifest/network/cswcyrus.xml
111
112# Just a reference to gdb path given in a example
113CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/man/imapd.conf.5.html
114CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/man/man5/imapd.conf.5
115
116# just examples
117CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/install-configure.html
118CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/install-compile.html
119CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/install-testing.html
120CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/text/install-configure
121CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/text/install-testing
122CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/text/install-compile
123
124# We will not fix this today
125CHECKPKG_OVERRIDES_CSWpmcyrus += catalogname-does-not-match-pkgname|pkgname=CSWpmcyrus|catalogname=pm_cyrus|expected-catalogname=pmcyrus
126CHECKPKG_OVERRIDES_CSWcyrusimapdutils += catalogname-does-not-match-pkgname|pkgname=CSWcyrusimapdutils|catalogname=cyrus_imapd_utils|expected-catalogname=cyrusimapdutils
127CHECKPKG_OVERRIDES_CSWcyrusimapd += catalogname-does-not-match-pkgname|pkgname=CSWcyrusimapd|catalogname=cyrus_imapd|expected-catalogname=cyrusimapd
128
129
130
131###### Upstream and opencsw files information #######
132
133MASTER_SITES = ftp://ftp.cyrusimap.org/cyrus-imapd/ http://email.uoa.gr/download/cyrus/cyrus-imapd-$(VERSION)/ http://www.vx.sk/download/patches/cyrus-imapd/
134UPSTREAM_MASTER_SITES = ftp://ftp.cyrusimap.org/cyrus-imapd/
135
136DISTNAME = $(shell echo $(NAME) | tr '_' '-')-$(VERSION)
137
138DISTFILES  = $(DISTNAME).tar.gz
139DISTFILES += CSWcyrusimapd.preinstall CSWcyrusimapd.checkinstall
140DISTFILES += cyrus_imapd.changelog.CSW README.CSW
141DISTFILES += services
142DISTFILES += cswcyrus cswcyrus.xml
143DISTFILES += imapd.conf cyrus.conf
144
145DISTFILES += cyrus_imapd_utils.changelog.CSW
146DISTFILES += pm_cyrus.changelog.CSW
147
148# We move from /opt/csw/{etc,var} to /{etc,var}/opt/csw
149MIGRATE_FILES_CSWcyrusimapd = cyrus.conf imapd.conf
150MIGRATE_SOURCE_DIR = $(prefix)/etc/cyrus
151MIGRATE_DEST_DIR = $(sysconfdir)/cyrus
152
153
154
155# compile_et is not provided by krb5lib_dev so we must provide our own version
156# taken from the krb5 source.
157DISTFILES += compile_et et_c.awk et_h.awk
158
159# University of Athens patchs to allow autocreation of mailboxes
160# and autocreation of sub-lolders for filter rules
161#PATCHFILES = cyrus-imapd-$(VERSION)-autocreate-0.10-0.diff cyrus-imapd-$(VERSION)-autosieve-0.6.0.diff
162PATCHFILES = cyrus-imapd-2.4.4-autocreate-0.10-0.patch cyrus-imapd-2.4.4-autosieve-0.6.0.patch
163
164# This patch makes cyrus more tolerant with mails containing
165# invalid From headers
166# This avoids "Invalid Message header" error messages
167#PATCHFILES += cyrus-imapd-acceptinvalidfrom.patch
168
169# This patch makes cyrus more tolerant with mails containing
170# contains bare newlines
171PATCHFILES += cyrus-imapd-2.3.7-nobarenewlinescheck.patch
172
173# the default value for allowplaintext changed since 2.3.9
174# we restore the previous default value to avoid upgrade problem
175PATCHFILES += restore_allowplaintext_default.patch
176
177# Make sure the module is self contained. This fixes bug
178#   <http://www.opencsw.org/mantis/view.php?id=3766>
179PATCHFILES += 0001-Force-linkage-to-libperl.so.patch
180
181# Fix config2header so it works with argument like
182# "CC=/path/to/CC arg1 arg2"
183# mandatory to work with assignment like
184# "CC="/opt/SUNWspro/bin/cc -xrunpath"
185PATCHFILES += 0002-fix-config2header.patch
186
187# Changes location of imapd.conf from /etc/imapd.conf to
188# /etc/opt/csw/cyrus/imapd.conf in mkimap (mkdirs)
189PATCHFILES += cyrus-imapd-fix-path-in-mkimap.patch
190
191# cyradmrc.pl should be in /etc/opt/csw/etc/cyrus, not in /usr/local/etc/
192PATCHFILES += cyradmrc.pl-path-modification.patch
193
194#GARCOMPILER = GNU
195#GNU_CC_OPT = -g
196#GNU_LD_OPT = -g
197
198##### Build and installation information #####
199
200# to support shared /opt/csw setup
201# see http://wiki.opencsw.org/shared-opt-csw-setup
202localstatedir   = /var$(prefix)
203sysconfdir      = /etc$(prefix)
204
205CONFIGURE_ARGS = $(DIRPATHS)
206CONFIGURE_ARGS += --with-cyrus-prefix=$(prefix)
207CONFIGURE_ARGS += --with-service-path=$(libexecdir)/cyrus
208CONFIGURE_ARGS += --sysconfdir=$(sysconfdir)/cyrus
209CONFIGURE_ARGS += --with-bdb=db-4.8
210CONFIGURE_ARGS += --with-bdb-libdir=$(prefix)/bdb48/lib
211CONFIGURE_ARGS += --with-bdb-incdir=$(prefix)/bdb48/include
212CONFIGURE_ARGS += --with-openssl=$(prefix)
213CONFIGURE_ARGS += --with-sasl=$(prefix)
214CONFIGURE_ARGS += --with-perl=$(prefix)/bin/perl
215CONFIGURE_ARGS += --enable-idled
216CONFIGURE_ARGS += --enable-murder
217CONFIGURE_ARGS += --enable-replication
218CONFIGURE_ARGS += --with-snmp=$(prefix)
219CONFIGURE_ARGS += --with-libwrap=$(prefix)
220CONFIGURE_ARGS += --disable-nntp
221
222# To link against BerkeleyDB 4.8 explicitly
223EXTRA_LINKER_FLAGS = -R$(prefix)/bdb48/lib/\$$ISALIST
224LD_OPTIONS += -R$(prefix)/bdb48/lib/\$$ISALIST
225
226# we add the args so perl libraries are installed
227# in the correct path
228INSTALL_ARGS = INSTALLDIRS=vendor
229
230TEST_SCRIPTS =
231
232CYRUS_DAEMONS = fud idled imapd lmtpd lmtpproxyd mupdate notifyd pop3d pop3proxyd proxyd sieved smmapd timsieved
233
234include gar/category.mk
235
236# compile_et is missing so we want our to be used
237CONFIGURE_ENV += COMPILE_ET="$(CURDIR)/files/compile_et -d $(CURDIR)/files/"
238
239pre-configure-modulated:
240        # master is a too common name, so we rename it cyrus-master
241        cp $(WORKSRC)/man/master.8 $(WORKSRC)/man/cyrus-master.8
242        cp $(WORKSRC)/doc/man/master.8.html $(WORKSRC)/doc/man/cyrus-master.8.html
243        find $(WORKSRC)/doc/ -type f -exec perl -pi -e 's/(cyrus-)?master/cyrus-master/g' '{}' ';'
244        find $(WORKSRC)/man/ -type f -exec perl -pi -e 's/(cyrus-)?master/cyrus-master/g' '{}' ';'
245        perl -pi -e 's/(cyrus-)?master/cyrus-master/' $(WORKSRC)/master/Makefile.in
246        #  we delete autogenerated error files to force regeneration
247        # find $(WORKSRC) \( -name "*_err.c" -o -name "*_err.h" \) ! -name "com_err.*" -exec rm {} \;
248        @$(MAKECOOKIE)
249
250post-build-modulated:
251        # we change /etc reference to /opt/csw/etc in doc and scripts,
252        # except the sasldb2 path
253        ( cd $(WORKSRC); \
254        find man doc tools -type f -exec perl -pi -e 's/\/etc\//\/opt\/csw\/etc\/cyrus\//g' '{}' ';'; \
255        find doc -type f -exec perl -pi -e 's/\/opt\/csw\/etc\/cyrus\/sasldb2/\/opt\/csw\/etc\/sasldb2/g' '{}' ';')
256        @$(MAKECOOKIE)
257
258pre-merge:
259        # we must create the directory where perl libraries will be installed
260        mkdir -p $(PKGROOT)/$(prefix)/lib/perl
261        mkdir -p $(PKGROOT)/$(sbindir)
262        mkdir -p $(PKGROOT)/$(sysconfdir)/cyrus
263        mkdir -p $(PKGROOT)/$(prefix)/share/doc/cyrus_imapd
264        @$(MAKECOOKIE)
265
266post-merge: install-tools cyrus-rename install-docs libexec-in-sbin install-cyrus-directory install-additional-files fix2build move-man8
267
268
269# Let's install the files
270install-additional-files:
271        # we provide our class action scripts to modify /etc/inet/services
272        ginstall -D $(WORKDIR_FIRSTMOD)/services $(PKGROOT)/etc/opt/csw/pkg/CSWcyrusimapd/services
273        # configuration and init file installation
274        ginstall -D "$(WORKDIR_FIRSTMOD)/cswcyrus" "$(PKGROOT)/etc/opt/csw/init.d/cswcyrus"
275        ginstall -D "$(WORKDIR_FIRSTMOD)/cswcyrus.xml" "$(PKGROOT)/var/opt/csw/svc/manifest/network/cswcyrus.xml"
276        ginstall -D "$(WORKDIR_FIRSTMOD)/imapd.conf" "$(PKGROOT)/$(sysconfdir)/cyrus/imapd.conf.CSW"
277        ginstall -D "$(WORKDIR_FIRSTMOD)/cyrus.conf" "$(PKGROOT)/$(sysconfdir)/cyrus/cyrus.conf.CSW"
278        @$(MAKECOOKIE)
279
280
281# Some binaries put under libexec/cyrus should be put under sbin
282# to be more easily used
283libexec-in-sbin:
284        ( cd "$(PKGROOT)$(libexecdir)/cyrus/" && \
285                for E in *; do \
286                        echo $(CYRUS_DAEMONS) | grep -w $$E >/dev/null && continue; \
287                        [ -L $$E ] || ( mv -f $$E ../../sbin/$$E && ln -sf ../../sbin/$$E ); \
288                done )
289        @$(MAKECOOKIE)
290
291# let's create the directory structure where mails
292# and other cyrus stuffs will be stored
293install-cyrus-directory:
294        for D in sieve config/proc config/db config/socket config/log \
295                config/msg config/ptclient mail mail/stage.; do \
296                mkdir -p "$(PKGROOT)/$(localstatedir)/cyrus/$$D"; \
297        done
298        @$(MAKECOOKIE)
299
300# Some fixes and cleaning to correctly build the package
301fix2build:
302        # we fix some permission problems
303        chmod -R u+w "$(PKGROOT)/"
304        # let's remove pod files
305        gfind $(PKGROOT) -name "perllocal.pod" -delete
306        # and CVS directories
307        gfind $(PKGROOT) -depth -type d -name "CVS" -exec rm -rf '{}' ';'
308        # and orig files
309        gfind $(PKGROOT) -name "*.orig" -delete
310        # We remove fetchnews man and doc page as we did not build nntp support
311        # and as it clashes with leafnode
312        rm -f $(PKGROOT)$(mandir)/man8/fetchnews.8
313        rm -f $(PKGROOT)$(docdir)/cyrus_imapd/man/fetchnews.8.html
314        #gfind /home/yann/mgar/cyrus_imapd/trunk -name "*.orig" -delete
315
316
317# we rename some tools with too generic names
318cyrus-rename:
319# I don't think renaming mkimap is clever, the online documentation
320# refers to mkimap. Renaming it may confuse users --raos
321        mv $(PKGROOT)/$(sbindir)/mkimap $(PKGROOT)/$(sbindir)/mkdirs
322        ( for FILE in mkdirs mknewsgroups dohash undohash rehash; do \
323                mv $(PKGROOT)/$(sbindir)/$$FILE $(PKGROOT)/$(sbindir)/cyrus-$$FILE; \
324          done )
325        @$(MAKECOOKIE)
326
327
328# we install the documentation
329install-docs:
330        cp -r $(WORKSRC_FIRSTMOD)/doc/* $(PKGROOT)/$(docdir)/cyrus_imapd
331        ( for PKG in cyrus_imapd cyrus_imapd_utils pm_cyrus; do \
332                ginstall -D $(WORKDIR_FIRSTMOD)/$$PKG.changelog.CSW $(PKGROOT)/$(docdir)/$$PKG/changelog.CSW; \
333                ginstall -D $(WORKDIR_FIRSTMOD)/README.CSW $(PKGROOT)/$(docdir)/$$PKG/README.CSW; \
334          done )
335        # Fix path
336        gsed -i -e 's,/usr/local/cyrus/bin,$(sbindir),' $(PKGROOT)$(docdir)/cyrus_imapd/internal/replication_examples.html
337        @$(MAKECOOKIE)
338
339
340# we install binary under tools as part of the package
341install-tools:
342        cp -r $(WORKSRC_FIRSTMOD)/tools/* $(PKGROOT)$(sbindir)
343        [ -f "$(PKGROOT)$(sbindir)/arbitronsort.pl" ] && mv "$(PKGROOT)$(sbindir)/arbitronsort.pl" "$(PKGROOT)$(sbindir)/arbitronsort"
344        for F in config2header config2man not-mkdep migrate-metadata mupdate-loadgen.pl upgradesieve convert-sieve.pl; do \
345                rm -f $(PKGROOT)$(sbindir)/$$F; \
346        done
347        # we want perl scripts to use opencsw perl and paths
348        perl -pi -e 's/exec\s+perl/exec \/opt\/csw\/bin\/perl/g' $(PKGROOT)$(sbindir)/* $(PKGROOT)$(bindir)/*
349        ( for FILE in translatesieve undohash arbitronsort; do \
350            perl -pi -e 's/^#!\/usr\/(local\/)?bin\/perl/#!\/opt\/csw\/bin\/perl/' $(PKGROOT)$(sbindir)/$$FILE; \
351            done )
352        gsed -i -e 's,/usr/local/etc/,/etc/opt/csw/,' $(PKGROOT)$(libdir)/perl/csw/Cyrus/IMAP/Shell.pm
353        @$(MAKECOOKIE)
354
355# The manpages in 8 are moved to 1m, since cyrus' imapd(8) clashes
356# with courier's. In the future, this might be solved using
357# alternatives. See also
358# http://lists.opencsw.org/pipermail/maintainers/2012-January/015940.html
359move-man8:
360        [ -d $(PKGROOT)$(mandir)/man8 ] && mv $(PKGROOT)$(mandir)/man8 $(PKGROOT)$(mandir)/man1m
361        if [ -d $(PKGROOT)$(mandir)/man1m ] ; then \
362                for f in $(PKGROOT)$(mandir)/man1m/*.8 ; do \
363                        f_no_ext="`echo $$f | sed 's/\.8//'`" ; \
364                        gsed 's/^\(\.TH.*\)8\(.*\)/\11M\2/' $${f} > $${f_no_ext}.1m ; \
365                        rm $${f} ; \
366                done ; \
367        fi
368# fix references in man pages
369        find $(PKGROOT)$(mandir) -type f -exec gsed -i 's/(8)/(1m)/g' \{\} \;
370#       @$(MAKECOOKIE)
Note: See TracBrowser for help on using the browser.