From 1393a26fd8399b9127e1cba22a1c0dd19ed64063 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sat, 2 Oct 2021 22:08:07 +0200 Subject: [PATCH] - up to 3.0.16 --- cyrus-imapd-gcc10.patch | 37 --------- cyrus-imapd-icu.patch | 39 --------- cyrus-imapd-libcap.patch | 51 ------------ cyrus-imapd-sphinx2.patch | 170 -------------------------------------- cyrus-imapd.spec | 19 ++--- openssl3.patch | 11 +++ 6 files changed, 18 insertions(+), 309 deletions(-) delete mode 100644 cyrus-imapd-gcc10.patch delete mode 100644 cyrus-imapd-icu.patch delete mode 100644 cyrus-imapd-libcap.patch delete mode 100644 cyrus-imapd-sphinx2.patch create mode 100644 openssl3.patch diff --git a/cyrus-imapd-gcc10.patch b/cyrus-imapd-gcc10.patch deleted file mode 100644 index a385968..0000000 --- a/cyrus-imapd-gcc10.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 817449994d4acae0023c34ab045649c38a6d37eb Mon Sep 17 00:00:00 2001 -From: Bron Gondwana -Date: Sun, 15 Jul 2018 03:34:46 +1000 -Subject: [PATCH] conversations: move open_conversationsdb to conversations.c - -Thanks Chris Newman ---- - imap/conversations.c | 2 ++ - imap/conversations.h | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/imap/conversations.c b/imap/conversations.c -index 620486afc..5c96eb1bb 100644 ---- a/imap/conversations.c -+++ b/imap/conversations.c -@@ -100,6 +100,8 @@ - - #define CONVERSATIONS_VERSION 0 - -+struct conversations_open *open_conversations; -+ - static conv_status_t NULLSTATUS = { 0, 0, 0}; - - static char *convdir = NULL; -diff --git a/imap/conversations.h b/imap/conversations.h -index 179969f0a..cd77df856 100644 ---- a/imap/conversations.h -+++ b/imap/conversations.h -@@ -78,7 +78,7 @@ struct conversations_open { - struct conversations_open *next; - }; - --struct conversations_open *open_conversations; -+extern struct conversations_open *open_conversations; - - typedef struct conversation conversation_t; - typedef struct conv_folder conv_folder_t; diff --git a/cyrus-imapd-icu.patch b/cyrus-imapd-icu.patch deleted file mode 100644 index 2458aa0..0000000 --- a/cyrus-imapd-icu.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- cyrus-imapd-3.0.9/lib/charset.h.orig 2019-03-15 01:31:20.000000000 +0100 -+++ cyrus-imapd-3.0.9/lib/charset.h 2019-04-16 18:25:58.340151121 +0200 -@@ -60,6 +60,10 @@ - - #include "unicode/ucnv.h" - -+#ifdef __cplusplus -+extern "C" { -+#endif -+ - #include "util.h" - - typedef int comp_pat; -@@ -127,4 +131,8 @@ - charset_t charset, int encoding, - const char *subtype, int flags); - -+#ifdef __cplusplus -+} -+#endif -+ - #endif /* INCLUDED_CHARSET_H */ ---- cyrus-imapd-3.0.9/imap/xapian_wrap.cpp.orig 2019-03-15 01:31:20.000000000 +0100 -+++ cyrus-imapd-3.0.9/imap/xapian_wrap.cpp 2019-04-16 18:30:21.718724277 +0200 -@@ -14,13 +14,13 @@ - #include "search_part.h" - #include "xmalloc.h" - #include "xapian_wrap.h" --#include "charset.h" - #include "ptrarray.h" - - - /* generated headers are not necessarily in current directory */ - #include "imap/imap_err.h" - }; -+#include "charset.h" - - #include - diff --git a/cyrus-imapd-libcap.patch b/cyrus-imapd-libcap.patch deleted file mode 100644 index eb56a7e..0000000 --- a/cyrus-imapd-libcap.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -urNp -x '*.orig' cyrus-imapd-3.0.9.org/lib/util.c cyrus-imapd-3.0.9/lib/util.c ---- cyrus-imapd-3.0.9.org/lib/util.c 2019-03-15 01:31:20.000000000 +0100 -+++ cyrus-imapd-3.0.9/lib/util.c 2021-05-07 22:56:04.721472003 +0200 -@@ -579,7 +579,7 @@ EXPORTED int set_caps(int stage __attrib - } - #endif - --static int cap_setuid(int uid, int is_master) -+static int cyrus_cap_setuid(int uid, int is_master) - { - int r; - -@@ -599,7 +599,7 @@ EXPORTED int become_cyrus(int is_master) - int result; - static uid_t uid = 0; - -- if (uid) return cap_setuid(uid, is_master); -+ if (uid) return cyrus_cap_setuid(uid, is_master); - - const char *cyrus = cyrus_user(); - const char *mail = cyrus_group(); -@@ -645,7 +645,7 @@ EXPORTED int become_cyrus(int is_master) - return -1; - } - -- result = cap_setuid(newuid, is_master); -+ result = cyrus_cap_setuid(newuid, is_master); - - /* Only set static uid if successful, else future calls won't reset gid */ - if (result == 0) -diff -urNp -x '*.orig' cyrus-imapd-3.0.9.org/master/master.c cyrus-imapd-3.0.9/master/master.c ---- cyrus-imapd-3.0.9.org/master/master.c 2019-03-15 01:31:20.000000000 +0100 -+++ cyrus-imapd-3.0.9/master/master.c 2021-05-07 22:56:04.721472003 +0200 -@@ -285,7 +285,7 @@ static void get_statsock(int filedes[2]) - fatalf(1, "unable to set close-on-exec: %m"); - } - --static int cap_bind(int socket, struct sockaddr *addr, socklen_t length) -+static int cyrus_cap_bind(int socket, struct sockaddr *addr, socklen_t length) - { - int r; - -@@ -643,7 +643,7 @@ static void service_create(struct servic - #endif - - oldumask = umask((mode_t) 0); /* for linux */ -- r = cap_bind(s->socket, res->ai_addr, res->ai_addrlen); -+ r = cyrus_cap_bind(s->socket, res->ai_addr, res->ai_addrlen); - umask(oldumask); - if (r < 0) { - syslog(LOG_ERR, "unable to bind to %s/%s socket: %m", diff --git a/cyrus-imapd-sphinx2.patch b/cyrus-imapd-sphinx2.patch deleted file mode 100644 index 9b8ebc9..0000000 --- a/cyrus-imapd-sphinx2.patch +++ /dev/null @@ -1,170 +0,0 @@ -From a5fce9f3b5bddb166e9be71d9a0120a012d632b7 Mon Sep 17 00:00:00 2001 -From: Jakob Gahde -Date: Tue, 10 Sep 2019 16:51:32 +0200 -Subject: [PATCH] Add compatibility for Sphinx 2 (fixes #2732) - -This allows the documentation to be generated using version 2 of Sphinx. -Nearly all of the changes are directly based on changes in upstream Sphinx, -however they have been adapted to also keep compatibility with version 1.3.2 -(which is the minimum version required by the current configuration). ---- - docsrc/conf.py | 6 +++--- - docsrc/exts/sphinxlocal/builders/manpage.py | 19 ++++++++++++++----- - docsrc/exts/sphinxlocal/roles/cyrusman.py | 11 ++++++++++- - docsrc/exts/sphinxlocal/writers/manpage.py | 11 ++++++++--- - 4 files changed, 35 insertions(+), 12 deletions(-) - -diff --git a/docsrc/conf.py b/docsrc/conf.py -index c241cff77..ecb83768e 100644 ---- a/docsrc/conf.py -+++ b/docsrc/conf.py -@@ -301,7 +301,7 @@ - for tuple in pathset: - os.chdir(tuple[0]) - for rstfile in glob.glob("*.rst"): -- author = [("The Cyrus Team")] -+ authors = [("The Cyrus Team")] - orphan = 'False'; - with io.open(rstfile,'r',encoding="utf8") as f: - for line in f: -@@ -309,14 +309,14 @@ - orphan = 'True'; - break; - if line.startswith('.. author: '): -- author.append(line[11: len(line.strip())]) -+ authors.append(line[11: len(line.strip())]) - f.close() - if orphan == 'False': - man_pages.append( - (os.path.splitext(os.path.join(tuple[0],rstfile))[0], - os.path.splitext(rstfile)[0], - u'Cyrus IMAP documentation', -- author, -+ authors, - tuple[1]) - ) - -diff --git a/docsrc/exts/sphinxlocal/builders/manpage.py b/docsrc/exts/sphinxlocal/builders/manpage.py -index a6281f799..856530b62 100644 ---- a/docsrc/exts/sphinxlocal/builders/manpage.py -+++ b/docsrc/exts/sphinxlocal/builders/manpage.py -@@ -32,6 +32,12 @@ - # Translater in it. - from sphinxlocal.writers.manpage import CyrusManualPageWriter - -+try: -+ from sphinx.util import logging -+ logger = logging.getLogger(__name__) -+except: -+ logger = None -+ - class CyrusManualPageBuilder(ManualPageBuilder): - """ - Builds groff output in manual page format. -@@ -44,8 +50,11 @@ class CyrusManualPageBuilder(ManualPageBuilder): - #settings_defaults = {} - - def init(self): -+ global logger -+ if logger is None: -+ logger = self - if not self.config.man_pages: -- self.warn('no "man_pages" config value found; no manual pages ' -+ logger.warn('no "man_pages" config value found; no manual pages ' - 'will be written') - - def write(self, *ignored): -@@ -56,7 +65,7 @@ def write(self, *ignored): - components=(docwriter,), - read_config_files=True).get_default_values() - -- self.info(bold('writing... '), nonl=True) -+ logger.info(bold('writing... '), nonl=True) - - for info in self.config.man_pages: - docname, name, description, authors, section = info -@@ -67,7 +76,7 @@ def write(self, *ignored): - authors = [] - - targetname = '%s.%s' % (name, section) -- self.info(darkgreen(targetname) + ' { ', nonl=True) -+ logger.info(darkgreen(targetname) + ' { ', nonl=True) - destination = FileOutput( - destination_path=path.join(self.outdir, targetname), - encoding='utf-8') -@@ -76,7 +85,7 @@ def write(self, *ignored): - docnames = set() - largetree = inline_all_toctrees(self, docnames, docname, tree, - darkgreen, [docname]) -- self.info('} ', nonl=True) -+ logger.info('} ', nonl=True) - self.env.resolve_references(largetree, docname, self) - # remove pending_xref nodes - for pendingnode in largetree.traverse(addnodes.pending_xref): -@@ -89,7 +98,7 @@ def write(self, *ignored): - largetree.settings.section = section - - docwriter.write(largetree, destination) -- self.info() -+ logger.info('') - - def setup(app): - app.add_builder(CyrusManualPageBuilder) -diff --git a/docsrc/exts/sphinxlocal/roles/cyrusman.py b/docsrc/exts/sphinxlocal/roles/cyrusman.py -index 5d7eb6c65..6f2e94a8e 100644 ---- a/docsrc/exts/sphinxlocal/roles/cyrusman.py -+++ b/docsrc/exts/sphinxlocal/roles/cyrusman.py -@@ -17,8 +17,17 @@ - from string import Template - import re - -+try: -+ from sphinx.util import logging -+ logger = logging.getLogger(__name__) -+except: -+ logger = None -+ - def setup(app): -- app.info('Initializing cyrusman plugin') -+ global logger -+ if logger is None: -+ logger = app -+ logger.info('Initializing cyrusman plugin') - app.add_crossref_type('cyrusman', 'cyrusman', '%s', nodes.generated) - return - -diff --git a/docsrc/exts/sphinxlocal/writers/manpage.py b/docsrc/exts/sphinxlocal/writers/manpage.py -index 13864e0d9..c5dfdfbeb 100644 ---- a/docsrc/exts/sphinxlocal/writers/manpage.py -+++ b/docsrc/exts/sphinxlocal/writers/manpage.py -@@ -12,13 +12,17 @@ - :license: BSD, see LICENSE for details. - """ - -+import docutils - from docutils import nodes - from sphinx.writers.manpage import ( -- MACRO_DEF, - ManualPageWriter, - ManualPageTranslator as BaseTranslator - ) - -+docutils_version_info = tuple(map(int, docutils.__version__.split('.'))) -+if docutils_version_info < (0, 11): -+ from sphinx.writers.manpage import MACRO_DEF -+ - - from sphinx import addnodes - from sphinx.locale import admonitionlabels, _ -@@ -73,8 +77,9 @@ def __init__(self, builder, *args, **kwds): - self._docinfo['version'] = builder.config.version - self._docinfo['manual_group'] = builder.config.project - -- # since self.append_header() is never called, need to do this here -- self.body.append(MACRO_DEF) -+ # In docutils < 0.11 self.append_header() was never called -+ if docutils_version_info < (0, 11): -+ self.body.append(MACRO_DEF) - - # overwritten -- don't wrap literal_block with font calls - self.defs['literal_block'] = ('.sp\n.nf\n', '\n.fi\n') diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec index 19da0a3..b2ea166 100644 --- a/cyrus-imapd.spec +++ b/cyrus-imapd.spec @@ -17,12 +17,12 @@ Summary: High-performance mail store with IMAP and POP3 Summary(pl.UTF-8): Wysoko wydajny serwer IMAP i POP3 Summary(pt_BR.UTF-8): Um servidor de mail de alto desempenho que suporta IMAP e POP3 Name: cyrus-imapd -Version: 3.0.9 -Release: 8 +Version: 3.0.16 +Release: 1 License: BSD-like Group: Networking/Daemons/POP3 -Source0: https://www.cyrusimap.org/releases/%{name}-%{version}.tar.gz -# Source0-md5: 8452f81e3c30fa9af6f456e143e98576 +Source0: https://github.com/cyrusimap/cyrus-imapd/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz +# Source0-md5: f93394d3bf981d558a8d7e2cb989b568 Source1: cyrus-README Source2: cyrus-procmailrc Source3: cyrus-deliver-wrapper.c @@ -38,11 +38,8 @@ Source13: cyrus-sync.init Patch0: %{name}-et.patch Patch1: link.patch Patch2: %{name}-clamav-0.101.patch -Patch3: %{name}-icu.patch -Patch4: %{name}-libcap.patch -Patch5: %{name}-gcc10.patch -Patch6: %{name}-sphinx2.patch -Patch7: %{name}-sphinx3.patch +Patch3: %{name}-sphinx3.patch +Patch4: openssl3.patch URL: http://www.cyrusimap.org/ BuildRequires: autoconf >= 2.63 BuildRequires: automake @@ -210,9 +207,6 @@ Perlowy interfejs do biblioteki cyrus-imapd. %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 cp -p %{SOURCE1} %{SOURCE2} %{SOURCE4} %{SOURCE5} . @@ -469,6 +463,7 @@ fi %{_libdir}/libcyrus_imap.la %{_libdir}/libcyrus_sieve.la %{_pkgconfigdir}/libcyrus.pc +%{_pkgconfigdir}/libcyrus_imap.pc %{_pkgconfigdir}/libcyrus_min.pc %{_pkgconfigdir}/libcyrus_sieve.pc diff --git a/openssl3.patch b/openssl3.patch new file mode 100644 index 0000000..2af3906 --- /dev/null +++ b/openssl3.patch @@ -0,0 +1,11 @@ +--- cyrus-imapd-3.0.9/imap/httpd.c~ 2019-03-15 01:31:20.000000000 +0100 ++++ cyrus-imapd-3.0.9/imap/httpd.c 2021-10-02 21:53:14.171936180 +0200 +@@ -914,7 +914,7 @@ + cyrus_version(), + SASL_VERSION_MAJOR, SASL_VERSION_MINOR, SASL_VERSION_STEP); + #ifdef HAVE_SSL +- buf_printf(&serverinfo, " OpenSSL/%s", SHLIB_VERSION_NUMBER); ++ buf_printf(&serverinfo, " OpenSSL/%s", OPENSSL_SHLIB_VERSION); + #endif + + #ifdef HAVE_NGHTTP2 -- 2.44.0