Stanislav Ochotnicky 45ce79
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
Name:           fedwatch
Stanislav Ochotnicky 836d0a
Version:        0.5
1070a2
Release:        12%{?dist}
Stanislav Ochotnicky 45ce79
Summary:        Tool for watching fedmsg messages and running arbitrary scripts
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
License:        LGPLv2+
Stanislav Ochotnicky 45ce79
URL:            https://github.com/sochotnicky/fedwatch
Stanislav Ochotnicky 45ce79
Source0:        https://pypi.python.org/packages/source/f/fedwatch/fedwatch-%{version}.tar.gz
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
BuildArch:      noarch
Stanislav Ochotnicky 45ce79
BuildRequires:  python2-devel
5ae51f
BuildRequires:  python2-setuptools
5ae51f
BuildRequires:  python2-dpath
Stanislav Ochotnicky 45ce79
BuildRequires:  fedmsg
Stanislav Ochotnicky 45ce79
5ae51f
Requires:       python2-%{name} = %{version}-%{release}
5ae51f
Requires:       python2-dpath
Stanislav Ochotnicky 45ce79
Requires:       fedmsg
5ae51f
Requires:       python2-fedmsg-meta-fedora-infrastructure
Stanislav Ochotnicky 45ce79
%if 0%{?rhel} && 0%{?rhel} < 7
Stanislav Ochotnicky 45ce79
Requires(post): chkconfig
Stanislav Ochotnicky 45ce79
Requires(preun): chkconfig
Stanislav Ochotnicky 45ce79
# This is for /sbin/service
Stanislav Ochotnicky 45ce79
Requires(preun): initscripts
Stanislav Ochotnicky 45ce79
%else
Stanislav Ochotnicky 45ce79
Requires(post): systemd
Stanislav Ochotnicky 45ce79
Requires(preun): systemd
Stanislav Ochotnicky 45ce79
Requires(postun): systemd
Stanislav Ochotnicky 45ce79
BuildRequires: systemd
Stanislav Ochotnicky 45ce79
%endif
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%description
Stanislav Ochotnicky 45ce79
Tool and library for watching fedmsg messages and running arbitrary scripts in a
Stanislav Ochotnicky 45ce79
nice way. 
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
Think of fedwatch as simple converter from fedmsg json messages into shell
Stanislav Ochotnicky 45ce79
arguments for scripts.
Stanislav Ochotnicky 45ce79
e356c8
%package -n python2-%{name}
e356c8
%{?python_provide:%python_provide python2-%{name}}
Stanislav Ochotnicky 45ce79
Summary:        Python 2 module for watching fedmsg messages and running arbitrary scripts
Stanislav Ochotnicky 45ce79
e356c8
%description -n python2-%{name}
Stanislav Ochotnicky 45ce79
%{summary}.
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%prep
Stanislav Ochotnicky 45ce79
%setup -q -n fedwatch-%{version}
Stanislav Ochotnicky 45ce79
chmod -x examples/fedwatch.d/*
Stanislav Ochotnicky 45ce79
# get rid of hashbang
Stanislav Ochotnicky 45ce79
sed -i '1{d}' fedwatch.py
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%build
b37807
%py2_build
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%install
fc470d
%py2_install
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
# create initial config
Stanislav Ochotnicky 45ce79
mkdir %{buildroot}%{_sysconfdir}
Stanislav Ochotnicky 45ce79
cat > %{buildroot}%{_sysconfdir}/%{name}.conf << EOF
Stanislav Ochotnicky 45ce79
# Empty configuration file. See /usr/share/doc/%{name}*/examples
Stanislav Ochotnicky 45ce79
# for working examples
Stanislav Ochotnicky 45ce79
EOF
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
mkdir %{buildroot}%{_sysconfdir}/%{name}.d/
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
# install init/systemd integration
Stanislav Ochotnicky 45ce79
%if 0%{?rhel} && 0%{?rhel} < 7
Stanislav Ochotnicky 45ce79
mkdir -p %{buildroot}/%{_initddir}
Stanislav Ochotnicky 45ce79
cp fedwatch.init %{buildroot}/%{_initddir}/fedwatch
Stanislav Ochotnicky 45ce79
%else
Stanislav Ochotnicky 45ce79
mkdir -p %{buildroot}/%{_unitdir}
Stanislav Ochotnicky 45ce79
cp fedwatch.service %{buildroot}/%{_unitdir}/
Stanislav Ochotnicky 45ce79
%endif
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%if 0%{?rhel} && 0%{?rhel} < 7
Stanislav Ochotnicky 45ce79
%post
Stanislav Ochotnicky 45ce79
# This adds the proper /etc/rc*.d links for the script
Stanislav Ochotnicky 45ce79
/sbin/chkconfig --add fedwatch
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%preun
Stanislav Ochotnicky 45ce79
if [ $1 -eq 0 ] ; then
Stanislav Ochotnicky 45ce79
    /sbin/service fedwatch stop >/dev/null 2>&1
