diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec
index a062dfe..daec511 100644
--- a/cyrus-imapd.spec
+++ b/cyrus-imapd.spec
@@ -28,6 +28,9 @@ Source0: http://www.cyrusimap.org/releases/%name-%version.tar.gz
Patch0: patch-cyrus-testsuite-endianness
Patch1: patch-cyrus-testsuite-endianness2
+Patch2: patch-cyrus-testsuite-endianness3
+Patch3: patch-cyrus-testsuite-endianness4
+Patch4: patch-cyrus-autoreconf-keep-version
Source10: cyrus-imapd.logrotate
Source11: cyrus-imapd.pam-config
@@ -190,6 +193,7 @@ IMAP server.
%prep
%autosetup -p1 -S git
+echo %version > VERSION
# Install the Fedora-specific documentation file
install -m 644 %SOURCE16 doc/
@@ -235,7 +239,7 @@ popd
# instead.
# Running autoreconf will confuse the program about what version it is.
-# autoreconf -vi
+autoreconf -vi
%configure \
--disable-silent-rules \
@@ -382,7 +386,7 @@ mv %buildroot/%_mandir/man8/httpd.8 %buildroot/%_mandir/man8/cyr_httpd.8
#remove executable bit from docs
for ddir in doc perl/imap/examples
do
- find $ddir -type f -ls -exec chmod -x {} \;
+ find $ddir -type f -exec chmod -x {} \;
done
# Remove pointless libtool archives
@@ -395,11 +399,23 @@ find %buildroot -name ".packlist" -exec rm {} \;
%check
+# The test suite fails on big-endian machines currently. This is tracked at
+# https://github.com/cyrusimap/cyrus-imapd/issues/1993
+%ifnarch s390x ppc64
make %{?_smp_mflags} check || exit 1
+%endif
-%if %{with cassandane}
+
+%if %{with cassandane} && %__isa_bits == 64
# Run the Cassandane test suite. This will exhaustively test the various
# server components, but running it in a mock chroot is rather an exercise.
+# Sadly Cassandane simply can't run on a 32-bit host at the moment. It needs
+# Perl to be compiled with support for 64-bit types, and due to an unfortunate
+# typo in the Perl specfile, that's not the case currently.
+# https://bugzilla.redhat.com/show_bug.cgi?id=1268828
+# There may be other Cassandane issues, so occasional testing on 32-bit
+# architectures is needed until this is all resolved.
+# Tracked upstream as https://github.com/cyrusimap/cassandane/issues/21
pushd cassandane
mkdir -p imaptest/src
diff --git a/patch-cyrus-autoreconf-keep-version b/patch-cyrus-autoreconf-keep-version
new file mode 100644
index 0000000..a515915
--- /dev/null
+++ b/patch-cyrus-autoreconf-keep-version
@@ -0,0 +1,53 @@
+From 216934c3f4884999206715db3499fc0162e1d65c Mon Sep 17 00:00:00 2001
+From: ellie timoney
+Date: Tue, 30 May 2017 17:52:04 +1000
+Subject: [PATCH] build: preserve release version across autoreconf
+
+Administrators building from a release tarball can safely run
+autoreconf without the source tree forgetting its version (or
+worse, scavenging an unrelated version string from some git
+repository in an ancestor directory).
+---
+ Makefile.am | 6 +++++-
+ tools/git-version.sh | 4 ++++
+ 3 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 9a4fa49be..e37822aac 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -116,7 +116,8 @@ noinst_HEADERS =
+ noinst_LTLIBRARIES =
+ noinst_PROGRAMS =
+ EXTRA_DIST = \
+- $(wildcard tools/vzic/*)
++ $(wildcard tools/vzic/*) \
++ VERSION
+
+ if COM_ERR
+ COMPILE_ET_DEP = com_err/et/compile_et
+@@ -1910,6 +1911,9 @@ dist-hook:
+ find $(top_distdir) -type f -name .sphinx-build.stamp -delete
+ rm -rf $(top_distdir)/$(SPHINX_CACHE)
+
++VERSION: tools/git-version.sh
++ $(AM_V_GEN)$< > $@.NEW && mv $@.NEW $@
++
+ install-data-hook:
+ if CMULOCAL
+ $(INSTALL) -m 644 $(top_srcdir)/depot/depot.conf $(DESTDIR)/
+diff --git a/tools/git-version.sh b/tools/git-version.sh
+index 66563c162..c728769db 100755
+--- a/tools/git-version.sh
++++ b/tools/git-version.sh
+@@ -41,6 +41,10 @@
+ # OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ #
+
++# if we've come from a release package, ignore git entirely
++test -s VERSION &&
++ exec head -1 VERSION
++
+ # first try: based on annotated git tags (real releases)
+ version=$(git describe --dirty=-dirty 2>/dev/null)
+ test -n "$version" &&
diff --git a/patch-cyrus-testsuite-endianness3 b/patch-cyrus-testsuite-endianness3
new file mode 100644
index 0000000..5ba6c26
--- /dev/null
+++ b/patch-cyrus-testsuite-endianness3
@@ -0,0 +1,58 @@
+From e3ee582fcf74e0754d2a850fbabe270125e334e8 Mon Sep 17 00:00:00 2001
+From: ellie timoney
+Date: Wed, 31 May 2017 10:56:27 +1000
+Subject: [PATCH] cunit: run cyrusdb tests first
+
+Other suites depend on cyrusdb functionality so if it's broken, it
+would be good to know that before they start complaining.
+---
+ Makefile.am | 2 +-
+ cunit/{db.testc => aaa-db.testc} | 0
+ doc/internal/unit-tests.html | 2 +-
+ 3 files changed, 2 insertions(+), 2 deletions(-)
+ rename cunit/{db.testc => aaa-db.testc} (100%)
+
+diff --git a/Makefile.am b/Makefile.am
+index e37822aac..c2c82d15d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -618,6 +618,7 @@ cunit_FRAMEWORK = \
+ cunit/timeofday.h
+
+ cunit_TESTS = \
++ cunit/aaa-db.testc \
+ cunit/annotate.testc \
+ cunit/backend.testc \
+ cunit/binhex.testc \
+@@ -628,7 +629,6 @@ cunit_TESTS = \
+ cunit/command.testc \
+ cunit/conversations.testc \
+ cunit/crc32.testc \
+- cunit/db.testc \
+ cunit/dlist.testc \
+ cunit/duplicate.testc \
+ cunit/getxstring.testc \
+diff --git a/cunit/db.testc b/cunit/aaa-db.testc
+similarity index 100%
+rename from cunit/db.testc
+rename to cunit/aaa-db.testc
+diff --git a/doc/internal/unit-tests.html b/doc/internal/unit-tests.html
+index a2c490dfb..75a945853 100644
+--- a/doc/internal/unit-tests.html
++++ b/doc/internal/unit-tests.html
+@@ -452,6 +452,7 @@
+ of the cunit_TESTS variable.
+
+ cunit_TESTS = \
++ cunit/aaa-db.testc \
+ cunit/annotate.testc \
+ cunit/backend.testc \
+ cunit/binhex.testc \
+@@ -460,7 +461,6 @@
+ cunit/byteorder64.testc \
+ cunit/charset.testc \
+ cunit/crc32.testc \
+- cunit/db.testc \
+ cunit/dlist.testc \
+ cunit/duplicate.testc \
+
diff --git a/patch-cyrus-testsuite-endianness4 b/patch-cyrus-testsuite-endianness4
new file mode 100644
index 0000000..2d2544e
--- /dev/null
+++ b/patch-cyrus-testsuite-endianness4
@@ -0,0 +1,218 @@
+From 443e54646bc529654bc4bb2d58ddde9751f43fe2 Mon Sep 17 00:00:00 2001
+From: ellie timoney
+Date: Mon, 29 May 2017 15:35:38 +1000
+Subject: [PATCH] cunit/conversations: conversations_open_path failures are
+ fatal
+
+---
+ cunit/conversations.testc | 48 +++++++++++++++++++++++------------------------
+ 1 file changed, 24 insertions(+), 24 deletions(-)
+
+diff --git a/cunit/conversations.testc b/cunit/conversations.testc
+index 026d271c9..85562cbed 100644
+--- a/cunit/conversations.testc
++++ b/cunit/conversations.testc
+@@ -22,7 +22,7 @@ static void test_open(void)
+ struct conversations_state *state = NULL;
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ r = conversations_abort(&state);
+ CU_ASSERT_EQUAL(r, 0);
+@@ -38,7 +38,7 @@ static void test_getset(void)
+ arrayu64_t cids = ARRAYU64_INITIALIZER;
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* Database is empty, so get should succeed and report no results */
+ memset(&cid, 0x45, sizeof(cid));
+@@ -62,7 +62,7 @@ static void test_getset(void)
+ CU_ASSERT_EQUAL(r, 0);
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* get should still succeed after the db is closed & reopened */
+ memset(&cid, 0x45, sizeof(cid));
+@@ -87,7 +87,7 @@ static void test_abort(void)
+ arrayu64_t cids = ARRAYU64_INITIALIZER;
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* Database is empty, so get should succeed and report no results */
+ memset(&cid, 0x45, sizeof(cid));
+@@ -113,7 +113,7 @@ static void test_abort(void)
+
+ /* open the db again */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* the set vanished with the txn abort, so get should
+ * succeed and report no results */
+@@ -147,7 +147,7 @@ static void test_prune(void)
+ unsigned int nseen = 0, ndeleted = 0;
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* Add keys, with delays in between */
+ /* TODO: CUnit needs a time warping system */
+@@ -174,7 +174,7 @@ static void test_prune(void)
+ /* Should be able to get all 3 msgids */
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ memset(&cid, 0x45, sizeof(cid));
+ arrayu64_truncate(&cids, 0);
+@@ -247,10 +247,10 @@ static void test_two(void)
+ arrayu64_t cids = ARRAYU64_INITIALIZER;
+
+ r = conversations_open_path(DBNAME, &state1);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ r = conversations_open_path(DBNAME2, &state2);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* Databases are empty, so gets of either msgid from either db
+ * should succeed and report no results */
+@@ -385,8 +385,8 @@ static void test_folder_rename(void)
+ conv_folder_t *folder;
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
+- CU_ASSERT_PTR_NOT_NULL(state);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
++ CU_ASSERT_PTR_NOT_NULL_FATAL(state);
+
+ /* setup the records we expect */
+ r = conversations_add_msgid(state, C_MSGID1, C_CID);
+@@ -420,7 +420,7 @@ static void test_folder_rename(void)
+
+ /* open the db again */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* do a rename */
+ r = conversations_rename_folder(state, FOLDER2, FOLDER3);
+@@ -432,7 +432,7 @@ static void test_folder_rename(void)
+
+ /* open the db again */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ conv = NULL;
+ r = conversation_load(state, C_CID, &conv);
+@@ -475,7 +475,7 @@ static void test_folders(void)
+ imapopts[IMAPOPT_CONVERSATIONS_COUNTED_FLAGS].val.s = "\\Draft $HasRandom";
+
+ r = conversations_open_path(DBNAME3, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ imapopts[IMAPOPT_CONVERSATIONS_COUNTED_FLAGS].val.s = NULL;
+
+@@ -672,7 +672,7 @@ static void test_folders(void)
+
+ /* open the db again */
+ r = conversations_open_path(DBNAME3, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* get should still succeed and report all values we gave it */
+ conv = NULL;
+@@ -805,7 +805,7 @@ static void test_folder_ordering(void)
+ int *counts = 0;
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* Database is empty, so get should succeed and report no results */
+ conv = NULL;
+@@ -903,7 +903,7 @@ static void test_folder_ordering(void)
+
+ /* open the db again */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* get should still succeed and report all values we gave it */
+ conv = NULL;
+@@ -956,7 +956,7 @@ static void __test_senders(void)
+ int *counts = 0;
+
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* Database is empty, so get should succeed and report no results */
+ conv = NULL;
+@@ -1045,7 +1045,7 @@ static void __test_senders(void)
+
+ /* open the db again */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ /* get should still succeed and report all values we gave it */
+ conv = NULL;
+@@ -1150,7 +1150,7 @@ static void test_dump(void)
+
+ /* generate some data in the database */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ for (i = 0 ; i < N_MSGID_TO_CID ; i++) {
+ gen_msgid_cid(i, msgid, sizeof(msgid), &cid);
+@@ -1179,7 +1179,7 @@ static void test_dump(void)
+
+ /* open and dump the database */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ conversations_dump(state, fp);
+
+@@ -1198,7 +1198,7 @@ static void test_dump(void)
+
+ /* open and truncate the database */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ r = conversations_truncate(state);
+ CU_ASSERT_EQUAL(r, 0);
+@@ -1208,7 +1208,7 @@ static void test_dump(void)
+
+ /* check we can no longer find any of the data */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ for (i = 0 ; i < N_MSGID_TO_CID ; i++) {
+ gen_msgid_cid(i, msgid, sizeof(msgid), &cid);
+@@ -1234,7 +1234,7 @@ static void test_dump(void)
+
+ /* finally check that we got all the data back */
+ r = conversations_open_path(DBNAME, &state);
+- CU_ASSERT_EQUAL(r, 0);
++ CU_ASSERT_EQUAL_FATAL(r, 0);
+
+ for (i = 0 ; i < N_MSGID_TO_CID ; i++) {
+ gen_msgid_cid(i, msgid, sizeof(msgid), &cid);