diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec index 974bb77..371ee5d 100644 --- a/cyrus-imapd.spec +++ b/cyrus-imapd.spec @@ -15,7 +15,8 @@ Release: 1%{?dist} %define cyrususer cyrus %define cyrusgroup mail # RF hardcoded-library-path in %%_prefix/lib/%%name -%define cyrexecdir %_prefix/lib/%name +#define cyrexecdir %%_prefix/lib/%name +%define cyrexecdir %_libexecdir/%name Summary: A high-performance email, contacts and calendar server License: BSD @@ -39,10 +40,11 @@ BuildRequires: pkgconfig systemd tcp_wrappers transfig BuildRequires: perl-devel perl-generators perl(ExtUtils::MakeMaker) perl(Pod::Html) -BuildRequires: clamav-devel CUnit-devel cyrus-sasl-devel glib2-devel +# Note: clamav-devel and mariadb-devel removed because they both depend on compat-openssl. +BuildRequires: clamav-devel CUnit-devel cyrus-sasl-devel glib2-devel BuildRequires: jansson-devel krb5-devel libical-devel libnghttp2-devel -BuildRequires: libxml2-devel mariadb-devel net-snmp-devel openldap-devel +BuildRequires: libxml2-devel net-snmp-devel openldap-devel BuildRequires: openssl-devel postgresql-devel shapelib-devel sqlite-devel BuildRequires: xapian-core-devel @@ -135,20 +137,6 @@ ln -s cassandane-%cmt1 cassandane install -m 644 %SOURCE21 doc/ -# Modify the documentation to change master --> cyrus-master -#sed -i -e "s/master(8)/cyrus-master(8)/" man/*5 man/*8 lib/imapoptions -#sed -i -e 's|\([^-]\)master|\1cyrus-master|g' \ -# -e 's|^master|cyrus-master|g' \ -# -e 's|Master|Cyrus-master|g' \ -# -e 's|MASTER|CYRUS-MASTER|g' \ -# man/master.8 doc/man.html - -# modify lmtp socket path in .conf files -#sed -i -e "s@/var/imap/@/var/lib/imap/@" master/conf/*.conf doc/cyrusv2.mc - -# enable idled in .conf files to prevent error messages -#sed -i -e "s/# idled/ idled/" master/conf/*.conf - # Fix permissions on perl programs #find . -type f -name "*.pl" -exec chmod 755 {} \; @@ -167,15 +155,18 @@ popd # in Fedora. # XXX --with-cyrus-prefix and --with-service-path went away. +# Use --with-libexecdir= instead autoreconf -vi -%{configure} \ +# XXX --with-mysql removed because libmysqlclient needs compat-openssl and you +# can't link them both into the same program. +%configure \ --disable-silent-rules \ \ + --libexecdir=%cyrexecdir \ --with-extraident="Fedora-RPM-%version-%release" \ --with-krbimpl=mit \ --with-ldap=/usr \ - --with-mysql \ --with-pgsql \ --with-perl=%__perl \ --with-snmp \ @@ -288,15 +279,8 @@ rm -rf doc/man # fix permissions on perl .so files find %buildroot/%_libdir/perl5/ -type f -name "*.so" -exec chmod 755 {} \; -# fix conflicts with uw-imap -mv %buildroot/%_mandir/man8/imapd.8 %buildroot/%_mandir/man8/imapd.8cyrus -mv %buildroot/%_mandir/man8/pop3d.8 %buildroot/%_mandir/man8/pop3d.8cyrus - -# Install templates -install -m 755 -d doc/conf -install -m 644 master/conf/*.conf doc/conf/ - # Generate db config file +# XXX Is this still necessary? ( grep '^{' lib/imapoptions | grep _db | cut -d'"' -f 2,4 | \ sed -e 's/^ *//' -e 's/-nosync//' -e 's/ *$//' -e 's/"/=/' echo sieve_version=2.2.3 ) | sort > %buildroot/%_datadir/%name/rpm/db.cfg @@ -304,18 +288,34 @@ install -m 644 master/conf/*.conf doc/conf/ # create the ghost pem file touch %buildroot/%ssl_pem_file -# Rename 'master' binary and manpage to avoid clash with postfix -mv %buildroot/%cyrexecdir/master %buildroot/%cyrexecdir/cyrus-master -mv %buildroot/%_mandir/man8/master.8 %buildroot/%_mandir/man8/cyrus-master.8 +## Cyrus has various files with extremely conflicting names. Some of these are +# not unexpected ("imapd" itself) but some like "httpd" are rather surprising. +# Where these files live in /usr/libexec and are not conflicting, they have +# been left alone even though this may cause a bit of confusion. Upstream +# intends to rename all potential conflict, and possibley just rename +# everything, to have a "cyr_" prefix. But this didn't happen for version 3. + +# Where there are only conflicting manpages, they have been moved to a "8cyrus" +# section. If the binary was renamed, then the manpages are renamed to match +# but a internal replacement has not been done. This may lead to more +# confusion but involves modifying fewer upstream files. + +# Actual binary conflicts # Rename 'fetchnews' binary and manpage to avoid clash with leafnode -mv %buildroot/%cyrexecdir/fetchnews %buildroot/%cyrexecdir/cyrfetchnews -mv %buildroot/%_mandir/man8/fetchnews.8 %buildroot/%_mandir/man8/cyrfetchnews.8 -perl -pi -e 's|fetchnews|cyrfetchnews|g;s|Fetchnews|Cyrfetchnews|g;s/FETCHNEWS/CYRFETCHNEWS/g' \ - %buildroot/%_mandir/man8/cyrfetchnews.8 +mv %buildroot/%_sbindir/fetchnews %buildroot/%cyrexecdir/cyr_fetchnews +mv %buildroot/%_mandir/man8/fetchnews.8 %buildroot/%_mandir/man8/cyr_fetchnews.8 + + +# fix conflicts with uw-imap +mv %buildroot/%_mandir/man8/imapd.8 %buildroot/%_mandir/man8/imapd.8cyrus +mv %buildroot/%_mandir/man8/pop3d.8 %buildroot/%_mandir/man8/pop3d.8cyrus + +# Rename 'master' manpage +mv %buildroot/%_mandir/man8/master.8 %buildroot/%_mandir/man8/master.8cyrus # Rename 'httpd' manpage to avoid clash with Apache -mv %buildroot/%_mandir/man8/httpd.8 %buildroot/%_mandir/man8/cyrhttpd.8 +mv %buildroot/%_mandir/man8/httpd.8 %buildroot/%_mandir/man8/cyr_httpd.8 #remove executable bit from docs for ddir in doc perl/imap/examples @@ -332,6 +332,10 @@ find %buildroot -name "perllocal.pod" -exec rm {} \; find %buildroot -name ".packlist" -exec rm {} \; +%check +make check + + %pre # Create 'cyrus' user on target host getent group saslauth >/dev/null || /usr/sbin/groupadd -g %gid -r saslauth