Stanislav Ochotnicky 45ce79
    /sbin/chkconfig --del fedwatch
Stanislav Ochotnicky 45ce79
fi
Stanislav Ochotnicky 45ce79
%else
Stanislav Ochotnicky 45ce79
%post
Stanislav Ochotnicky 45ce79
%systemd_post fedwatch.service
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%preun
Stanislav Ochotnicky 45ce79
%systemd_preun fedwatch.service
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%postun
Stanislav Ochotnicky 45ce79
%systemd_postun_with_restart fedwatch.service
Stanislav Ochotnicky 45ce79
%endif
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%files
Stanislav Ochotnicky 45ce79
%doc README.md LICENSE
Stanislav Ochotnicky 45ce79
%doc examples
Stanislav Ochotnicky 45ce79
%{_bindir}/fedwatch
Stanislav Ochotnicky 45ce79
%config(noreplace) %{_sysconfdir}/fedwatch.conf
Stanislav Ochotnicky 45ce79
%dir %{_sysconfdir}/fedwatch.d
Stanislav Ochotnicky 45ce79
%if 0%{?rhel} && 0%{?rhel} < 7
Stanislav Ochotnicky 45ce79
%attr(755, root, root) %{_initddir}/fedwatch
Stanislav Ochotnicky 45ce79
%else
Stanislav Ochotnicky 45ce79
%{_unitdir}/fedwatch.service
Stanislav Ochotnicky 45ce79
%endif
Stanislav Ochotnicky 45ce79
e356c8
%files -n python2-%{name}
f0cd65
%{python2_sitelib}/fedwatch*
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
%changelog
1070a2
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-12
1070a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
1070a2
fa09de
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-11
fa09de
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
fa09de
d2b382
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-10
d2b382
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
d2b382
b6066c
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-9
b6066c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b6066c
5ae51f
* Tue Feb 06 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.5-8
5ae51f
- Update Python 2 dependency declarations to new packaging standards
5ae51f
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
5ae51f
e356c8
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.5-7
e356c8
- Python 2 binary package renamed to python2-fedwatch
e356c8
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
e356c8
5f23d9
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-6
5f23d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
5f23d9
446997
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-5
446997
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
446997
54cd79
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-4
54cd79
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
54cd79
f91959
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-3
f91959
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f91959
73c844
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
73c844
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
73c844
Stanislav Ochotnicky 836d0a
* Tue Jun 10 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.5-1
Stanislav Ochotnicky 836d0a
- Update to latest upstream
Stanislav Ochotnicky 836d0a
- Fix handling of non-string arguments for scripts
Stanislav Ochotnicky 836d0a
e44356
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4-3
e44356
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e44356
Stanislav Ochotnicky 45ce79
* Tue Apr 29 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.4-2
Stanislav Ochotnicky 45ce79
- Fix changelog
Stanislav Ochotnicky 45ce79
- Make sure documentation is not executable
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
* Tue Apr 29 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.4-1
Stanislav Ochotnicky 45ce79
- Update to latest upstream
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
* Thu Mar 20 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.3-1
Stanislav Ochotnicky 45ce79
- Update to new upstream version
Stanislav Ochotnicky 45ce79
- Handle errors a bit better
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
* Thu Mar 20 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.2-1
Stanislav Ochotnicky 45ce79
- Update to new upstream version
Stanislav Ochotnicky 45ce79
- Add support for systemd and init
Stanislav Ochotnicky 45ce79
Stanislav Ochotnicky 45ce79
* Wed Mar 19 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.1-1
Stanislav Ochotnicky 45ce79
- Initial packaging
Stanislav Ochotnicky 45ce79