| 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 | |
|---|
| 15 | NAME = cyrus_imapd |
|---|
| 16 | VERSION = 2.4.10 |
|---|
| 17 | CATEGORIES = server |
|---|
| 18 | GARTYPE = v2 |
|---|
| 19 | |
|---|
| 20 | DESCRIPTION = Pop and Imap server from the Cyrus mail system |
|---|
| 21 | define 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. |
|---|
| 31 | endef |
|---|
| 32 | |
|---|
| 33 | PACKAGES = CSWcyrusimapd CSWcyrusimapdutils CSWpmcyrus |
|---|
| 34 | |
|---|
| 35 | SPKG_DESC_CSWcyrusimapd = Pop and Imap server from the Cyrus mail system |
|---|
| 36 | CATALOGNAME_CSWcyrusimapd = cyrus_imapd |
|---|
| 37 | PKGFILES_CSWcyrusimapd = $(sbindir)/.* |
|---|
| 38 | PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus |
|---|
| 39 | PKGFILES_CSWcyrusimapd += $(docdir)/cyrus_imapd/.* |
|---|
| 40 | PKGFILES_CSWcyrusimapd += $(mandir)/man5/.* |
|---|
| 41 | PKGFILES_CSWcyrusimapd += $(mandir)/man1m/.* |
|---|
| 42 | PKGFILES_CSWcyrusimapd += $(libexecdir)/cyrus.* |
|---|
| 43 | PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus/imapd.conf.CSW |
|---|
| 44 | PKGFILES_CSWcyrusimapd += $(sysconfdir)/cyrus/cyrus.conf.CSW |
|---|
| 45 | PKGFILES_CSWcyrusimapd += /etc$(prefix)/init.d/cswcyrus |
|---|
| 46 | PKGFILES_CSWcyrusimapd += /var$(prefix)/svc/manifest/network/cswcyrus\.xml |
|---|
| 47 | PKGFILES_CSWcyrusimapd += $(localstatedir)/cyrus.* |
|---|
| 48 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWbdb48 |
|---|
| 49 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibcom-err3 |
|---|
| 50 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibgssapi-krb5-2 |
|---|
| 51 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibk5crypto3 |
|---|
| 52 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibkrb5-3 |
|---|
| 53 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibkrb5support0 |
|---|
| 54 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibpcre0 |
|---|
| 55 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibpcreposix0 |
|---|
| 56 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibwrap1 |
|---|
| 57 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibz1 |
|---|
| 58 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWnetsnmp |
|---|
| 59 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWosslrt |
|---|
| 60 | RUNTIME_DEP_PKGS_CSWcyrusimapd += CSWlibsasl2-2 |
|---|
| 61 | |
|---|
| 62 | # Expected catalogname: cyrusimapd, not cyrus_imapd |
|---|
| 63 | CHECKPKG_OVERRIDES_CSWcyrusimapd += catalogname-does-not-match-pkgname |
|---|
| 64 | |
|---|
| 65 | SPKG_DESC_CSWcyrusimapdutils = Various admin utilities for Cyrus Imapd/Popd |
|---|
| 66 | CATALOGNAME_CSWcyrusimapdutils = cyrus_imapd_utils |
|---|
| 67 | PKGFILES_CSWcyrusimapdutils = $(bindir)/.* |
|---|
| 68 | PKGFILES_CSWcyrusimapdutils += $(mandir)/man1/.* |
|---|
| 69 | PKGFILES_CSWcyrusimapdutils += $(docdir)/cyrus_imapd_utils/.* |
|---|
| 70 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWbdb48 |
|---|
| 71 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibcom-err3 |
|---|
| 72 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibgssapi-krb5-2 |
|---|
| 73 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibk5crypto3 |
|---|
| 74 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibkrb5-3 |
|---|
| 75 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibkrb5support0 |
|---|
| 76 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibpcre0 |
|---|
| 77 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibpcreposix0 |
|---|
| 78 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibz1 |
|---|
| 79 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWosslrt |
|---|
| 80 | RUNTIME_DEP_PKGS_CSWcyrusimapdutils += CSWlibsasl2-2 |
|---|
| 81 | # Expected catalogname: cyrusimapdutils, not cyrus_imapd_utils |
|---|
| 82 | CHECKPKG_OVERRIDES_CSWcyrusimapdutils += catalogname-does-not-match-pkgname |
|---|
| 83 | |
|---|
| 84 | SPKG_DESC_CSWpmcyrus = Perl interface to Cyrus Imap functions |
|---|
| 85 | CATALOGNAME_CSWpmcyrus = pm_cyrus |
|---|
| 86 | PKGFILES_CSWpmcyrus = $(perllib)/.* |
|---|
| 87 | PKGFILES_CSWpmcyrus += $(mandir)/man3/Cyrus::.* |
|---|
| 88 | PKGFILES_CSWpmcyrus += $(docdir)/pm_cyrus/.* |
|---|
| 89 | RUNTIME_DEP_PKGS_CSWpmcyrus += CSWbdb48 |
|---|
| 90 | RUNTIME_DEP_PKGS_CSWpmcyrus += CSWlibz1 |
|---|
| 91 | RUNTIME_DEP_PKGS_CSWpmcyrus += CSWosslrt |
|---|
| 92 | RUNTIME_DEP_PKGS_CSWpmcyrus += CSWperl |
|---|
| 93 | RUNTIME_DEP_PKGS_CSWpmcyrus += CSWlibsasl2-2 |
|---|
| 94 | |
|---|
| 95 | PROTOTYPE_MODIFIERS = cyrusdir |
|---|
| 96 | PROTOTYPE_FILES_cyrusdir = $(localstatedir)/cyrus.* |
|---|
| 97 | PROTOTYPE_USER_cyrusdir = cyrus |
|---|
| 98 | PROTOTYPE_GROUP_cyrusdir = mail |
|---|
| 99 | |
|---|
| 100 | PRESERVECONF = $(sysconfdir)/cyrus/imapd.conf |
|---|
| 101 | PRESERVECONF += $(sysconfdir)/cyrus/cyrus.conf |
|---|
| 102 | INITSMF = /etc$(prefix)/init.d/cswcyrus |
|---|
| 103 | ETCSERVICES = /etc/$(prefix)/pkg/CSWcyrusimapd/services |
|---|
| 104 | |
|---|
| 105 | LICENSE = COPYRIGHT |
|---|
| 106 | |
|---|
| 107 | CHECKPKG_OVERRIDES_CSWcyrusimapdutils += surplus-dependency|CSWpmcyrus |
|---|
| 108 | |
|---|
| 109 | # it's just the path to the dtd file |
|---|
| 110 | CHECKPKG_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 |
|---|
| 113 | CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/man/imapd.conf.5.html |
|---|
| 114 | CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/man/man5/imapd.conf.5 |
|---|
| 115 | |
|---|
| 116 | # just examples |
|---|
| 117 | CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/install-configure.html |
|---|
| 118 | CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/install-compile.html |
|---|
| 119 | CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/install-testing.html |
|---|
| 120 | CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/text/install-configure |
|---|
| 121 | CHECKPKG_OVERRIDES_CSWcyrusimapd += file-with-bad-content|/usr/local|root/opt/csw/share/doc/cyrus_imapd/text/install-testing |
|---|
| 122 | CHECKPKG_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 |
|---|
| 125 | CHECKPKG_OVERRIDES_CSWpmcyrus += catalogname-does-not-match-pkgname|pkgname=CSWpmcyrus|catalogname=pm_cyrus|expected-catalogname=pmcyrus |
|---|
| 126 | CHECKPKG_OVERRIDES_CSWcyrusimapdutils += catalogname-does-not-match-pkgname|pkgname=CSWcyrusimapdutils|catalogname=cyrus_imapd_utils|expected-catalogname=cyrusimapdutils |
|---|
| 127 | CHECKPKG_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 | |
|---|
| 133 | MASTER_SITES = ftp://ftp.cyrusimap.org/cyrus-imapd/ http://email.uoa.gr/download/cyrus/cyrus-imapd-$(VERSION)/ http://www.vx.sk/download/patches/cyrus-imapd/ |
|---|
| 134 | UPSTREAM_MASTER_SITES = ftp://ftp.cyrusimap.org/cyrus-imapd/ |
|---|
| 135 | |
|---|
| 136 | DISTNAME = $(shell echo $(NAME) | tr '_' '-')-$(VERSION) |
|---|
| 137 | |
|---|
| 138 | DISTFILES = $(DISTNAME).tar.gz |
|---|
| 139 | DISTFILES += CSWcyrusimapd.preinstall CSWcyrusimapd.checkinstall |
|---|
| 140 | DISTFILES += cyrus_imapd.changelog.CSW README.CSW |
|---|
| 141 | DISTFILES += services |
|---|
| 142 | DISTFILES += cswcyrus cswcyrus.xml |
|---|
| 143 | DISTFILES += imapd.conf cyrus.conf |
|---|
| 144 | |
|---|
| 145 | DISTFILES += cyrus_imapd_utils.changelog.CSW |
|---|
| 146 | DISTFILES += pm_cyrus.changelog.CSW |
|---|
| 147 | |
|---|
| 148 | # We move from /opt/csw/{etc,var} to /{etc,var}/opt/csw |
|---|
| 149 | MIGRATE_FILES_CSWcyrusimapd = cyrus.conf imapd.conf |
|---|
| 150 | MIGRATE_SOURCE_DIR = $(prefix)/etc/cyrus |
|---|
| 151 | MIGRATE_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. |
|---|
| 157 | DISTFILES += 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 |
|---|
| 162 | PATCHFILES = 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 |
|---|
| 171 | PATCHFILES += 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 |
|---|
| 175 | PATCHFILES += 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> |
|---|
| 179 | PATCHFILES += 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" |
|---|
| 185 | PATCHFILES += 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) |
|---|
| 189 | PATCHFILES += cyrus-imapd-fix-path-in-mkimap.patch |
|---|
| 190 | |
|---|
| 191 | # cyradmrc.pl should be in /etc/opt/csw/etc/cyrus, not in /usr/local/etc/ |
|---|
| 192 | PATCHFILES += 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 |
|---|
| 202 | localstatedir = /var$(prefix) |
|---|
| 203 | sysconfdir = /etc$(prefix) |
|---|
| 204 | |
|---|
| 205 | CONFIGURE_ARGS = $(DIRPATHS) |
|---|
| 206 | CONFIGURE_ARGS += --with-cyrus-prefix=$(prefix) |
|---|
| 207 | CONFIGURE_ARGS += --with-service-path=$(libexecdir)/cyrus |
|---|
| 208 | CONFIGURE_ARGS += --sysconfdir=$(sysconfdir)/cyrus |
|---|
| 209 | CONFIGURE_ARGS += --with-bdb=db-4.8 |
|---|
| 210 | CONFIGURE_ARGS += --with-bdb-libdir=$(prefix)/bdb48/lib |
|---|
| 211 | CONFIGURE_ARGS += --with-bdb-incdir=$(prefix)/bdb48/include |
|---|
| 212 | CONFIGURE_ARGS += --with-openssl=$(prefix) |
|---|
| 213 | CONFIGURE_ARGS += --with-sasl=$(prefix) |
|---|
| 214 | CONFIGURE_ARGS += --with-perl=$(prefix)/bin/perl |
|---|
| 215 | CONFIGURE_ARGS += --enable-idled |
|---|
| 216 | CONFIGURE_ARGS += --enable-murder |
|---|
| 217 | CONFIGURE_ARGS += --enable-replication |
|---|
| 218 | CONFIGURE_ARGS += --with-snmp=$(prefix) |
|---|
| 219 | CONFIGURE_ARGS += --with-libwrap=$(prefix) |
|---|
| 220 | CONFIGURE_ARGS += --disable-nntp |
|---|
| 221 | |
|---|
| 222 | # To link against BerkeleyDB 4.8 explicitly |
|---|
| 223 | EXTRA_LINKER_FLAGS = -R$(prefix)/bdb48/lib/\$$ISALIST |
|---|
| 224 | LD_OPTIONS += -R$(prefix)/bdb48/lib/\$$ISALIST |
|---|
| 225 | |
|---|
| 226 | # we add the args so perl libraries are installed |
|---|
| 227 | # in the correct path |
|---|
| 228 | INSTALL_ARGS = INSTALLDIRS=vendor |
|---|
| 229 | |
|---|
| 230 | TEST_SCRIPTS = |
|---|
| 231 | |
|---|
| 232 | CYRUS_DAEMONS = fud idled imapd lmtpd lmtpproxyd mupdate notifyd pop3d pop3proxyd proxyd sieved smmapd timsieved |
|---|
| 233 | |
|---|
| 234 | include gar/category.mk |
|---|
| 235 | |
|---|
| 236 | # compile_et is missing so we want our to be used |
|---|
| 237 | CONFIGURE_ENV += COMPILE_ET="$(CURDIR)/files/compile_et -d $(CURDIR)/files/" |
|---|
| 238 | |
|---|
| 239 | pre-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 | |
|---|
| 250 | post-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 | |
|---|
| 258 | pre-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 | |
|---|
| 266 | post-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 |
|---|
| 270 | install-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 |
|---|
| 283 | libexec-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 |
|---|
| 293 | install-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 |
|---|
| 301 | fix2build: |
|---|
| 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 |
|---|
| 318 | cyrus-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 |
|---|
| 329 | install-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 |
|---|
| 341 | install-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 |
|---|
| 359 | move-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) |
|---|