Accepting request 206422 from server:mail
- Add systemd support for openSUSE >= 12.3 (forwarded request 204925 from vitezslav_cizek) OBS-URL: https://build.opensuse.org/request/show/206422 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fetchmail?expand=0&rev=59
This commit is contained in:
commit
64ccc98b3a
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Oct 27 18:18:54 UTC 2013 - p.drouand@gmail.com
|
||||||
|
|
||||||
|
- Add systemd support for openSUSE >= 12.3
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Apr 29 12:45:09 UTC 2013 - vcizek@suse.com
|
Mon Apr 29 12:45:09 UTC 2013 - vcizek@suse.com
|
||||||
|
|
||||||
|
11
fetchmail.service
Normal file
11
fetchmail.service
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=A remote-mail retrieval utility
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=fetchmail
|
||||||
|
ExecStart=/usr/bin/fetchmail -d 900 -f /etc/fetchmailrc
|
||||||
|
RestartSec=1
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -24,12 +24,7 @@ BuildRequires: postfix
|
|||||||
BuildRequires: procmail
|
BuildRequires: procmail
|
||||||
BuildRequires: pwdutils
|
BuildRequires: pwdutils
|
||||||
BuildRequires: python-devel
|
BuildRequires: python-devel
|
||||||
%if 0%{?suse_version} > 1000
|
|
||||||
%define with_krb5 1
|
|
||||||
%endif
|
|
||||||
%if 0%{?with_krb5}
|
|
||||||
BuildRequires: krb5-devel
|
BuildRequires: krb5-devel
|
||||||
%endif
|
|
||||||
%if 0%{?suse_version} > 1220
|
%if 0%{?suse_version} > 1220
|
||||||
BuildRequires: gpg-offline
|
BuildRequires: gpg-offline
|
||||||
%endif
|
%endif
|
||||||
@ -48,11 +43,18 @@ Source2: %{name}.logrotate
|
|||||||
Source3: sysconfig.%{name}
|
Source3: sysconfig.%{name}
|
||||||
Source4: http://sourceforge.net/projects/fetchmail/files/branch_6.3/%{name}-%{version}.tar.xz.asc
|
Source4: http://sourceforge.net/projects/fetchmail/files/branch_6.3/%{name}-%{version}.tar.xz.asc
|
||||||
Source5: %{name}.keyring
|
Source5: %{name}.keyring
|
||||||
|
Source6: %{name}.service
|
||||||
|
Source7: %{name}.tmpfiles
|
||||||
Patch0: fetchmail-6.3.8-smtp_errors.patch
|
Patch0: fetchmail-6.3.8-smtp_errors.patch
|
||||||
PreReq: %fillup_prereq
|
%if 0%{?suse_version} >=1230
|
||||||
PreReq: %insserv_prereq
|
BuildRequires: pkgconfig(systemd)
|
||||||
PreReq: coreutils
|
%{?systemd_requires}
|
||||||
PreReq: pwdutils
|
%else
|
||||||
|
Requires(pre): %insserv_prereq
|
||||||
|
%endif
|
||||||
|
Requires(pre): %fillup_prereq
|
||||||
|
Requires(pre): coreutils
|
||||||
|
Requires(pre): pwdutils
|
||||||
BuildRequires: xz
|
BuildRequires: xz
|
||||||
Requires: logrotate
|
Requires: logrotate
|
||||||
Suggests: smtp_daemon
|
Suggests: smtp_daemon
|
||||||
@ -116,11 +118,18 @@ make %{?_smp_mflags}
|
|||||||
ln -sf fetchmail.1.gz %{buildroot}/%{_mandir}/man1/fetchmailconf.1.gz
|
ln -sf fetchmail.1.gz %{buildroot}/%{_mandir}/man1/fetchmailconf.1.gz
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
||||||
cp fetchmail.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/fetchmail
|
cp fetchmail.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/fetchmail
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/init.d
|
|
||||||
mkdir -p %{buildroot}/sbin
|
mkdir -p %{buildroot}/sbin
|
||||||
|
%if 0%{?suse_version} >=1230
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/tmpfiles.d
|
||||||
|
install -m 755 %{S:6} $RPM_BUILD_ROOT/%{_unitdir}/%{name}.service
|
||||||
|
install -m 644 %{S:7} $RPM_BUILD_ROOT/%{_libexecdir}/tmpfiles.d/%{name}.conf
|
||||||
|
%else
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/init.d
|
||||||
cp fetchmail.init %{buildroot}%{_initddir}/fetchmail
|
cp fetchmail.init %{buildroot}%{_initddir}/fetchmail
|
||||||
chmod +x %{buildroot}%{_initddir}/fetchmail
|
chmod +x %{buildroot}%{_initddir}/fetchmail
|
||||||
ln -s ../etc/init.d/fetchmail %{buildroot}/sbin/rcfetchmail
|
ln -s ../etc/init.d/fetchmail %{buildroot}/sbin/rcfetchmail
|
||||||
|
%endif
|
||||||
touch %{buildroot}%{_sysconfdir}/fetchmailrc
|
touch %{buildroot}%{_sysconfdir}/fetchmailrc
|
||||||
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
|
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
|
||||||
cp sysconfig.%{name} %{buildroot}%{_localstatedir}/adm/fillup-templates
|
cp sysconfig.%{name} %{buildroot}%{_localstatedir}/adm/fillup-templates
|
||||||
@ -137,14 +146,23 @@ usr/sbin/useradd -r -g daemon -s /bin/false \
|
|||||||
-c "mail retrieval daemon" -d /var/lib/fetchmail fetchmail 2>/dev/null || :
|
-c "mail retrieval daemon" -d /var/lib/fetchmail fetchmail 2>/dev/null || :
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
%if 0%{?suse_version} >=1230
|
||||||
|
%{fillup_only}
|
||||||
|
%service_add_post %{name}.service
|
||||||
|
%else
|
||||||
%{fillup_and_insserv}
|
%{fillup_and_insserv}
|
||||||
|
%endif
|
||||||
# Ensure that all files are readable by fetchmail with non-root UID.
|
# Ensure that all files are readable by fetchmail with non-root UID.
|
||||||
touch var/log/fetchmail
|
touch var/log/fetchmail
|
||||||
chown fetchmail var/log/fetchmail
|
chown fetchmail var/log/fetchmail
|
||||||
chmod 0600 var/log/fetchmail
|
chmod 0600 var/log/fetchmail
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
%if 0%{?suse_version} >=1230
|
||||||
|
%service_del_postun %{name}.service
|
||||||
|
%else
|
||||||
%{insserv_cleanup}
|
%{insserv_cleanup}
|
||||||
|
%endif
|
||||||
if [ $1 == 0 ]; then
|
if [ $1 == 0 ]; then
|
||||||
rm -rf var/lib/fetchmail
|
rm -rf var/lib/fetchmail
|
||||||
fi
|
fi
|
||||||
@ -158,8 +176,13 @@ fi
|
|||||||
%doc COPYING FAQ FEATURES NEWS NOTES OLDNEWS README README.NTLM README.SSL README.SSL-SERVER TODO contrib *.html *.txt *.pdf
|
%doc COPYING FAQ FEATURES NEWS NOTES OLDNEWS README README.NTLM README.SSL README.SSL-SERVER TODO contrib *.html *.txt *.pdf
|
||||||
%ghost %config(noreplace) %attr(0600, fetchmail, root) %{_sysconfdir}/fetchmailrc
|
%ghost %config(noreplace) %attr(0600, fetchmail, root) %{_sysconfdir}/fetchmailrc
|
||||||
%config(noreplace) %{_sysconfdir}/logrotate.d/fetchmail
|
%config(noreplace) %{_sysconfdir}/logrotate.d/fetchmail
|
||||||
|
%if 0%{?suse_version} >=1230
|
||||||
|
%{_unitdir}/%{name}.service
|
||||||
|
%{_libexecdir}/tmpfiles.d/%{name}.conf
|
||||||
|
%else
|
||||||
%{_sysconfdir}/init.d/fetchmail
|
%{_sysconfdir}/init.d/fetchmail
|
||||||
/sbin/rcfetchmail
|
/sbin/rcfetchmail
|
||||||
|
%endif
|
||||||
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
|
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}
|
||||||
|
|
||||||
%files -n fetchmailconf
|
%files -n fetchmailconf
|
||||||
|
1
fetchmail.tmpfiles
Normal file
1
fetchmail.tmpfiles
Normal file
@ -0,0 +1 @@
|
|||||||
|
d /run/fetchmail 700 fetchmail nobody
|
Loading…
x
Reference in New Issue
Block a user