Name: fishpoll Version: 0.1.6 Release: 4%{dist} Summary: Daemon and Client to run scripts when triggered from the network Group: System Environment/Daemons License: GPLv2+ URL: http://git.fishsoup.net/cgit/fishpoll/tree/README Source0: http://git.fishsoup.net/cgit/%{name}/snapshot/%{name}-%{version}.tar.gz Source1: fishpolld.service Source2: %{name}_file_sample BuildArch: noarch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: python >= 2.4 %if 0%{?fedora} >= 15 BuildRequires: systemd-units Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units %else Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts %endif Requires: fishpolld = %{version}-%{release} Requires: fishpoke = %{version}-%{release} %description Daemon to run scripts when triggered from the network etc %package -n fishpolld Summary: Daemon to run scripts when triggered from the network Group: System Environment/Daemons %description -n fishpolld %{summary}. %package -n fishpoke Summary: Client programs for fishpolld server Group: System Environment/Base %description -n fishpoke Client for the Fishpoll server. The fishpoke program is used to trigger a poll immediately instead of waiting for the configured polling interval. %prep %setup -q -n %{name}-%{version} %build %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %{__install} -Dp -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}.d/%{name}_file_sample %if 0%{?fedora} >= 15 %{__install} -Dp -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/fishpolld.service rm %{buildroot}%{_sysconfdir}/init.d/%{name} %else mkdir -p %{buildroot}%{_initrddir}/ mv %{buildroot}%{_sysconfdir}/init.d/%{name} %{buildroot}%{_initrddir}/ %endif %clean rm -rf %{buildroot} %files %files -n fishpolld %defattr(-,root,root,-) %doc COPYING README %{_sbindir}/fishpolld %dir %{_sysconfdir}/%{name}.d %{_sysconfdir}/%{name}.d/%{name}_file_sample %if 0%{?fedora} >= 15 %{_unitdir}/fishpolld.service %else %{_initrddir}/%{name} %endif %files -n fishpoke %defattr(-,root,root,-) %{_bindir}/fishpoke %post %if 0%{?fedora} >= 15 if [ $1 -eq 1 ] ; then /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %else /sbin/chkconfig --add fishpoll %endif %preun %if 0%{?fedora} >= 15 if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable fishpolld.service > /dev/null 2>&1 || : /bin/systemctl stop fishpolld.service > /dev/null 2>&1 || : fi %else if [ $1 -eq 0 ] ; then /sbin/service fishpoll stop > /dev/null 2>&1 ||: /sbin/chkconfig --del fishpoll fi %endif %postun %if 0%{?fedora} >= 15 /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart fishpolld.service >/dev/null 2>&1 || : fi %else if [ $1 -ge 1 ] ; then /sbin/service fishpoll condrestart >/dev/null 2>&1 ||: fi %endif %changelog * Wed Feb 03 2012 Mario Santaiguliana - 0.1.6-4 - Suggestion to change package naming need to complete description * Mon Feb 02 2012 Andrea Veri - 0.1.6-3 - Improved SPEC file. * Mon Feb 02 2012 Andrea Veri - 0.1.6-2 - Added more content to dinstinguish which files will go to the Fedora package and which ones will go to the EPEL one. (mostly SysV vs systemd) - Added example file. * Mon Feb 02 2012 Andrea Veri - 0.1.6-1 - New upstream release. Fixed license. - Setup a systemd file for Fedora. * Mon Feb 02 2012 Andrea Veri - 0.1.5-1 - First package release. Thanks to Owen Taylor.