libcyrus-imapd-devel: provide/obsolete cyrus-imapd-devel [release 3.2.4-2mamba;Mon Dec 14 2020]

This commit is contained in:
Silvan Calarco 2024-01-05 21:37:39 +01:00
parent b97aa62a6a
commit 493048d49b
5 changed files with 235 additions and 86 deletions

View File

@ -0,0 +1,47 @@
--- cyrus-imapd-2.5.16/lib/cyrusdb_berkeley.c.orig 2020-12-13 20:54:41.613236660 +0100
+++ cyrus-imapd-2.5.16/lib/cyrusdb_berkeley.c 2020-12-13 20:55:11.088806587 +0100
@@ -456,7 +456,7 @@
return r;
}
-static int gettid(struct txn **mytid, DB_TXN **tid, const char *where)
+static int mygettid(struct txn **mytid, DB_TXN **tid, const char *where)
{
int r;
@@ -499,7 +499,7 @@
if (data) *data = NULL;
if (datalen) *datalen = 0;
- r = gettid(mytid, &tid, "myfetch");
+ r = mygettid(mytid, &tid, "myfetch");
if (r) return r;
memset(&k, 0, sizeof(k));
@@ -594,7 +594,7 @@
/* k.flags |= DB_DBT_REALLOC;
d.flags |= DB_DBT_REALLOC;*/
- r = gettid(mytid, &tid, "foreach");
+ r = mygettid(mytid, &tid, "foreach");
if (r) return r;
if (0) {
@@ -739,7 +739,7 @@
if (!data)
datalen = 0;
- r = gettid(mytid, &tid, "mystore");
+ r = mygettid(mytid, &tid, "mystore");
if (r) return r;
memset(&k, 0, sizeof(k));
@@ -852,7 +852,7 @@
assert(dbinit && db);
assert(key && keylen);
- r = gettid(mytid, &tid, "delete");
+ r = mygettid(mytid, &tid, "delete");
if (r) return r;
memset(&k, 0, sizeof(k));

12
cyrus-imapd.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Cyrus IMAP mail server
After=network.target
[Service]
Type=simple
Restart=on-failure
ExecStart=@LIBEXECDIR@/cyrus/master
ExecReload=/usr/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@ -1,42 +1,71 @@
%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
Name: cyrus-imapd
Version: 2.4.17
Version: 3.2.4
Release: 2mamba
Summary: An IMAP server
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://cyrusimap.org
Source0: ftp://ftp.cyrusimap.org/cyrus-imapd/cyrus-imapd-%{version}.tar.gz
URL: http://www.cyrusimap.org/
Source0: https://github.com/cyrusimap/cyrus-imapd.git/cyrus-imapd-%{version}/cyrus-imapd-%{version}.tar.bz2
Source1: imapd-conf
Source2: imapd-initscript
Source3: imap-pam
Patch: %{name}-2.2.12-gcc4.patch
Source4: cyrus-imapd.service
Source5: cyrus-imapd.tmpfiles.conf
Source6: cyrus-imapd.sysusers.conf
Patch0: %{name}-2.2.12-gcc4.patch
Patch1: cyrus-imapd-2.5.16-conflicting-types-gettid.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libdb47-devel
BuildRequires: ldconfig
BuildRequires: libbrotli-devel
BuildRequires: libbzip2-devel
BuildRequires: libcap-devel
BuildRequires: libclamav-devel
BuildRequires: libe2fs-devel
BuildRequires: libfl-devel
BuildRequires: libgcc
BuildRequires: libical-devel
BuildRequires: libicu-devel
BuildRequires: libjansson-devel
BuildRequires: libjson-c-devel
BuildRequires: libkrb5-devel
BuildRequires: libnetsnmp-devel
BuildRequires: libnl1-devel
BuildRequires: libltdl-devel
BuildRequires: liblzma-devel
BuildRequires: libmariadb-devel
BuildRequires: libnghttp2-devel
BuildRequires: libnsl-devel
BuildRequires: libopenldap-devel
BuildRequires: libopenssl-devel
BuildRequires: libpci-devel
BuildRequires: libpcre-devel
BuildRequires: libpcre2-devel
BuildRequires: libperl
BuildRequires: libsasl-devel
BuildRequires: libpostgresql-devel
BuildRequires: libsasl2-devel
BuildRequires: libsqlite-devel
BuildRequires: libstdc++6-devel
BuildRequires: libtirpc-devel
BuildRequires: libuuid-devel
BuildRequires: libwrap-devel
BuildRequires: libxapian-devel
BuildRequires: libxml2-devel
BuildRequires: libz-devel
BuildRequires: libzstd-devel
BuildRequires: perl-JSON
BuildRequires: perl-Net-Server
BuildRequires: perl-URI
BuildRequires: perl-Unix-Syslog
BuildRequires: perl-devel
## AUTOBUILDREQ-END
BuildRequires: perl-devel >= %{perl_major_ver}
BuildRequires: libnetsnmp-devel >= 5.9
BuildRequires: net-snmp
BuildRequires: bison
BuildRequires: flex
#Requires: libdb2 >= 2.7.7, libkrb5 >= 1.3.6
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
@ -49,38 +78,68 @@ All user access to mail is through the IMAP, POP3, or KPOP protocols.
Summary: Perl module for Cyrus IMAP
Group: Development/Libraries/Perl
Requires: perl >= %{perl_major_ver}
#Requires: libdb2 >= 2.7.7
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n perl-Imap
A Perl module for Cyrus IMAP.
%package devel
%package -n lib%{name}
Summary: Shared libraries provided by Cyrus IMAP
Group: System/Libraries
%description -n lib%{name}
Shared libraries provided by Cyrus IMAP.
%package -n lib%{name}-devel
Summary: Devel package for Cyrus IMAP
Group: Development/Libraries
Requires: %{name} = %{version}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: cyrus-imapd-devel
Obsoletes: cyrus-imapd-devel <= 2.4.17
%description devel
IMAP (Internet Message Access Protocol) is an Internet standards-track protocol for accessing messages (mail, bboards, news, etc).
The Cyrus IMAP server differs from other IMAP server implementations in that it is generally intended to be run on sealed servers, where normal users are not 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 the IMAP, POP3, or KPOP protocols.
%description -n lib%{name}-devel
Development headers and libraries for Cyrus IMAP.
Devel package for Cyrus IMAP.
%debug_package
%prep
%setup -q
#%patch1 -p1
autoreconf -f -i
%build
export PERL_MM_OPT="NO_PACKLIST=true NO_PERLLOCAL=true"
%configure \
--with-cyrus-prefix=%{_libexecdir}/cyrus \
--with-bdb-incdir=%{_includedir}/db51 \
--libexecdir=%{_libexecdir}/cyrus \
--with-bdb=db-5.3 \
--with-bdb-incdir=%{_includedir}/db53 \
--with-bdb-libdir=%{_libdir}/ \
--with-cyrus-user=imap \
--with-cyrus-group=imap \
--with-bdb=db-5.1
--enable-xapian \
--enable-autocreate \
--enable-idled \
--enable-nntp \
--enable-murder \
--enable-http \
--enable-calalarmd \
--enable-jmap \
--enable-replication \
--enable-backup \
--with-mysql=yes \
--with-pgsql=yes \
--with-ldap \
--with-libcap \
--with-pidfile=/run/cyrus-master.pid \
--with-syslogfacility=MAIL
sed -i 's|Makefile.PL PREFIX=\$(prefix)|Makefile.PL|' perl/Makefile
sed -i 's|Makefile.PL PREFIX=\$(prefix)|Makefile.PL|' perl/sieve/Makefile
#sed -i 's|Makefile.PL PREFIX=\$(prefix)|Makefile.PL|' perl/Makefile
#sed -i 's|Makefile.PL PREFIX=\$(prefix)|Makefile.PL|' perl/sieve/Makefile
%make -j1
%make
#-j1
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -89,12 +148,16 @@ sed -i "s|/usr/man|/var/tmp/perl-root/usr/share/man|" perl/imap/Makefile
%makeinstall
install -m 644 -D %{SOURCE1} %{buildroot}%{_sysconfdir}/imapd.conf
install -m 755 -D %{SOURCE2} %{buildroot}%{_initrddir}/imapd
install -m 644 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/imap
install -m 644 -D %{SOURCE4} %{buildroot}%{_unitdir}/cyrus-imapd.service
install -m 644 -D %{SOURCE5} %{buildroot}%{_tmpfilesdir}/cyrus-imapd.conf
install -m 644 -D %{SOURCE6} %{buildroot}%{_sysusersdir}/cyrus-imapd.conf
install -m 644 master/conf/normal.conf %{buildroot}%{_sysconfdir}/cyrus.conf
sed -i "s|@LIBEXECDIR@|%{_libexecdir}|" %{buildroot}%{_unitdir}/cyrus-imapd.service
cp tools/mkimap %{buildroot}%{_libexecdir}/cyrus/bin
#install -m 644 master/conf/normal.conf %{buildroot}%{_sysconfdir}/cyrus.conf
cp tools/mkimap %{buildroot}%{_libexecdir}/cyrus/
install -d %{buildroot}/var/imap
install -d %{buildroot}/var/spool/imap
@ -102,99 +165,119 @@ install -d %{buildroot}/var/spool/imap
%define PERL_ARCHLIB %(eval `perl -V:archlib`; echo $archlib)
%define PERL_SITEARCH %(eval `perl -V:sitearch`; echo $sitearch)
rm -f %{buildroot}%{PERL_ARCHLIB}/perllocal.pod
#rm -f %{buildroot}%{PERL_ARCHLIB}/perllocal.pod
#
#cat %{buildroot}%{PERL_SITEARCH}/auto/Cyrus/IMAP/.packlist \
# %{buildroot}%{PERL_SITEARCH}/auto/Cyrus/SIEVE/managesieve/.packlist | \
# sed "s@%{buildroot}@@g;s@.*/man/.*@&.gz@g" | \
# sort -u > perl.packlist
cat %{buildroot}%{PERL_SITEARCH}/auto/Cyrus/IMAP/.packlist \
%{buildroot}%{PERL_SITEARCH}/auto/Cyrus/SIEVE/managesieve/.packlist | \
sed "s@%{buildroot}@@g;s@.*/man/.*@&.gz@g" | \
sort -u > perl.packlist
rm %{buildroot}%{PERL_SITEARCH}/auto/Cyrus/IMAP/.packlist
rm %{buildroot}%{PERL_SITEARCH}/auto/Cyrus/SIEVE/managesieve/.packlist
find %{buildroot}%{PERL_SITEARCH}/auto/Cyrus -type f -exec chmod 755 {} \;
# conflicting with postfix
mv %{buildroot}%{_mandir}/man8/master.8 %{buildroot}%{_mandir}/man8/master-imapd.8
# conflicting with apache
mv %{buildroot}%{_mandir}/man8/httpd.8 %{buildroot}%{_mandir}/man8/httpd-imapd.8
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
rm -f perl_Imap.filelist
%pre
# new install
if [ $1 -eq 1 ]; then
/usr/sbin/groupadd imap
/usr/sbin/useradd -u 64910 -g imap -d /sbin/false imap -s /bin/false
fi
exit 0
%sysusers_create_package cyrus-imapd %{SOURCE6}
%tmpfiles_create_package cyrus-imapd %{SOURCE5}
:
%post
# new install
if [ $1 -eq 1 ]; then
/usr/libexec/cyrus/bin/mkimap
%{_libexecdir}/cyrus/bin/mkimap
/bin/chown -R imap.imap /var/imap/*
/bin/chown -R imap.imap /var/spool/imap/*
/sbin/chkconfig --add imapd
service imapd start
fi
exit 0
%systemd_post cyrus-imapd
:
%preun
# erase
if [ $1 -eq 0 ]; then
service imapd stop
/sbin/chkconfig --del imapd
/usr/sbin/userdel imap 2>/dev/null
/usr/sbin/groupdel imap 2>/dev/null
fi
exit 0
%systemd_preun cyrus-imapd
:
%postun
# upgrade
if [ $1 -eq 1 ]; then
service imapd restart
fi
exit 0
%systemd_postun cyrus-imapd
:
%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/imapd.conf
%config(noreplace) %{_sysconfdir}/cyrus.conf
#%config(noreplace) %{_sysconfdir}/cyrus.conf
%config(noreplace) %{_sysconfdir}/pam.d/imap
%attr(0755,root,root) %{_initrddir}/imapd
%{_bindir}/imtest
%{_bindir}/installsieve
%{_bindir}/lmtptest
%{_bindir}/mupdatetest
%{_bindir}/nntptest
%{_bindir}/pop3test
%{_bindir}/sieveshell
%{_bindir}/sivtest
%{_bindir}/smtptest
%{_bindir}/synctest
%{_bindir}/*
%{_sbindir}/*
%{_libexecdir}/cyrus/*
%{_mandir}/man1/imtest.1.gz
%{_mandir}/man1/installsieve.1.gz
%{_mandir}/man1/lmtptest.1.gz
%{_mandir}/man1/mupdatetest.1.gz
%{_mandir}/man1/nntptest.1.gz
%{_mandir}/man1/pop3test.1.gz
%{_mandir}/man1/sieveshell.1.gz
%{_mandir}/man1/sivtest.1.gz
%{_mandir}/man1/smtptest.1.gz
%{_mandir}/man3/imclient.3.gz
%{_unitdir}/cyrus-imapd.service
%{_tmpfilesdir}/cyrus-imapd.conf
%{_sysusersdir}/cyrus-imapd.conf
%{_mandir}/man1/cyradm.1*
%{_mandir}/man1/httptest.1*
%{_mandir}/man1/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}/man3/imclient.3*
%{_mandir}/man5/*
%{_mandir}/man8/*
%dir %attr(0750,imap,imap) %{_localstatedir}/imap
%dir %attr(0750,imap,imap) %{_localstatedir}/spool/imap
%files devel
%files -n lib%{name}
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/*.a
%{_libdir}/libcyrus.so.*
%{_libdir}/libcyrus_imap.so.*
%{_libdir}/libcyrus_min.so.*
%{_libdir}/libcyrus_sieve.so.*
%files -n perl-Imap -f perl.packlist
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/cyrus
%{_includedir}/cyrus/*
%{_libdir}/libcyrus.la
%{_libdir}/libcyrus.so
%{_libdir}/libcyrus_imap.la
%{_libdir}/libcyrus_imap.so
%{_libdir}/libcyrus_min.la
%{_libdir}/libcyrus_min.so
%{_libdir}/libcyrus_sieve.la
%{_libdir}/libcyrus_sieve.so
%{_libdir}/pkgconfig/libcyrus.pc
%{_libdir}/pkgconfig/libcyrus_imap.pc
%{_libdir}/pkgconfig/libcyrus_min.pc
%{_libdir}/pkgconfig/libcyrus_sieve.pc
%files -n perl-Imap
%defattr(-,root,root)
%dir %{perl_sitelib}/Cyrus
%dir %{perl_sitelib}/Cyrus/Annotator
%{perl_sitelib}/Cyrus/Annotator/*
%dir %{perl_sitearch}/Cyrus
%{perl_sitearch}/Cyrus/*
%dir %{perl_sitearch}/auto/Cyrus
%{perl_sitearch}/auto/Cyrus/*
%{_mandir}/man3/Cyrus::Annotator*.3pm*
%{_mandir}/man3/Cyrus::IMAP*.3pm*
%{_mandir}/man3/Cyrus::SIEVE*.3pm*
%changelog
* Mon Dec 14 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.4-2mamba
- libcyrus-imapd-devel: provide/obsolete cyrus-imapd-devel
* Sun Dec 13 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.2.4-1mamba
- update to 3.2.4
* Wed Nov 09 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.17-2mamba
- perl 5.24 mass rebuild
@ -253,5 +336,5 @@ exit 0
* Thu Jan 08 2004 Davide Madrisan <davide.madrisan@qilinux.it> 2.1.16-1qilnx
- specfile updated, package updated to version 2.1.16, rebuild with perl 5.8.2
* Tue Sep 10 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.15-1qilnx
* Wed Sep 10 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.15-1qilnx
- first build

View File

@ -0,0 +1,3 @@
g imap -
u imapd 64910 "Cyrus IMAP server" /var/imap
m imap imap

View File

@ -0,0 +1,4 @@
d /run/cyrus 0750 cyrus mail - -
d /run/cyrus/lock 0700 cyrus mail - -
d /run/cyrus/proc 0700 cyrus mail - -
d /run/cyrus/socket 0750 cyrus mail - -