cyrus-imapd/cyrus-imapd.spec

934 lines
31 KiB
RPMSpec
Raw Normal View History

Name: cyrus-imapd
Version: 3.8.3
Release: %autorelease
Summary: A high-performance email, contacts and calendar server
License: BSD-Attribution-HPND-disclaimer
URL: http://www.cyrusimap.org/
2017-05-22 21:14:19 +00:00
# UID/GID 76 have long been reserved for Cyrus
%define uid 76
%define gid 76
2009-10-29 15:50:04 +00:00
%define cyrususer cyrus
%define cyrusgroup mail
%define cyrexecdir %_libexecdir/%name
2009-10-29 15:50:04 +00:00
%define ssl_pem_file_prefix /etc/pki/%name/%name
%global __provides_exclude ^perl\\(AnnotateInlinedCIDs\\)$
# Cassandane testsuite is no longer executed during build time. It is called from separate CI test:
# https://src.fedoraproject.org/tests/cyrus-imapd/blob/main/f/Sanity/cassandane
# Do not remove CASSANDANE* and CASSANDANE*_END tags - the content between them is extracted and executed inside the CI test.
# If you want to run cassandane locally:
# Run: `rpmbuild '--with cassandane'` or `echo '%%_with_cassandane 1' >> ~/.rpmmacros`.
%bcond_with cassandane
2018-08-11 13:54:31 +00:00
Source0: https://github.com/cyrusimap/cyrus-imapd/releases/download/cyrus-imapd-%version/cyrus-imapd-%version.tar.gz
Source1: https://github.com/cyrusimap/cyrus-imapd/releases/download/cyrus-imapd-%version/cyrus-imapd-%version.tar.gz.sig
Source2: ellie-pub.key
2017-05-22 22:47:36 +00:00
Source10: cyrus-imapd.logrotate
2017-05-22 22:48:11 +00:00
Source11: cyrus-imapd.pam-config
2017-05-22 22:49:48 +00:00
Source12: cyrus-imapd.sysconfig
2018-06-14 01:08:40 +00:00
Source13: cyrus-imapd.magic
2017-05-22 21:14:19 +00:00
# XXX A systemd timer would probably be better
2018-06-14 01:08:40 +00:00
Source14: cyrus-imapd.cron-daily
Source15: README.rpm
Source16: cyrus-imapd.service
Source17: cyrus-imapd-init.service
Source18: cyrus-imapd.tmpfiles.conf
Source19: cyrus-imapd.sysusers
# A template config file for cassandane; we will substitute in varions values.
2022-06-09 14:52:51 +00:00
Source81: cassandane.ini
# Adapt a timeout to handle our slower builders
Patch0: patch-cyrus-testsuite-timeout
# Fedora-specific patch for the default configuration file
Patch1: patch-cyrus-default-configs
# We rename quota to cyr_quota to avoid a conflict with /usr/bin/quota; one
# place in the source must be patched to match.
Patch2: patch-cyrus-rename-quota
# Workaround for some compiled Perl modules not being linked against
# libpcreposix, which causes them to fail to load.
# https://bugzilla.redhat.com/show_bug.cgi?id=1668723
# https://github.com/cyrusimap/cyrus-imapd/issues/2629#issuecomment-456925909
Patch3: patch-cyrus-perl-linking
# cyrus-imapd does not support LTO
# https://github.com/cyrusimap/cyrus-imapd/pull/4679
# Remove attribute always_inline to fix compilation error and keep LTO enabled:
# https://bugzilla.redhat.com/show_bug.cgi?id=2223951
Patch4: patch-cyrus-remove-always-inline-for-buf-len
Patch5: patch-cyrus-rename-imtest
# Cassandane patches:
# Prevent cassandane from trying to syslog things
Patch91: patch-cassandane-no-syslog
# Tell the annotator script to run as the current user/group
# Upstream ticket https://github.com/cyrusimap/cyrus-imapd/issues/1995
Patch92: patch-cassandane-fix-annotator
# TODO libexec/cyrus-imapd path element got into upstream:
# https://github.com/cyrusimap/cyrus-imapd/commit/9233f70bf7a2872ab0b456ea294ce36e0e01e182
# try to get fixed the below upstream to work on Fedora:
# https://github.com/cyrusimap/cyrus-imapd/commit/f10eee167313418d84e63d215310477d4fe68e94
Patch93: patch-cassandane-xapian-delve-path
BuildRequires: autoconf automake bison flex gcc gcc-c++ git glibc-langpack-en
BuildRequires: groff libtool make pkgconfig rsync systemd
2017-05-25 15:32:04 +00:00
BuildRequires: perl-devel perl-generators perl(ExtUtils::MakeMaker)
BuildRequires: perl(Pod::Html)
%if 0%{?fedora} || 0%{?rhel} > 8
BuildRequires: gnupg2
%endif
2017-05-22 16:59:16 +00:00
%if 0%{?fedora}
2021-02-17 10:55:39 +00:00
BuildRequires: clamav-devel shapelib-devel
2021-01-12 13:19:02 +00:00
%endif
BuildRequires: CUnit-devel cyrus-sasl-devel glib2-devel
2018-05-01 23:11:06 +00:00
BuildRequires: jansson-devel krb5-devel libical-devel libicu-devel
BuildRequires: libnghttp2-devel libxml2-devel mariadb-connector-c-devel net-snmp-devel
BuildRequires: openldap-devel openssl-devel pcre2-devel libpq-devel
2018-05-01 23:11:06 +00:00
BuildRequires: sqlite-devel xapian-core-devel
2017-05-22 16:59:16 +00:00
2017-05-25 15:32:04 +00:00
# Miscellaneous modules needed for 'make check' to function:
2017-05-22 20:54:46 +00:00
BuildRequires: cyrus-sasl-plain cyrus-sasl-md5
BuildRequires: systemd-rpm-macros
%if %{with cassandane}
# Additional packages required for cassandane to function
BuildRequires: cpan dovecot-devel file-devel net-tools words
BuildRequires: perl-interpreter
%if 0%{?fedora}
BuildRequires: cld2-devel
%endif
# Dependency list generated by this command:
# cd cassandane; grep -R -h '^[ \t]*use .*;$' | sed -e 's/.*use \([^ ]*\).*;/\1/' | sort | uniq | \
# egrep -v 'Cassandane::|Cyrus::|v5|Net::XmtpServer' | sed -e 's/\(.*\)/BuildRequires: perl(\1)/'
BuildRequires: perl(attributes)
BuildRequires: perl(base)
BuildRequires: perl(BSD::Resource)
BuildRequires: perl(bytes)
BuildRequires: perl(Carp)
BuildRequires: perl(charnames)
BuildRequires: perl(Clone)
BuildRequires: perl(Config)
BuildRequires: perl(constant)
BuildRequires: perl(Cwd)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Data::UUID)
BuildRequires: perl(DBI)
BuildRequires: perl(Digest::file)
BuildRequires: perl(Digest::MD5)
BuildRequires: perl(Encode)
BuildRequires: perl(Errno)
BuildRequires: perl(Error)
BuildRequires: perl(experimental)
BuildRequires: perl(Exporter)
BuildRequires: perl(feature)
BuildRequires: perl(fields)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Find)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Slurp)
BuildRequires: perl(File::stat)
BuildRequires: perl(File::Temp)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(Getopt::Std)
BuildRequires: perl(HTTP::Daemon)
BuildRequires: perl(HTTP::Tiny)
BuildRequires: perl(IO::File)
BuildRequires: perl(IO::Handle)
BuildRequires: perl(IO::Scalar)
BuildRequires: perl(IO::Select)
BuildRequires: perl(IO::Socket)
BuildRequires: perl(IO::Socket::INET)
BuildRequires: perl(IO::Socket::INET6)
BuildRequires: perl(IO::Socket::UNIX)
BuildRequires: perl(JSON)
BuildRequires: perl(JSON::XS)
BuildRequires: perl(lib)
BuildRequires: perl(List::Util)
BuildRequires: perl(LWP::UserAgent)
BuildRequires: perl(MIME::Base64)
2022-06-09 14:52:51 +00:00
BuildRequires: perl(Module::Load::Conditional)
BuildRequires: perl(Net::LDAP::Filter)
BuildRequires: perl(Net::LDAP::FilterMatch)
BuildRequires: perl(Net::LDAP::LDIF)
BuildRequires: perl(Net::LDAP::Util)
BuildRequires: perl(Net::POP3)
BuildRequires: perl(Net::Server::PreForkSimple)
BuildRequires: perl(overload)
BuildRequires: perl(POSIX)
BuildRequires: perl(Scalar::Util)
BuildRequires: perl(Storable)
BuildRequires: perl(strict)
BuildRequires: perl(Sys::Hostname)
BuildRequires: perl(Sys::Syslog)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(URI)
BuildRequires: perl(URI::Escape)
BuildRequires: perl(User::pwent)
BuildRequires: perl(utf8)
BuildRequires: perl(vars)
BuildRequires: perl(version)
BuildRequires: perl(warnings)
# These were reported as missing during build itself
BuildRequires: perl(DBD::SQLite)
BuildRequires: perl(Digest::CRC)
BuildRequires: perl(Moo)
BuildRequires: perl(Unix::Syslog)
BuildRequires: perl(XML::Parser)
%endif
2009-10-29 15:50:04 +00:00
Requires(pre): shadow-utils
2016-11-24 04:18:05 +00:00
%{?systemd_requires}
%{?sysusers_requires_compat}
2009-10-29 15:50:04 +00:00
Requires: cyrus-imapd-libs%{?_isa} = %{version}-%{release}
Requires: cyrus-imapd-utils = %{version}-%{release}
Requires: file sscg
%{?perl_default_filter}
%description
2017-05-22 16:59:16 +00:00
The Cyrus IMAP (Internet Message Access Protocol) server provides access to
personal mail, system-wide bulletin boards, news-feeds, calendar and contacts
through the IMAP, JMAP, NNTP, CalDAV and CardDAV protocols. The Cyrus IMAP
server is a scalable enterprise groupware system designed for use from small to
large enterprise environments using technologies based on well-established Open
Standards.
A full Cyrus IMAP implementation allows a seamless mail and bulletin board
environment to be set up across one or more nodes. It differs from other IMAP
server implementations in that it is run on sealed nodes, where users are not
normally permitted to log in. The mailbox database is stored in parts of the
filesystem that are private to the Cyrus IMAP system. All user access to mail
is through software using the IMAP, IMAPS, JMAP, POP3, POP3S, KPOP, CalDAV
and/or CardDAV protocols.
The private mailbox database design gives the Cyrus IMAP server large
advantages in efficiency, scalability, and administratability. Multiple
concurrent read/write connections to the same mailbox are permitted. The server
supports access control lists on mailboxes and storage quotas on mailbox
hierarchies.
%package devel
Summary: Cyrus IMAP server development files
Requires: cyrus-imapd-libs%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
The %name-devel package contains header files and libraries
necessary for developing applications which use the imclient library.
%package doc-extra
Summary: Extra documentation for the Cyrus IMAP server
BuildArch: noarch
%description doc-extra
This package contains the HTML documentation for the Cyrus IMAP server, as well
as some legacy and internal documentation not useful for normal operation of
the server.
2018-06-13 18:46:35 +00:00
%package libs
Summary: Runtime libraries for cyrus-imapd
%description libs
The cyrus-imapd-libs package contains libraries shared by the Cyrus IMAP server
and the its utilities.
%package utils
Summary: Cyrus IMAP server administration utilities
Requires: cyrus-imapd-libs%{?_isa} = %{version}-%{release}
Requires: perl-Cyrus = %{version}-%{release}
%description utils
The cyrus-imapd-utils package contains administrative tools for the
Cyrus IMAP server. It can be installed on systems other than the
one running the server.
2018-06-13 18:10:15 +00:00
%package virusscan
Summary: Cyrus virus scanning utility
Requires: cyrus-imapd-libs%{?_isa} = %{version}-%{release}
2018-06-13 18:10:15 +00:00
%description virusscan
The cyrus-imapd-virusscan package contains the cyr_virusscan utility. It
exists in a separate package so that users who do not wish to install all of
the clamav suite don't have to.
Install this package if you wish to use the internal cyrus virus scanning
utility.
%package -n perl-Cyrus
Summary: Perl libraries for interfacing with Cyrus IMAPd
%description -n perl-Cyrus
This package contains Perl libraries used to interface with Cyrus IMAPd.
%prep
%if 0%{?fedora} || 0%{?rhel} > 8
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%endif
2021-02-17 10:55:39 +00:00
%autosetup -p1
# https://github.com/cyrusimap/cyrus-imapd/commit/216934c3f4884999206715db3499fc0162e1d65c
echo %version > VERSION
2017-05-22 16:59:16 +00:00
# Install the Fedora-specific documentation file
2018-06-14 01:08:40 +00:00
install -m 644 %SOURCE15 doc/
# The pm files have shebang lines for some reason
sed -i -e '1{/usr.bin.perl/d}' perl/annotator/{Message,Daemon}.pm
# This one uses env
sed -i -e '1i#!/usr/bin/perl' -e '1d' tools/rehash
2018-06-14 00:32:29 +00:00
# These files have a bizarre perl-in-shell shebang setup. The exec perl bit
# sometimes comes after a long comment block. All use magic to turn on -w.
# Some of these aren't installed, but we might as well fix them all just in
# case.
sed -i \
-e '1i#!/usr/bin/perl -w' \
2022-06-09 14:52:51 +00:00
-e '/^#!\/usr\/bin\/perl/d' \
2018-06-14 00:32:29 +00:00
-e '/^exec perl/d' \
-e '/^#!perl -w/d' \
2022-06-09 14:52:51 +00:00
-e '/^#!perl/d' \
2018-06-14 00:32:29 +00:00
-e '/^#!\/bin\/sh/d' \
-e '/^#! \/bin\/sh/d' \
perl/sieve/scripts/installsieve.pl perl/imap/cyradm.sh tools/translatesieve
# TODO: let the above remnants get fixed upstream like it happened for previous occurences:
# https://github.com/cyrusimap/cyrus-imapd/commit/09fd77717044f96e900c38b1e361028ef39ba381
# https://github.com/cyrusimap/cyrus-imapd/commit/bbb7c68a6b55ffe9356d2033192fffbcafc4d73f
2018-06-14 00:32:29 +00:00
%if %{with cassandane}
2017-05-22 16:59:16 +00:00
pushd cassandane
mkdir work
cp %SOURCE81 cassandane.ini
# RF rpm-buildroot-usage
sed -i \
-e "s!CASSDIR!$(pwd)!" \
-e "s!BUILDROOT!%buildroot!" \
cassandane.ini
2017-05-22 16:59:16 +00:00
popd
%endif
%build
#autoreconf -vi
%if %{with cassandane} && 0%{?fedora}
# Needed for Cyrus::FastMail tests to pass
export CLD2_CFLAGS="-I/usr/include/cld2"
export CLD2_LIBS="-lcld2"
%endif
2017-05-22 16:59:16 +00:00
%configure \
2017-05-22 16:59:16 +00:00
--disable-silent-rules \
\
--libexecdir=%cyrexecdir \
--with-clamav \
%if %{with cassandane} && 0%{?fedora}
`# Needed for Cyrus::FastMail tests to pass` \
--with-cld2 \
%endif
2017-05-25 15:32:04 +00:00
--with-extraident="%release Fedora" \
--with-krbimpl=mit \
--with-ldap=/usr \
2017-11-29 21:35:31 +00:00
--with-libwrap=no \
--with-mysql \
--with-pgsql \
--with-perl=%__perl \
--with-snmp \
--with-syslogfacility=MAIL \
2017-05-22 16:59:16 +00:00
\
--enable-autocreate \
2017-05-22 16:59:16 +00:00
--enable-backup \
--enable-calalarmd \
--enable-http \
--enable-idled \
--enable-murder \
--enable-jmap \
--enable-nntp \
--enable-replication \
--enable-unit-tests \
2017-05-22 16:59:16 +00:00
--enable-xapian \
`# Force use of pcre2 in case pcre still available` \
--disable-pcre
# Try to get rid of RPATH....
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
# The configure script will set up the Perl makefiles, but not in the way
# Fedora needs them. So regenerate them manually.
for i in perl/annotator perl/imap perl/sieve/managesieve; do
pushd $i
rm -f Makefile
perl Makefile.PL INSTALLDIRS=vendor # NO_PERLOCAL=1 NO_PACKLIST=1
popd
done
%make_build
# This isn't built by default, but this package has always installed it.
make notifyd/notifytest
# CASSANDANE_BUILD
%if %{with cassandane}
# This module is not available in Fedora:
yes | cpan -T IO::File::fcntl
# These are currently missing on RHEL10 (2024-06-10):
yes | cpan -T AnyEvent \
AnyEvent::Handle \
AnyEvent::Socket \
AnyEvent::Util \
Config::IniFiles \
Data::GUID \
Data::ICal \
DateTime \
DateTime::Format::ISO8601 \
File::chdir \
File::LibMagic \
Mail::IMAPTalk \
Mail::JMAPTalk \
Math::Int64 \
Net::CalDAVTalk \
Net::CardDAVTalk \
Net::CardDAVTalk::VCard \
Net::DAVTalk \
Net::LDAP::Server \
News::NNTPClient \
Plack::Loader \
Plack::Request \
Plack::Response \
String::CRC32 \
Test::TCP \
Test::Unit::Exception \
Test::Unit::Result \
Test::Unit::Runner::XML \
Text::VCardFast \
Types::Standard \
XML::DOM \
XML::Generator \
XML::Spice
# Fix cpan's version of perl-Test-Unit like it is done on Fedora:
# https://src.fedoraproject.org/rpms/perl-Test-Unit/c/c8ec65eb06f4f7059f9e4a32b5c521a26eef746b
sed -ie 's/defined(@{"$class\\::TESTS"})/@{"$class\::TESTS"}/' /usr/local/share/perl5/5.38/Test/Unit/TestCase.pm
# This is the test suite, which doesn't build much but does verify its dependencies.
pushd cassandane
export NOCYRUS=1
make
popd
%endif
# CASSANDANE_BUILD_END
2009-11-26 13:32:56 +00:00
%install
make install DESTDIR=%buildroot
# Create directories
install -d \
%buildroot/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig,cron.daily} \
%buildroot/%_libdir/sasl \
%buildroot/var/spool/imap \
%buildroot/var/lib/imap/{user,quota,proc,log,msg,socket,db,sieve,sync,md5,rpm,backup,meta} \
%buildroot/var/lib/imap/ptclient \
%buildroot/%_datadir/%name/rpm \
2017-05-22 16:59:16 +00:00
%buildroot/%cyrexecdir \
%buildroot/etc/pki/%name
install -d -m 0750 \
%buildroot/run/cyrus \
%buildroot/run/cyrus/socket
install -d -m 0700 \
%buildroot/run/cyrus/db \
%buildroot/run/cyrus/lock \
%buildroot/run/cyrus/proc
2017-06-22 15:44:44 +00:00
# Some tools which aren't installed by the makefile which we have always installed
install -m 755 notifyd/notifytest %buildroot%_bindir/
install -m 755 perl/imap/cyradm %buildroot%_bindir/
2017-06-22 15:44:44 +00:00
for i in arbitronsort.pl masssievec mkimap mknewsgroups rehash translatesieve; do
install -m 755 tools/$i %buildroot/%cyrexecdir/
done
2017-05-22 22:49:21 +00:00
install -p -m 644 %SOURCE10 %buildroot/etc/logrotate.d/%name
# PAM configuration files.
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/csync
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/http
2017-05-22 22:48:11 +00:00
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/imap
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/lmtp
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/mupdate
2017-05-22 22:48:11 +00:00
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/nntp
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/pop
install -p -m 644 %SOURCE11 %buildroot/etc/pam.d/sieve
2017-05-22 22:49:48 +00:00
install -p -m 644 %SOURCE12 %buildroot/etc/sysconfig/%name
2018-06-14 01:08:40 +00:00
install -p -m 644 %SOURCE13 %buildroot/%_datadir/%name/rpm/magic
install -p -m 755 %SOURCE14 %buildroot/etc/cron.daily/%name
2017-05-22 16:59:16 +00:00
install -p -m 644 doc/examples/cyrus_conf/prefork.conf %buildroot/etc/cyrus.conf
install -p -m 644 doc/examples/imapd_conf/normal.conf %buildroot/etc/imapd.conf
2018-06-14 01:08:40 +00:00
install -p -D -m 644 %SOURCE16 %buildroot/%_unitdir/cyrus-imapd.service
install -p -D -m 644 %SOURCE17 %buildroot/%_unitdir/cyrus-imapd-init.service
install -p -D -m 644 %SOURCE18 %buildroot/%_tmpfilesdir/cyrus-imapd.conf
# systemd-sysusers
install -p -D -m 644 %{SOURCE19} %{buildroot}%{_sysusersdir}/cyrus-imapd.conf
2017-05-22 16:59:16 +00:00
2009-11-26 13:32:56 +00:00
# Cleanup of doc dir
find doc perl -name CVS -type d -prune -exec rm -rf {} \;
find doc perl -name .cvsignore -type f -exec rm -f {} \;
rm -f doc/Makefile.dist*
rm -f doc/text/htmlstrip.c
rm -f doc/text/Makefile
rm -rf doc/man
2009-11-26 13:32:56 +00:00
# fix permissions on perl .so files
2017-05-22 16:59:16 +00:00
find %buildroot/%_libdir/perl5/ -type f -name "*.so" -exec chmod 755 {} \;
# 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/"/=/'
2017-05-22 17:00:25 +00:00
echo sieve_version=2.2.3 ) | sort > %buildroot/%_datadir/%name/rpm/db.cfg
# Cyrus has various files with extremely conflicting names. Some of these are
# not unexpected ("imapd" itself) but some like "httpd" are rather surprising.
# 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/%_sbindir/fetchnews %buildroot/%_sbindir/cyr_fetchnews
mv %buildroot/%_mandir/man8/fetchnews.8 %buildroot/%_mandir/man8/cyr_fetchnews.8
# Fix conflict with dump
mv %buildroot/%_sbindir/restore %buildroot/%_sbindir/cyr_restore
mv %buildroot/%_mandir/man8/restore.8 %buildroot/%_mandir/man8/cyr_restore.8
# Fix conceptual conflict with quota
mv %buildroot/%_sbindir/quota %buildroot/%_sbindir/cyr_quota
mv %buildroot/%_mandir/man8/quota.8 %buildroot/%_mandir/man8/cyr_quota.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/httpd.8cyrus
# Fix conflict with imtest from python-fslpy
mv %buildroot/%_bindir/imtest %buildroot/%_bindir/cyr_imtest
mv %buildroot/%_mandir/man1/imtest.1 %buildroot/%_mandir/man1/cyr_imtest.1
# Change individual symlinks to point to cyr_imtest instead of imtest
for i in httptest lmtptest mupdatetest nntptest pop3test sivtest smtptest synctest; do
ln -sfr %buildroot/%_bindir/cyr_imtest %buildroot/%_bindir/$i
done
# Old cyrus packages used to keep the deliver executable in
# /usr/lib/cyrus-imapd, and MTA configurations might rely on this.
# Remove this hack in the F30 timeframe.
# RF hardcoded-library-path in %%buildroot/usr/lib/cyrus-imapd
mkdir %buildroot/usr/lib/cyrus-imapd
pushd %buildroot/usr/lib/cyrus-imapd
ln -s ../../sbin/deliver
popd
2018-06-13 21:33:39 +00:00
#remove executable bit from docs and Perl modules
2009-11-24 16:23:25 +00:00
for ddir in doc perl/imap/examples
do
find $ddir -type f -exec chmod -x {} \;
2009-11-24 16:23:25 +00:00
done
# Remove pointless libtool archives
rm %buildroot/%_libdir/*.la
# Remove installed but not packaged files
rm %buildroot/%cyrexecdir/pop3proxyd
find %buildroot -name "perllocal.pod" -exec rm {} \;
find %buildroot -name ".packlist" -exec rm {} \;
2018-06-13 21:33:39 +00:00
# And this one gets installed with executable permission
chmod -x %buildroot/%perl_vendorlib/Cyrus/Annotator/Daemon.pm
%check
%if %{without cassandane}
exit 0
2022-06-09 14:52:51 +00:00
%endif
2021-06-11 06:41:59 +00:00
%ifarch %{ix86} armv7hl
exit 0
%endif
# TODO: The mime_boundary_extended cunit test fails due to LTO on ppc64le, skip it for now:
%ifnarch ppc64le
LD_LIBRARY_PATH=%buildroot/%_libdir make -j%{?_smp_build_ncpus} check || exit 1
2017-06-01 01:25:21 +00:00
%endif
# Cassandane cannot run solely as root because imap services would otherwise quit:
#$ grep -R "must run as the Cyrus user" | egrep "imapd|httpd|pop3d"
#imap/imapd.c: if (geteuid() == 0) fatal("must run as the Cyrus user", EX_USAGE);
#imap/httpd.c: if (geteuid() == 0) fatal("must run as the Cyrus user", EX_USAGE);
#imap/pop3d.c: if (geteuid() == 0) fatal("must run as the Cyrus user", EX_USAGE);
getent group saslauth >/dev/null || /usr/sbin/groupadd -g %gid -r saslauth
# Set up shell and home directory for cyrus so that debugging of failing tests is easier.
getent passwd cyrus >/dev/null && /usr/sbin/usermod -s /bin/bash cyrus
getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /var/lib/imap -g %cyrusgroup \
-G saslauth -s /bin/bash -u %uid -r %cyrususer -m
# Set LD_LIBRARY_PATH for cyrus so that it points to cyrus-imapd libraries we just built.
[ -z "`grep LD_LIBRARY_PATH /var/lib/imap/.bashrc`" ] && echo "export LD_LIBRARY_PATH=%buildroot/%_libdir" >> /var/lib/imap/.bashrc
# CASSANDANE
# Run the Cassandane test suite. This will exhaustively test the various
# server components, but running it in a mock chroot is rather an exercise.
pushd cassandane
2017-05-25 15:32:04 +00:00
# Do not depend on imaptest package (missing on RHEL10)
wget https://dovecot.org/nightly/imaptest/imaptest-20210511.tar.gz
rm -rf imaptest-src
mkdir imaptest-src
tar -xf imaptest-20210511.tar.gz --strip-components=1 -C imaptest-src
pushd imaptest-src
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1103927#c4 (and later)
sed -e 's@\(^LIBDOVECOT .*\)@\1 -Wl,-rpath -Wl,/usr/lib64/dovecot@' -i src/Makefile.in
./configure --with-dovecot=/usr/lib64/dovecot
make
popd
mkdir -p imaptest/src
ln -sfr ./imaptest-src/src/imaptest imaptest/src
ln -sfr ./imaptest-src/src/tests imaptest/src
chown -R cyrus:mail .
# Construct the set of excluded tests to pass to Cassandane
# ---------------------------------------------------------
exclude=()
tests=(
# This exclusion list was verified on 2024-06-10.
# This tests coredumping and won't work on a machine where systemd
# intercepts coredumps, which includes our builders.
Cassandane::Test::Core
# Can't currently be run at build time because of compiled-in paths. See
# https://github.com/cyrusimap/cyrus-imapd/issues/2386
Admin.imap_admins
# TODO currently failing
Cyrus::Flags.userflags_crash
Cyrus::JMAPCore.eventsource
Cyrus::JMAPEmail.email_query_no_guidsearch_ignore_jmapuploads
Cyrus::JMAPEmail.email_query_seen_multimbox
Cyrus::JMAPEmail.email_query_unicodefdfx
Cyrus::JMAPMailbox.mailbox_ignore_notes_subfolders
Cyrus::JMAPMailbox.mailbox_set_create_specialuse_nochildren
Cyrus::JMAPMailbox.mailbox_set_sharewith_acl
Cyrus::JMAPSieve.getmetadata
Cyrus::SearchSquat.nonincremental
Cyrus::SearchSquat.incremental
Cyrus::SearchSquat.one_doc_per_message
Cyrus::JMAPBackup.restore_calendars_batch_size_bug
Cyrus::Prometheus.connection_setup_failure_imapd
)
for i in ${tests[@]}; do exclude+=("!$i"); done
# If cyrus-imapd is built without cld2 support, the below tests are expected to fail:
if [ -z "$CLD2_CFLAGS" ]; then
exclude+=(
"!Cyrus::FastMail.cyr_expire_delete_findpaths_legacy"
"!Cyrus::FastMail.cyr_expire_delete_findpaths_nolegacy"
"!Cyrus::FastMail.relocate_legacy_domain"
"!Cyrus::FastMail.relocate_legacy_nodomain"
"!Cyrus::FastMail.relocate_legacy_nosearchdb"
"!Cyrus::FastMail.relocate_messages_still_exist"
"!Cyrus::FastMail.search_deleted_folder"
"!Cyrus::FastMail.sync_reset_legacy"
"!Cyrus::FastMail.sync_reset_nolegacy"
)
fi
2018-06-07 16:01:52 +00:00
%ifarch s390x
# This one test fails occasionally on s390x because the hosts are just too slow
# to complete it.D It's testing something valid (that the fork rate limiting
# settings work properly) but s390x can't fork quickly enough to exceeed the
# limits it's testing.
exclude+=("!Master.maxforkrate")
%endif
# Add -vvv for too much output
sudo -u cyrus -g mail LD_LIBRARY_PATH=%buildroot/%_libdir ./testrunner.pl -j%{?_smp_build_ncpus} -v -f pretty ${exclude[@]} 2>&1 || :
# CASSANDANE_END
if [ -s "work/failed" ]; then
cat work/failed
exit 1
fi
%pre
%sysusers_create_compat %{SOURCE19}
%post
2012-08-21 17:26:46 +00:00
%systemd_post cyrus-imapd.service
%preun
2012-08-21 17:26:46 +00:00
%systemd_preun cyrus-imapd.service
%postun
2012-08-21 17:26:46 +00:00
%systemd_postun_with_restart cyrus-imapd.service
2011-04-04 15:10:19 +00:00
%files
%license COPYING
%doc README.md doc/README.* doc/examples doc/text
%{_sbindir}/arbitron
%{_sbindir}/chk_cyrus
%{_sbindir}/ctl_backups
%{_sbindir}/ctl_conversationsdb
%{_sbindir}/ctl_cyrusdb
%{_sbindir}/ctl_deliver
%{_sbindir}/ctl_mboxlist
%{_sbindir}/ctl_zoneinfo
%{_sbindir}/cvt_cyrusdb
%{_sbindir}/cvt_xlist_specialuse
%{_sbindir}/cyr_backup
%{_sbindir}/cyr_buildinfo
%{_sbindir}/cyr_cd.sh
%{_sbindir}/cyr_dbtool
%{_sbindir}/cyr_deny
%{_sbindir}/cyr_df
%{_sbindir}/cyr_expire
%{_sbindir}/cyr_fetchnews
%{_sbindir}/cyr_info
%{_sbindir}/cyr_ls
%{_sbindir}/cyr_pwd
%{_sbindir}/cyr_quota
%{_sbindir}/cyr_restore
%{_sbindir}/cyr_synclog
%{_sbindir}/cyr_userseen
%{_sbindir}/cyrdump
%{_sbindir}/dav_reconstruct
%{_sbindir}/deliver
%{_sbindir}/ipurge
%{_sbindir}/mbexamine
%{_sbindir}/mbpath
%{_sbindir}/mbtool
%{_sbindir}/ptdump
%{_sbindir}/ptexpire
%{_sbindir}/reconstruct
%{_sbindir}/relocate_by_id
%{_sbindir}/sievec
%{_sbindir}/sieved
%{_sbindir}/squatter
%{_sbindir}/sync_client
%{_sbindir}/sync_reset
%{_sbindir}/tls_prune
%{_sbindir}/unexpunge
%{_datadir}/cyrus-imapd
%{_mandir}/man1/dav_reconstruct.1*
%{_mandir}/man5/cyrus.conf.5*
%{_mandir}/man5/imapd.conf.5*
%{_mandir}/man5/krb.equiv.5*
%{_mandir}/man8/arbitron.8*
%{_mandir}/man8/backupd.8*
%{_mandir}/man8/chk_cyrus.8*
%{_mandir}/man8/ctl_backups.8*
%{_mandir}/man8/ctl_conversationsdb.8*
%{_mandir}/man8/ctl_cyrusdb.8*
%{_mandir}/man8/ctl_deliver.8*
%{_mandir}/man8/ctl_mboxlist.8*
%{_mandir}/man8/ctl_zoneinfo.8*
%{_mandir}/man8/cvt_cyrusdb.8*
%{_mandir}/man8/cvt_xlist_specialuse.8*
%{_mandir}/man8/cyr_backup.8*
%{_mandir}/man8/cyr_buildinfo.8*
%{_mandir}/man8/cyr_dbtool.8*
%{_mandir}/man8/cyr_deny.8*
%{_mandir}/man8/cyr_df.8*
%{_mandir}/man8/cyr_expire.8*
%{_mandir}/man8/cyr_fetchnews.8*
%{_mandir}/man8/cyr_info.8*
%{_mandir}/man8/cyr_ls.8*
%{_mandir}/man8/cyr_quota.8*
%{_mandir}/man8/cyr_restore.8*
%{_mandir}/man8/cyr_synclog.8*
%{_mandir}/man8/cyr_userseen.8*
%{_mandir}/man8/cyradm.8*
%{_mandir}/man8/cyrdump.8*
%{_mandir}/man8/deliver.8*
%{_mandir}/man8/fud.8*
%{_mandir}/man8/httpd.8cyrus*
%{_mandir}/man8/idled.8*
%{_mandir}/man8/imapd.8cyrus*
%{_mandir}/man8/ipurge.8*
%{_mandir}/man8/lmtpd.8*
%{_mandir}/man8/lmtpproxyd.8*
%{_mandir}/man8/master.8cyrus*
%{_mandir}/man8/mbexamine.8*
%{_mandir}/man8/mbpath.8*
%{_mandir}/man8/mbtool.8*
%{_mandir}/man8/mupdate.8*
%{_mandir}/man8/nntpd.8*
%{_mandir}/man8/notifyd.8*
%{_mandir}/man8/pop3d.8cyrus*
%{_mandir}/man8/pop3proxyd.8*
%{_mandir}/man8/promstatsd.8*
%{_mandir}/man8/proxyd.8*
%{_mandir}/man8/ptdump.8*
%{_mandir}/man8/ptexpire.8*
%{_mandir}/man8/ptloader.8*
%{_mandir}/man8/reconstruct.8*
%{_mandir}/man8/relocate_by_id.8*
%{_mandir}/man8/sievec.8*
%{_mandir}/man8/sieved.8*
%{_mandir}/man8/smmapd.8*
%{_mandir}/man8/squatter.8*
%{_mandir}/man8/sync_client.8*
%{_mandir}/man8/sync_reset.8*
%{_mandir}/man8/sync_server.8*
%{_mandir}/man8/timsieved.8*
%{_mandir}/man8/tls_prune.8*
%{_mandir}/man8/unexpunge.8*
%exclude %{_sbindir}/cyr_virusscan
%exclude %{_mandir}/man8/cyr_virusscan.8*
# For the legacy symlink to the deliver binary
# RF hardcoded-library-path in /usr/lib/cyrus-imapd
/usr/lib/cyrus-imapd/
%dir /etc/pki/cyrus-imapd
%attr(0644,root,%cyrusgroup) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %ssl_pem_file_prefix-ca.pem
%attr(0644,root,%cyrusgroup) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %ssl_pem_file_prefix.pem
%attr(0640,root,%cyrusgroup) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %ssl_pem_file_prefix-key.pem
%config(noreplace) /etc/cyrus.conf
%config(noreplace) /etc/imapd.conf
%config(noreplace) /etc/logrotate.d/cyrus-imapd
%config(noreplace) /etc/sysconfig/cyrus-imapd
%config(noreplace) /etc/pam.d/*
/etc/cron.daily/cyrus-imapd
%_unitdir/cyrus-imapd.service
%_unitdir/cyrus-imapd-init.service
%_tmpfilesdir/cyrus-imapd.conf
%{_sysusersdir}/cyrus-imapd.conf
%dir %cyrexecdir/
%cyrexecdir/[a-uw-z]*
# This creates some directories which in the default configuration cyrus will
# never use because they are placed under /run instead. However, old
# configurations or setup advice from the 'net might reference them, and so
# it's simpler to just leave them in the package.
%attr(0750,%cyrususer,%cyrusgroup) %dir /var/lib/imap/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/backup/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/db/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/log/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/meta/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/md5/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/msg/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/proc/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/ptclient/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/quota/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/rpm/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/sieve/
%attr(0750,%cyrususer,%cyrusgroup) /var/lib/imap/socket
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/sync/
%attr(0700,%cyrususer,%cyrusgroup) /var/lib/imap/user/
%attr(0700,%cyrususer,%cyrusgroup) /var/spool/imap/
# The new locations
%attr(0750,%cyrususer,%cyrusgroup) %dir /run/cyrus/
%attr(0700,%cyrususer,%cyrusgroup) /run/cyrus/db/
%attr(0700,%cyrususer,%cyrusgroup) /run/cyrus/lock/
%attr(0700,%cyrususer,%cyrusgroup) /run/cyrus/proc/
%attr(0750,%cyrususer,%cyrusgroup) /run/cyrus/socket/
%files devel
%{_includedir}/cyrus/
%{_libdir}/libcyrus.so
%{_libdir}/libcyrus_imap.so
%{_libdir}/libcyrus_min.so
%{_libdir}/libcyrus_sieve.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/imclient.3*
%files doc-extra
%doc doc/html doc/internal doc/legacy
2018-06-13 18:46:35 +00:00
%files libs
%license COPYING
%{_libdir}/libcyrus.so.0*
%{_libdir}/libcyrus_imap.so.0*
%{_libdir}/libcyrus_min.so.0*
%{_libdir}/libcyrus_sieve.so.0*
2018-06-13 18:46:35 +00:00
%files utils
%{_bindir}/cyradm
%{_bindir}/httptest
%{_bindir}/cyr_imtest
%{_bindir}/installsieve
%{_bindir}/lmtptest
%{_bindir}/mupdatetest
%{_bindir}/nntptest
%{_bindir}/notifytest
%{_bindir}/pop3test
%{_bindir}/sieveshell
%{_bindir}/sivtest
%{_bindir}/smtptest
%{_bindir}/synctest
%{_mandir}/man1/cyradm.1*
%{_mandir}/man1/httptest.1*
%{_mandir}/man1/cyr_imtest.1*
%{_mandir}/man1/installsieve.1*
%{_mandir}/man1/lmtptest.1*
%{_mandir}/man1/mupdatetest.1*
%{_mandir}/man1/nntptest.1*
%{_mandir}/man1/pop3test.1*
%{_mandir}/man1/sieveshell.1*
%{_mandir}/man1/sivtest.1*
%{_mandir}/man1/smtptest.1*
%{_mandir}/man1/synctest.1*
2018-06-13 18:10:15 +00:00
%files virusscan
%{_sbindir}/cyr_virusscan
%{_mandir}/man8/cyr_virusscan.8*
2018-06-13 18:10:15 +00:00
%files -n perl-Cyrus
%license COPYING
%doc perl/imap/README
%doc perl/imap/Changes
%doc perl/imap/examples
%{perl_vendorarch}/auto/Cyrus
%{perl_vendorarch}/Cyrus
%{perl_vendorlib}/Cyrus
%{_mandir}/man3/Cyrus::Annotator::Daemon.3pm*
%{_mandir}/man3/Cyrus::Annotator::Message.3pm*
%{_mandir}/man3/Cyrus::IMAP.3pm*
%{_mandir}/man3/Cyrus::IMAP::Admin.3pm*
%{_mandir}/man3/Cyrus::IMAP::Shell.3pm*
%{_mandir}/man3/Cyrus::SIEVE::managesieve.3pm*
%changelog
%autochangelog