Blob Blame Raw
Name:           fishpoll
Version:        0.1.7
Release:        13%{dist}
Summary:        Daemon and Client to run scripts when triggered from the network

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
Source3:        fishpolld.1
Source4:        fishpoke.1
Patch0:         01-python-runtime-binary.patch
BuildArch:      noarch

BuildRequires:  python2-devel
%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 and Client files that allows scripts to be run remotely when
triggered from the network.

%package -n fishpolld
Summary: Daemon to run scripts when triggered from the network
%description -n fishpolld
%{summary}.

%package -n fishpoke
Summary: Client programs for fishpolld server
%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}

%if 0%{?fedora} >= 30
%patch0 -p0
%endif

%build

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}

%{__install} -Dp -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}.d/%{name}_file_sample
%{__install} -Dp -m0644 %{SOURCE3} %{buildroot}%{_mandir}/man1/fishpolld.1
%{__install} -Dp -m0644 %{SOURCE4} %{buildroot}%{_mandir}/man1/fishpoke.1

%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


%files


%files -n fishpolld
%doc COPYING README
%{_sbindir}/fishpolld
%dir %{_sysconfdir}/%{name}.d
%config %{_sysconfdir}/%{name}.d/%{name}_file_sample
%{_mandir}/man1/fishpolld.1.gz

%if 0%{?fedora} >= 15
%{_unitdir}/fishpolld.service
%else
%{_initrddir}/%{name}
%endif


%files -n fishpoke
%doc COPYING README
%{_bindir}/fishpoke
%{_mandir}/man1/fishpoke.1.gz

%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
* Fri May 03 2019 Andrea Veri <averi@fedoraproject.org> - 0.1.7-13
- B-D on python2-devel as per policy
- Land 01-python-runtime-binary.patch to make sure the Python binary
  is explicitly declared (fixes RH BZ #1674886).

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.1.7-10
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Sep 26 2016 Andrea Veri <averi@fedoraproject.org> - 0.1.7-6
- Make use of an EnvironmentFile directive on the service file
  and allow systemd to source env variables from it.

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Apr 24 2013 Andrea Veri <averi@fedoraproject.org> - 0.1.7-1
- New upstream release.

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu May 31 2012 Andrea Veri <averi@fedoraproject.org> - 0.1.6-5
- Add the missing fishpoke/fishpolld man pages.

* Wed Feb 03 2012 Mario Santagiuliana <fedora@marionline.it> - 0.1.6-4
- Package naming changed.

* Mon Feb 02 2012 Andrea Veri <averi@fedoraproject.org> - 0.1.6-3
- Improved SPEC file.

* Mon Feb 02 2012 Andrea Veri <averi@fedoraproject.org> - 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 <averi@fedoraproject.org> - 0.1.6-1
- New upstream release. Fixed license.
- Setup a systemd file for Fedora.

* Mon Feb 02 2012 Andrea Veri <averi@fedoraproject.org> - 0.1.5-1
- First package release. Thanks to Owen Taylor.