b51cd26
%if 0%{?fedora} > 12 || 0%{?rhel} > 7
Massimo fafe581
%global with_python3 1
Massimo fafe581
%endif
Massimo fafe581
Massimo fafe581
%global srcname simplevisor
Massimo fafe581
Massimo fafe581
Name:		python-simplevisor
b51cd26
Version:	1.2
8ad969b
Release:	13%{?dist}
Massimo fafe581
Summary:	Python simple daemons supervisor
Massimo fafe581
License:	ASL 2.0
Massimo 75d1694
URL:		https://github.com/cern-mig/%{name}
b51cd26
Source0:	https://pypi.python.org/packages/ef/a1/d3fef46a01312d8cb470503a476f813bd31abbc2136be37eb9fd1f537b73/%{srcname}-%{version}.tar.gz
Massimo fafe581
BuildArch:	noarch
Massimo fafe581
BuildRequires:	python2-devel
Massimo fafe581
%if 0%{?with_python3}
Massimo fafe581
BuildRequires:	python3-devel
Massimo fafe581
%endif # if with_python3
d4af563
%if 0%{?fedora} >= 24
b51cd26
BuildRequires:	perl-generators
d4af563
%endif
b51cd26
BuildRequires:	perl-No-Worries
Massimo fafe581
%if ! 0%{?with_python3}
Massimo fafe581
BuildRequires:	python-argparse
Massimo fafe581
%endif
Massimo fafe581
# For python < 2.6 python-siplejson is required
f6ab705
%if 0%{?rhel} && 0%{?rhel} <= 6
Massimo fafe581
BuildRequires:	python-simplejson
Massimo fafe581
%endif
Massimo fafe581
cbb8315
%global _description\
cbb8315
Simplevisor is a simple daemons supervisor, it is inspired by\
Massimo fafe581
Erlang OTP and it can supervise hierarchies of services.
Massimo fafe581
cbb8315
%description %_description
cbb8315
cbb8315
%package -n python2-simplevisor
cbb8315
Summary: %summary
cbb8315
Provides:	python2-simplevisor
cbb8315
Requires:	perl-Config-General
cbb8315
Requires:	perl-No-Worries
cbb8315
%if ! 0%{?with_python3}
cbb8315
Requires:	python-argparse
cbb8315
%endif
f6ab705
%if 0%{?rhel} && 0%{?rhel} <= 6
cbb8315
Requires:	python-simplejson
cbb8315
%endif
cbb8315
%{?python_provide:%python_provide python2-simplevisor}
cbb8315
cbb8315
%description -n python2-simplevisor %_description
cbb8315
Massimo fafe581
%if 0%{?with_python3}
Massimo fafe581
%package -n python3-simplevisor
Massimo fafe581
Summary:	Python simple daemons supervisor
Massimo fafe581
Massimo fafe581
%description -n python3-simplevisor
Massimo fafe581
Simplevisor is a simple daemons supervisor, it is inspired by
Massimo fafe581
Erlang OTP and it can supervise hierarchies of services.
Massimo fafe581
%endif # with_python3
Massimo fafe581
Massimo fafe581
%prep
Massimo fafe581
%setup -q -n %{srcname}-%{version}
Massimo fafe581
%if 0%{?with_python3}
b51cd26
rm -fr %{py3dir}
Massimo fafe581
cp -a . %{py3dir}
Massimo fafe581
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
Massimo fafe581
%endif # with_python3
Massimo fafe581
Massimo fafe581
%build 
4dcea0b
%{__python2} setup.py build
Massimo fafe581
%if 0%{?with_python3}
Massimo fafe581
pushd %{py3dir}
Massimo fafe581
%{__python3} setup.py build
Massimo fafe581
popd
Massimo fafe581
%endif # with_python3
Massimo fafe581
Massimo fafe581
%install
b51cd26
rm -fr $RPM_BUILD_ROOT
4dcea0b
%{__python2} setup.py install --with-data-files --skip-build --root $RPM_BUILD_ROOT
b51cd26
install -D -m 644 man/%{srcname}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}.1;
b51cd26
install -D -m 644 man/%{srcname}-control.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}-control.1;
b51cd26
install -D -m 644 man/%{srcname}-loop.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}-loop.1;
Massimo fafe581
%if 0%{?with_python3}
cb9364e
mv $RPM_BUILD_ROOT/usr/bin/simplevisor $RPM_BUILD_ROOT/usr/bin/simplevisor2
Massimo fafe581
pushd %{py3dir}
Massimo b11edb7
%{__python3} setup.py install --with-data-files --skip-build --root $RPM_BUILD_ROOT
cb9364e
mv $RPM_BUILD_ROOT/usr/bin/simplevisor $RPM_BUILD_ROOT/usr/bin/simplevisor3
405959f
cp $RPM_BUILD_ROOT/usr/bin/simplevisor-control $RPM_BUILD_ROOT/usr/bin/simplevisor3-control
cb9364e
cp $RPM_BUILD_ROOT/usr/bin/simplevisor-loop $RPM_BUILD_ROOT/usr/bin/simplevisor3-loop
Massimo fafe581
install -D -m 644 man/%{srcname}.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}3.1;
Massimo fafe581
install -D -m 644 man/%{srcname}-control.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}3-control.1;
cb9364e
install -D -m 644 man/%{srcname}-loop.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{srcname}3-loop.1;
Massimo fafe581
popd
cb9364e
mv $RPM_BUILD_ROOT/usr/bin/simplevisor2 $RPM_BUILD_ROOT/usr/bin/simplevisor
Massimo fafe581
%endif # with_python3
Massimo fafe581
Massimo fafe581
%check
4dcea0b
%{__python2} setup.py test
Massimo fafe581
# And remove compiled documentation.
Massimo fafe581
rm -f test/*.pyc
Massimo fafe581
%if 0%{?with_python3}
Massimo fafe581
pushd %{py3dir}
Massimo fafe581
%{__python3} setup.py test
Massimo fafe581
rm -f test/*.pyc
Massimo fafe581
popd
Massimo fafe581
%endif # with_python3
Massimo fafe581
cbb8315
%files -n python2-simplevisor
Massimo fafe581
%doc LICENSE README.rst CHANGES examples
Massimo fafe581
%{_mandir}/man?/%{srcname}.1*
Massimo fafe581
%{_mandir}/man?/%{srcname}-control.1*
Massimo fafe581
%{_mandir}/man?/%{srcname}-loop.1*
Massimo fafe581
%attr(755, root, root) /usr/bin/simplevisor
Massimo fafe581
%attr(755, root, root) /usr/bin/simplevisor-control
Massimo fafe581
%attr(755, root, root) /usr/bin/simplevisor-loop
4dcea0b
%{python2_sitelib}/%{srcname}/
4dcea0b
%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info
Massimo fafe581
Massimo fafe581
%if 0%{?with_python3}
Massimo fafe581
%files -n python3-simplevisor
Massimo fafe581
%doc LICENSE README.rst CHANGES
Massimo fafe581
%{_mandir}/man?/%{srcname}3.1*
Massimo fafe581
%{_mandir}/man?/%{srcname}3-control.1*
cb9364e
%{_mandir}/man?/%{srcname}3-loop.1*
Massimo fafe581
%attr(755, root, root) /usr/bin/simplevisor3
Massimo fafe581
%attr(755, root, root) /usr/bin/simplevisor3-control
cb9364e
%attr(755, root, root) /usr/bin/simplevisor3-loop
Massimo fafe581
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info
Massimo fafe581
%{python3_sitelib}/%{srcname}/
Massimo fafe581
%endif # with_python3
Massimo fafe581
Massimo fafe581
%changelog
8ad969b
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-13
8ad969b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
8ad969b
4dcea0b
* Mon Jul 23 2018 Lionel Cons <lionel.cons@cern.ch> - 1.2-12
4dcea0b
- Fixed building using Python 2 (#1605914).
4dcea0b
0053c46
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-11
0053c46
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0053c46
6d99dbd
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.2-10
6d99dbd
- Rebuilt for Python 3.7
6d99dbd
f6ab705
* Wed Feb 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.2-9
f6ab705
- Update Python 2 dependency declarations to new packaging standards
f6ab705
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
f6ab705
c3febd6
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-8
c3febd6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c3febd6
cbb8315
* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2-7
cbb8315
- Python 2 binary package renamed to python2-simplevisor
cbb8315
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
cbb8315
f3eee28
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-6
f3eee28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f3eee28
9f55cff
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-5
9f55cff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9f55cff
53fbced
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.2-4
53fbced
- Rebuild for Python 3.6
53fbced
7155037
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-3
7155037
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
7155037
cb9364e
* Mon Jul  4 2016 Lionel Cons <lionel.cons@cern.ch> - 1.2-2
cb9364e
- Corrected /usr/bin/simplevisor shebang in Rawhide
cb9364e
b51cd26
* Wed Jun 29 2016 Lionel Cons <lionel.cons@cern.ch> - 1.2-1
b51cd26
- Updated to upstream version (#1351066)
b51cd26
e58eac1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1-5
e58eac1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e58eac1
8dec003
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-4
8dec003
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
8dec003
890cfe7
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-3
890cfe7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
890cfe7
Adrien Devresse 124674f
* Wed Apr 08 2015 Adrien Devresse <adevress at cern.ch> - 1.1-2
Adrien Devresse 124674f
 - Disable python3 for EPEL7
Adrien Devresse 124674f
Adrien Devresse 5bc435d
* Tue Mar 31 2015 Adrien Devresse <adevress at cern.ch> - 1.1-1
Adrien Devresse 5bc435d
 - Update to upstream 1.1 version
Adrien Devresse 5bc435d
Adrien Devresse c8730a1
* Thu Aug 14 2014 Adrien Devresse <adevress at cern.ch> - 1.0-1
Adrien Devresse c8730a1
 - Update to upstream 1.0 version
Adrien Devresse c8730a1
bcff997
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-3
bcff997
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
bcff997
1153d45
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.9-2
1153d45
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
1153d45
Massimo bcd146a
* Sun Mar 09 2014 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.9-1
Massimo bcd146a
- Updating to upstream version, rhbz #1071124.
Massimo bcd146a
0b79fc7
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8-3
0b79fc7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
0b79fc7
d915369
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.8-2
d915369
- Perl 5.18 rebuild
d915369
Massimo b11edb7
* Fri Apr 26 2013 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.8-1
Massimo b11edb7
- Updating to upstream 0.8.
Massimo b11edb7
Massimo ba283c9
* Mon Jan 28 2013 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.7-1
Massimo ba283c9
- Updating to upstream 0.7.
Massimo ba283c9
Massimo fafe581
* Thu Jan 17 2013 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.6-1
Massimo fafe581
- Updating to upstream 0.6.
Massimo fafe581
Massimo fafe581
* Fri Nov 30 2012 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.5-2
Massimo fafe581
- Use macros consistently.
Massimo fafe581
Massimo fafe581
* Fri Sep 14 2012 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.5-1
Massimo fafe581
- Updating to version 0.5.
Massimo fafe581
Massimo fafe581
* Thu Jul 05 2012 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.4-1
Massimo fafe581
- Updating to version 0.4.
Massimo fafe581
Massimo fafe581
* Mon Jun 25 2012 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.3-1
Massimo fafe581
- Updating to version 0.3.
Massimo fafe581
Massimo bcd146a
* Wed Mar 14 2012 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.2-1
Massimo fafe581
- Improvements.
Massimo fafe581
Massimo bcd146a
* Sun Mar 11 2012 Massimo Paladin <Massimo.Paladin@gmail.com> - 0.1-1
Massimo fafe581
- Initial packaging.