Patch default configs; add tmpfiles.d config.
Patch the default configuration file to enable the full supported functionality of the build, and to more closely match the defaults from older Fedora packages. Add a tmpfiles.d configuration file to properly create the directories under /run which upstream is now using. Also create and own those directories properly.
This commit is contained in:
parent
cdeac93ae7
commit
3a72524044
@ -9,7 +9,7 @@
|
||||
|
||||
Name: cyrus-imapd
|
||||
Version: 3.0.2
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
|
||||
%define ssl_pem_file /etc/pki/%name/%name.pem
|
||||
|
||||
@ -35,6 +35,8 @@ Patch1: patch-cyrus-managesieve-linking
|
||||
# Upstream https://github.com/cyrusimap/cyrus-imapd/issues/2039
|
||||
Patch2: patch-cyrus-pkgconfig-file
|
||||
|
||||
# Fedora-specific patch for the default configuration file
|
||||
Patch3: patch-cyrus-default-configs
|
||||
|
||||
Source10: cyrus-imapd.logrotate
|
||||
Source11: cyrus-imapd.pam-config
|
||||
@ -46,6 +48,7 @@ Source15: cyrus-imapd.cron-daily
|
||||
Source16: README.rpm
|
||||
Source17: cyrus-imapd.service
|
||||
Source18: cyrus-imapd-init.service
|
||||
Source19: cyrus-imapd.tmpfiles.conf
|
||||
|
||||
# Source files for running the Cassandane test suite at build time.
|
||||
Source80: https://github.com/cyrusimap/cassandane/archive/%cmt1.tar.gz#/cassandane-%{scmt %cmt1}.tar.gz
|
||||
@ -310,6 +313,15 @@ install -d \
|
||||
%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
|
||||
|
||||
# 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/
|
||||
@ -338,15 +350,7 @@ 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
|
||||
install -p -D -m 644 %SOURCE17 %buildroot/%_unitdir/cyrus-imapd.service
|
||||
install -p -D -m 644 %SOURCE18 %buildroot/%_unitdir/cyrus-imapd-init.service
|
||||
|
||||
cat >> %buildroot/etc/imapd.conf <<END
|
||||
|
||||
# These three files will automatically be generated by the systemd unit when
|
||||
# the service starts for the first time.
|
||||
tls_cert_file: /etc/pki/cyrus-imapd/cyrus-imapd.pem
|
||||
tls_key_file: /etc/pki/cyrus-imapd/cyrus-imapd-key.pem
|
||||
tls_ca_file: /etc/pki/cyrus-imapd/cyrus-imapd-ca.pem
|
||||
END
|
||||
install -p -D -m 644 %SOURCE19 %buildroot/%_tmpfilesdir/cyrus-imapd.conf
|
||||
|
||||
# Cleanup of doc dir
|
||||
find doc perl -name CVS -type d -prune -exec rm -rf {} \;
|
||||
@ -397,7 +401,7 @@ mv %buildroot/%_mandir/man8/pop3d.8 %buildroot/%_mandir/man8/pop3d.8cyrus
|
||||
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/cyr_httpd.8
|
||||
mv %buildroot/%_mandir/man8/httpd.8 %buildroot/%_mandir/man8/httpd.8cyrus
|
||||
|
||||
# Old cyrus packages used to keep some executables in /usr/lib/cyrus-imapd
|
||||
# RF hardcoded-library-path in %%buildroot/usr/lib/cyrus-imapd
|
||||
@ -569,6 +573,7 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v
|
||||
%dir /etc/pki/cyrus-imapd
|
||||
%attr(0640,root,%cyrusgroup) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %ssl_pem_file
|
||||
|
||||
|
||||
%config(noreplace) /etc/cyrus.conf
|
||||
%config(noreplace) /etc/imapd.conf
|
||||
%config(noreplace) /etc/logrotate.d/cyrus-imapd
|
||||
@ -578,11 +583,16 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v
|
||||
/etc/cron.daily/cyrus-imapd
|
||||
%_unitdir/cyrus-imapd.service
|
||||
%_unitdir/cyrus-imapd-init.service
|
||||
%_tmpfilesdir/cyrus-imapd.conf
|
||||
|
||||
%dir %cyrexecdir/
|
||||
%cyrexecdir/[a-uw-z]*
|
||||
|
||||
%attr(0750,%cyrususer,%cyrusgroup) %dir /var/lib/imap
|
||||
# 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/
|
||||
@ -599,6 +609,13 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v
|
||||
%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/
|
||||
@ -632,6 +649,12 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jun 27 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.2-3
|
||||
- Patch the provided imapd.conf and cyrus.conf to more closely match previous
|
||||
Fedora defaults and directories included in this package and to enable
|
||||
features which are supported by the Fedora build.
|
||||
- Add tmpfiles.d configuration file for directories in /run.
|
||||
|
||||
* Tue Jun 27 2017 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.0.2-2
|
||||
- Exclude one more test from 32-bit arches. Looks like this failure crept in
|
||||
with the Cassandane update.
|
||||
|
110
patch-cyrus-default-configs
Normal file
110
patch-cyrus-default-configs
Normal file
@ -0,0 +1,110 @@
|
||||
diff --git a/doc/examples/cyrus_conf/prefork.conf b/doc/examples/cyrus_conf/prefork.conf
|
||||
index 4ce2c0f..3b1e6d7 100644
|
||||
--- a/doc/examples/cyrus_conf/prefork.conf
|
||||
+++ b/doc/examples/cyrus_conf/prefork.conf
|
||||
@@ -19,15 +19,15 @@ SERVICES {
|
||||
# nntps cmd="nntpd -s" listen="nntps" prefork=1
|
||||
|
||||
# these are only necessary if using HTTP for CalDAV, CardDAV, or RSS
|
||||
-# http cmd="httpd" listen="http" prefork=3
|
||||
-# https cmd="httpd -s" listen="https" prefork=1
|
||||
+ http cmd="httpd" listen="http" prefork=3
|
||||
+ https cmd="httpd -s" listen="https" prefork=1
|
||||
|
||||
# at least one LMTP is required for delivery
|
||||
# lmtp cmd="lmtpd" listen="lmtp" prefork=0
|
||||
- lmtpunix cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=1
|
||||
+ lmtpunix cmd="lmtpd" listen="/run/cyrus/socket/lmtp" prefork=1
|
||||
|
||||
# this is only necessary if using notifications
|
||||
-# notify cmd="notifyd" listen="/var/imap/socket/notify" proto="udp" prefork=1
|
||||
+# notify cmd="notifyd" listen="/run/cyrus/socket/notify" proto="udp" prefork=1
|
||||
}
|
||||
|
||||
EVENTS {
|
||||
diff --git a/doc/examples/imapd_conf/normal.conf b/doc/examples/imapd_conf/normal.conf
|
||||
index 95b54e9..0eaae55 100644
|
||||
--- a/doc/examples/imapd_conf/normal.conf
|
||||
+++ b/doc/examples/imapd_conf/normal.conf
|
||||
@@ -10,7 +10,7 @@ admins: cyrus
|
||||
###################################################################
|
||||
|
||||
# Configuration directory
|
||||
-configdirectory: /var/lib/cyrus
|
||||
+configdirectory: /var/lib/imap
|
||||
|
||||
# Directories for proc and lock files
|
||||
proc_path: /run/cyrus/proc
|
||||
@@ -19,18 +19,18 @@ mboxname_lockpath: /run/cyrus/lock
|
||||
# Locations for DB files
|
||||
# The following DB are recreated upon initialization, so should live in
|
||||
# ephemeral storage for best performance.
|
||||
-duplicate_db_path: /run/cyrus/deliver.db
|
||||
-ptscache_db_path: /run/cyrus/ptscache.db
|
||||
-statuscache_db_path: /run/cyrus/statuscache.db
|
||||
-tls_sessions_db_path: /run/cyrus/tls_sessions.db
|
||||
+duplicate_db_path: /run/cyrus/db/deliver.db
|
||||
+ptscache_db_path: /run/cyrus/db/ptscache.db
|
||||
+statuscache_db_path: /run/cyrus/db/statuscache.db
|
||||
+tls_sessions_db_path: /run/cyrus/db/tls_sessions.db
|
||||
|
||||
# Which partition to use for default mailboxes
|
||||
defaultpartition: default
|
||||
-partition-default: /var/spool/cyrus/mail
|
||||
+partition-default: /var/spool/imap
|
||||
|
||||
# If sieveusehomedir is false (the default), this directory is searched
|
||||
# for Sieve scripts.
|
||||
-sievedir: /var/spool/sieve
|
||||
+sievedir: /var/lib/imap/sieve
|
||||
|
||||
###################################################################
|
||||
## Important: KEEP THESE IN SYNC WITH cyrus.conf
|
||||
@@ -51,19 +51,16 @@ syslog_prefix: cyrus
|
||||
# Space-separated list of HTTP modules that will be enabled in
|
||||
# httpd(8). This option has no effect on modules that are disabled at
|
||||
# compile time due to missing dependencies (e.g. libical).
|
||||
-#
|
||||
-# Allowed values: caldav, carddav, domainkey, ischedule, rss
|
||||
-httpmodules: caldav carddav
|
||||
+# Fedora default: enable all modules besides admin
|
||||
+httpmodules: caldav carddav domainkey freebusy isschedule jmap rss tzdist webdav
|
||||
|
||||
# If enabled, the partitions will also be hashed, in addition to the
|
||||
# hashing done on configuration directories. This is recommended if one
|
||||
# partition has a very bushy mailbox tree.
|
||||
hashimapspool: true
|
||||
|
||||
-# Enable virtual domains
|
||||
-# and set default domain to localhost
|
||||
-virtdomains: yes
|
||||
-defaultdomain: localhost
|
||||
+# Disable virtual domains by default
|
||||
+virtdomains: off
|
||||
|
||||
###################################################################
|
||||
## User experience settings
|
||||
@@ -72,6 +69,10 @@ defaultdomain: localhost
|
||||
# Minimum time between POP mail fetches in minutes
|
||||
popminpoll: 1
|
||||
|
||||
+# Conversation support is required for jmap
|
||||
+conversations: 1
|
||||
+conversations_db: twoskip
|
||||
+
|
||||
###################################################################
|
||||
## User Authentication settings
|
||||
###################################################################
|
||||
@@ -99,6 +100,12 @@ sasl_auto_transition: no
|
||||
## SSL/TLS Options
|
||||
###################################################################
|
||||
|
||||
+# These three files will automatically be generated by the systemd unit when
|
||||
+# the service starts for the first time.
|
||||
+tls_server_cert: /etc/pki/cyrus-imapd/cyrus-imapd.pem
|
||||
+tls_server_key: /etc/pki/cyrus-imapd/cyrus-imapd-key.pem
|
||||
+tls_client_ca_file: /etc/pki/cyrus-imapd/cyrus-imapd-ca.pem
|
||||
+
|
||||
# File containing the global certificate used for ALL services (imap,
|
||||
# pop3, lmtp, sieve)
|
||||
#tls_server_cert: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
Loading…
Reference in New Issue
Block a user