|
@@ -1,11 +1,4 @@
|
|
|
-Summary: Dovecot Secure imap server
|
|
|
-Summary(ja): Dovecot セキュア IMAP サーバ
|
|
|
-Name: dovecot
|
|
|
-Version: 2.3.10
|
|
|
-Release: 1%{?_dist_release}
|
|
|
-#dovecot itself is MIT, a few sources are PD, pigeonhole is LGPLv2
|
|
|
-License: MIT and LGPLv2 and BSD with advertising
|
|
|
-Group: System Environment/Daemons
|
|
|
+%bcond_with systemd
|
|
|
|
|
|
%define build_postgres 1
|
|
|
%define build_mysql 1
|
|
@@ -19,8 +12,19 @@ Group: System Environment/Daemons
|
|
|
# pop before smtp (drac)
|
|
|
%define build_drac 0
|
|
|
|
|
|
-URL: http://www.dovecot.org/
|
|
|
+Summary: Dovecot Secure imap server
|
|
|
+Summary(ja): Dovecot セキュア IMAP サーバ
|
|
|
+Name: dovecot
|
|
|
+Version: 2.3.10.1
|
|
|
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
+Group: System Environment/Daemons
|
|
|
+Vendor: Project Vine
|
|
|
+Distribution: Vine Linux
|
|
|
+Packager: iwamoto
|
|
|
|
|
|
+#dovecot itself is MIT, a few sources are PD, pigeonhole is LGPLv2
|
|
|
+License: MIT and LGPLv2 and BSD with advertising
|
|
|
+URL: http://www.dovecot.org/
|
|
|
%global shortver %(echo "%{version}" | perl -p -e 's/^([0-9]+\.[0-9]+).*$/\\1/')
|
|
|
Source: https://dovecot.org/releases/%{shortver}/%{name}-%{version}.tar.gz
|
|
|
Source1: dovecot.init
|
|
@@ -46,10 +50,6 @@ Patch4: dovecot-2.2-mkcert-10years.patch
|
|
|
Patch10: dovecot-2.3.0.1-libxcrypt.patch
|
|
|
Patch11: dovecot-2.3.4-de42b54.patch
|
|
|
|
|
|
-Packager: iwamoto
|
|
|
-Vendor: Project Vine
|
|
|
-Distribution: Vine Linux
|
|
|
-
|
|
|
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
|
BuildRequires: openssl-devel, pam-devel, zlib-devel
|
|
|
BuildRequires: bzip2-devel, libcap-devel
|
|
@@ -63,10 +63,15 @@ BuildRequires: libxcrypt-devel
|
|
|
# needs to require initscripts package
|
|
|
Requires: initscripts
|
|
|
Requires(pre): /usr/sbin/useradd
|
|
|
-Requires(post): /sbin/chkconfig, /usr/sbin/useradd, /sbin/chkconfig
|
|
|
+Requires(post): /usr/sbin/useradd
|
|
|
Requires(preun): /usr/sbin/userdel, /usr/sbin/groupdel
|
|
|
+%if %{with systemd}
|
|
|
+%{?systemd_requires}
|
|
|
+%else
|
|
|
+Requires(post): /sbin/chkconfig, /sbin/chkconfig
|
|
|
Requires(preun): /sbin/chkconfig, /sbin/service
|
|
|
Requires(postun): /sbin/service
|
|
|
+%endif
|
|
|
|
|
|
%if %{build_postgres}
|
|
|
BuildRequires: libpq-devel
|
|
@@ -212,6 +217,9 @@ cp %{SOURCE110} .
|
|
|
--with-zlib \
|
|
|
%if %{build_ldap}
|
|
|
--with-ldap=plugin \
|
|
|
+%endif
|
|
|
+%if %{with systemd}
|
|
|
+ --with-systemdsystemunitdir=%{_unitdir} \
|
|
|
%endif
|
|
|
--with-docs
|
|
|
|
|
@@ -264,8 +272,12 @@ popd
|
|
|
|
|
|
# install -p -m 755 src/plugins/convert/convert-tool $RPM_BUILD_ROOT%{_libexecdir}/%{name}
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
+install -p -D -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_tmpfilesdir}/dovecot.conf
|
|
|
+%else
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
|
|
|
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/dovecot
|
|
|
+%endif
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
|
|
|
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/dovecot
|
|
@@ -332,6 +344,13 @@ pushd doc
|
|
|
#rm -f securecoding.txt thread-refs.txt
|
|
|
popd
|
|
|
|
|
|
+
|
|
|
+%check
|
|
|
+make check
|
|
|
+cd dovecot-2.3-pigeonhole-%{pigeonholever}
|
|
|
+make check
|
|
|
+
|
|
|
+
|
|
|
%clean
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
@@ -346,7 +365,15 @@ useradd -r -g dovenull -d /usr/libexec/dovecot -s /sbin/nologin -c "Dovecot's un
|
|
|
exit 0
|
|
|
|
|
|
%post
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_post dovecot.service
|
|
|
+install -d -m 0755 -g dovecot -d /run/dovecot
|
|
|
+install -d -m 0755 -d /run/dovecot/empty
|
|
|
+install -d -m 0750 -g dovenull -d /run/dovecot/login
|
|
|
+install -d -m 0750 -g dovenull -d /run/dovecot/token-login
|
|
|
+%else
|
|
|
/sbin/chkconfig --add %{name}
|
|
|
+%endif
|
|
|
# generate the ssl certificates
|
|
|
if [ ! -f %{ssldir}/certs/%{name}.pem ]; then
|
|
|
SSLDIR=%{ssldir} OPENSSLCONFIG=%{ssldir}/dovecot-openssl.cnf \
|
|
@@ -359,20 +386,24 @@ fi
|
|
|
exit 0
|
|
|
|
|
|
%preun
|
|
|
-if [ $1 = 0 ]; then
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_preun dovecot.service dovecot.socket
|
|
|
+%else
|
|
|
+if [ $1 = 0 -o -x /bin/systemctl ]; then
|
|
|
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
|
|
/sbin/chkconfig --del %{name} || :
|
|
|
fi
|
|
|
+%endif
|
|
|
|
|
|
%postun
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_postun_with_restart dovecot.service
|
|
|
+%else
|
|
|
if [ "$1" -ge "1" ]; then
|
|
|
/sbin/service %{name} condrestart 2>/dev/null || :
|
|
|
fi
|
|
|
+%endif
|
|
|
|
|
|
-%check
|
|
|
-make check
|
|
|
-cd dovecot-2.3-pigeonhole-%{pigeonholever}
|
|
|
-make check
|
|
|
|
|
|
%files -f libs.filelist
|
|
|
%defattr(-,root,root,-)
|
|
@@ -388,7 +419,14 @@ make check
|
|
|
# %config(noreplace) %{_sysconfdir}/dovecot.conf
|
|
|
|
|
|
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/dovecot
|
|
|
+%if %{with systemd}
|
|
|
+%{_unitdir}/dovecot.service
|
|
|
+%{_unitdir}/dovecot.socket
|
|
|
+%{_tmpfilesdir}/dovecot.conf
|
|
|
+%else
|
|
|
%{_initrddir}/dovecot
|
|
|
+%endif
|
|
|
+
|
|
|
%config(noreplace) %{_sysconfdir}/pam.d/dovecot
|
|
|
%dir %{ssldir}
|
|
|
%dir %{ssldir}/certs
|
|
@@ -492,6 +530,10 @@ make check
|
|
|
%endif
|
|
|
|
|
|
%changelog
|
|
|
+* Mon May 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.3.10.1-1
|
|
|
+- new upstream release.
|
|
|
+- added systemd support (disabled as default).
|
|
|
+
|
|
|
* Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.3.10-1
|
|
|
- new upstream release.
|
|
|
- updated pigeonhole to 0.5.10.
|