2014-09-09 20:02:38 +02:00
|
|
|
#
|
|
|
|
# spec file for package dovecot
|
|
|
|
#
|
2022-02-12 23:26:10 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2014-09-09 20:02:38 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2020-07-16 08:56:23 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-09-09 20:02:38 +02:00
|
|
|
#
|
|
|
|
|
2014-11-25 08:59:25 +01:00
|
|
|
|
2014-09-09 20:02:38 +02:00
|
|
|
Name: dovecot
|
2017-12-24 02:08:16 +01:00
|
|
|
Version: 2.3
|
2014-09-09 20:02:38 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: IMAP and POP3 Server Written Primarily with Security in Mind
|
2019-07-12 08:19:00 +02:00
|
|
|
License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT
|
2014-09-09 20:02:38 +02:00
|
|
|
Group: Productivity/Networking/Email/Servers
|
2020-07-16 08:56:23 +02:00
|
|
|
URL: http://www.dovecot.org/
|
2014-09-09 20:02:38 +02:00
|
|
|
PreReq: dovecot-implementation
|
2020-11-18 11:13:33 +01:00
|
|
|
PreReq: shadow
|
2021-04-21 16:08:31 +02:00
|
|
|
Recommends: %{name}23
|
2014-09-09 20:02:38 +02:00
|
|
|
#!BuildIgnore: dovecot-implementation
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildArch: noarch
|
2021-04-21 16:08:31 +02:00
|
|
|
Source0: %{name}-2.0.configfiles
|
|
|
|
Source1: %{name}-2.1.configfiles
|
|
|
|
Source2: %{name}-2.2.configfiles
|
2014-09-09 20:02:38 +02:00
|
|
|
Source4: %{name}.pam
|
|
|
|
Source5: %{name}.README.SUSE
|
2021-04-21 16:08:31 +02:00
|
|
|
Source7: %{name}.tmpfiles.d
|
|
|
|
Source8: %{name}.service
|
|
|
|
Source9: %{name}.socket
|
|
|
|
Source10: %{name}-2.1-pigeonhole.configfiles
|
|
|
|
Source11: %{name}-2.2-pigeonhole.configfiles
|
|
|
|
Source12: %{name}-2.3.configfiles
|
|
|
|
Source13: %{name}-2.3-pigeonhole.configfiles
|
2014-11-25 08:59:25 +01:00
|
|
|
|
2014-09-09 20:02:38 +02:00
|
|
|
%description
|
|
|
|
Dovecot is an IMAP and POP3 server for Linux and UNIX-like systems,
|
|
|
|
written primarily with security in mind. Although it is written in C,
|
|
|
|
it uses several coding techniques to avoid most of the common pitfalls.
|
|
|
|
|
|
|
|
Dovecot can work with standard mbox and maildir formats and is fully
|
|
|
|
compatible with UW-IMAP and Courier IMAP servers as well as mail
|
|
|
|
clients accessing the mailboxes directly.
|
|
|
|
|
|
|
|
This is a wrapper package that will just handle common things for all
|
|
|
|
versioned dovecot packages.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
for i in $RPM_SOURCE_DIR/*.configfiles ; do
|
|
|
|
echo "Creating ghost files for '$i'"
|
|
|
|
for j in $(<$i) ; do
|
|
|
|
install -D -m 0644 /dev/null %{buildroot}$j
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2021-04-21 16:08:31 +02:00
|
|
|
install -D -p -m 0644 %{S:5} %{buildroot}%{_datadir}/doc/packages/%{name}/README.SUSE
|
2014-09-09 20:02:38 +02:00
|
|
|
install -d %{buildroot}%{_sbindir}
|
2021-04-21 16:08:31 +02:00
|
|
|
%{__install} -D -m 644 %{S:7} %{buildroot}/usr/lib/tmpfiles.d/%{name}.conf
|
2014-09-09 20:02:38 +02:00
|
|
|
%{__ln_s} -f %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
2021-04-21 16:08:31 +02:00
|
|
|
install -D -p -m 0644 %{S:8} %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
install -D -p -m 0644 %{S:9} %{buildroot}%{_unitdir}/%{name}.socket
|
2014-09-09 20:02:38 +02:00
|
|
|
|
|
|
|
# install pam config
|
2021-04-21 16:08:31 +02:00
|
|
|
%{__install} -D -p -m 0644 %{S:4} %{buildroot}%{_sysconfdir}/pam.d/%{name}
|
2014-09-09 20:02:38 +02:00
|
|
|
# create /var directories
|
2021-04-21 16:08:31 +02:00
|
|
|
%{__install} -p -m 0755 -Dd \
|
2014-09-09 20:02:38 +02:00
|
|
|
%{buildroot}%{_var}/run/%{name}/login/ \
|
|
|
|
%{buildroot}%{_var}/lib/%{name}/
|
|
|
|
|
|
|
|
%pre
|
2020-11-18 11:13:33 +01:00
|
|
|
getent group %{name} > /dev/null || /usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || :
|
2021-04-21 16:08:31 +02:00
|
|
|
getent passwd %{name} > /dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot imapd" -d %{_var}/run/%{name} %{name}
|
|
|
|
getent passwd dovenull > /dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot login" -d %{_var}/run/%{name} dovenull
|
2014-09-09 20:02:38 +02:00
|
|
|
# try to copy the default configuration.
|
|
|
|
#
|
|
|
|
# we fail silently if the dovecot-implementation package is not
|
|
|
|
# installed yet. This allows us to break a little build loop between
|
|
|
|
# dovecot and dovecotXY.
|
2021-04-21 16:08:31 +02:00
|
|
|
if [ ! -e %{_sysconfdir}/%{name}/%{name}.conf -a -e %{_datadir}/%{name}/example-config/%{name}.conf ] ; then
|
2014-09-09 20:02:38 +02:00
|
|
|
# install default config
|
|
|
|
echo "Did not find a /etc/dovecot/dovecot.conf. copying default configuration"
|
2017-12-24 03:20:59 +01:00
|
|
|
cp -na %{_datadir}/%{name}/example-config/* %{_sysconfdir}/%{name}/
|
2014-09-09 20:02:38 +02:00
|
|
|
# the chmod breaks the lda. lets use the more open permissions
|
|
|
|
#chmod -Rv o= %{_sysconfdir}/%{name}/
|
|
|
|
fi
|
|
|
|
%service_add_pre %{name}.service %{name}.socket
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun %{name}.service %{name}.socket
|
|
|
|
|
|
|
|
%post
|
2021-04-21 16:08:31 +02:00
|
|
|
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
|
2014-09-09 20:02:38 +02:00
|
|
|
%service_add_post %{name}.service %{name}.socket
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun %{name}.service
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2021-04-21 16:08:31 +02:00
|
|
|
%doc %{_datadir}/doc/packages/%{name}/
|
2014-09-09 20:02:38 +02:00
|
|
|
# conf
|
2021-04-21 16:08:31 +02:00
|
|
|
%dir /etc/%{name}/
|
|
|
|
%ghost %config(noreplace) /etc/%{name}/*
|
2014-09-09 20:02:38 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
|
|
|
|
%{_sbindir}/rc%{name}
|
2021-04-21 16:08:31 +02:00
|
|
|
/usr/lib/tmpfiles.d/%{name}.conf
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
%{_unitdir}/%{name}.socket
|
|
|
|
%dir %{_localstatedir}/lib/%{name}
|
|
|
|
%ghost %dir /run/%{name}
|
|
|
|
%ghost %dir /run/%{name}/login
|
2014-09-09 20:02:38 +02:00
|
|
|
|
|
|
|
%changelog
|