diff --git a/fetchmail.service b/fetchmail.service new file mode 100644 index 0000000..f59312c --- /dev/null +++ b/fetchmail.service @@ -0,0 +1,11 @@ +[Unit] +Description=A remote-mail retrieval utility +After=local-fs.target network.target + +[Service] +User=mail +ExecStart=/usr/bin/fetchmail -d 300 --fetchmailrc /etc/fetchmailrc.example +RestartSec=1 + +[Install] +WantedBy=multi-user.target diff --git a/fetchmail.spec b/fetchmail.spec index ea749d9..adfd30c 100644 --- a/fetchmail.spec +++ b/fetchmail.spec @@ -1,9 +1,13 @@ Summary: A remote mail retrieval and forwarding utility Name: fetchmail Version: 6.3.26 -Release: 6%{?dist} +Release: 7%{?dist} Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz Source1: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz.asc +# systemd service file +Source2: fetchmail.service +# example configuration file +Source3: fetchmailrc.example URL: http://www.fetchmail.info/ # For a breakdown of the licensing, see COPYING License: GPL+ and Public Domain @@ -34,6 +38,14 @@ make %install make install DESTDIR=$RPM_BUILD_ROOT +# install example systemd unit +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir}/fetchmail.service + +# install example config file +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +install -p -m 600 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fetchmailrc.example + # remove fetchmailconf stuff rm -f $RPM_BUILD_ROOT%{_bindir}/fetchmailconf* rm -f $RPM_BUILD_ROOT%{_mandir}/man1/fetchmailconf.1* @@ -45,8 +57,13 @@ rm -f $RPM_BUILD_ROOT%{python_sitelib}/fetchmailconf.py* %doc COPYING FAQ FEATURES NEWS NOTES README README.SSL TODO %{_bindir}/fetchmail %{_mandir}/man1/fetchmail.1* +%{_unitdir}/fetchmail.service +%config(noreplace) %attr(0600, mail, mail) %{_sysconfdir}/fetchmailrc.example %changelog +* Mon Sep 14 2015 Vitezslav Crhonek - 6.3.26-7 +- Add exapmles of systemd service file and config file + * Mon Jul 13 2015 Vitezslav Crhonek - 6.3.26-6 - Fix fetchmail FTBFS in rawhide Resolves: #1239500 diff --git a/fetchmailrc.example b/fetchmailrc.example new file mode 100644 index 0000000..e6c2c12 --- /dev/null +++ b/fetchmailrc.example @@ -0,0 +1,2 @@ +#poll pop.domain.com proto pop3 +# user 'user1' there with password 'secret' is user1 here