%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 18 || 0%{?rhel} >= 7 %bcond_without systemd_macros %else %bcond_with systemd_macros %endif Summary: A System for Allowing the Control of Process State on UNIX Name: supervisor Version: 3.0 #define prever a12 Release: 1%{?prever:.%{prever}}%{?dist} License: ZPLv2.1 and BSD and MIT Group: System Environment/Base URL: http://supervisord.org/ Source0: http://pypi.python.org/packages/source/s/%{name}/%{name}-%{version}%{?prever}.tar.gz Source1: supervisord.service Source2: supervisord.conf Source3: supervisor.logrotate BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch BuildRequires: python-devel BuildRequires: python-setuptools BuildRequires: systemd-units Requires: python-meld3 >= 0.6.5 Requires: python-setuptools Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units # Needed for SysV -> systemd conversion # These should actually be Requires(triggerun) but that doesn't work Requires(post): systemd-sysv Requires(post): chkconfig %description The supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems. %prep %setup -q -n %{name}-%{version}%{?prever} %build CFLAGS="%{optflags}" %{__python} setup.py build %install rm -rf %{buildroot} %{__python} setup.py install --skip-build --root %{buildroot} mkdir -p %{buildroot}/%{_sysconfdir} mkdir -p %{buildroot}/%{_sysconfdir}/supervisord.d mkdir -p %{buildroot}/%{_sysconfdir}/logrotate.d/ mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}/%{_localstatedir}/log/%{name} chmod 770 %{buildroot}/%{_localstatedir}/log/%{name} install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/supervisord.service install -p -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/supervisord.conf install -p -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/logrotate.d/supervisor sed -i s'/^#!.*//' $( find %{buildroot}/%{python_sitelib}/supervisor/ -type f) rm -rf %{buildroot}/%{python_sitelib}/supervisor/meld3/ rm -f %{buildroot}%{_prefix}/doc/*.txt %clean rm -rf %{buildroot} %post %if %{with systemd_macros} %systemd_post %{name}.service %else if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %endif %preun %if %{with systemd_macros} %systemd_preun %{name}.service %else if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable supervisord.service > /dev/null 2>&1 || : /bin/systemctl stop supervisord.service > /dev/null 2>&1 || : fi %endif %postun # Don't restart supervisord here, we don't want its children to be restarted # when the supervisor package is upgraded. Admins need to manually reload or # restart supervisord.service. %if %{with systemd_macros} %systemd_postun %{name}.service %else /bin/systemctl daemon-reload >/dev/null 2>&1 || : %endif %triggerun -- supervisor < supervisor-3.0-0.6.a10 # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply httpd # to migrate them to systemd targets %{_bindir}/systemd-sysv-convert --save supervisord > /dev/null 2>&1 || : # Run this here because the SysV package being removed won't do it /sbin/chkconfig --del supervisord >/dev/null 2>&1 || : %files %defattr(-,root,root,-) %doc CHANGES.txt COPYRIGHT.txt README.rst LICENSES.txt PLUGINS.rst TODO.txt %dir %{_localstatedir}/log/%{name} %{_unitdir}/supervisord.service %{python_sitelib}/* %{_bindir}/supervisor* %{_bindir}/echo_supervisord_conf %{_bindir}/pidproxy %config(noreplace) %{_sysconfdir}/supervisord.conf %dir %{_sysconfdir}/supervisord.d %config(noreplace) %{_sysconfdir}/logrotate.d/supervisor %changelog * Thu Aug 01 2013 Nils Philippsen <nils@redhat.com> - 3.0-1 - version 3.0 (final) - fix changelog dates * Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.11.a12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sat Sep 01 2012 Nils Philippsen <nils@redhat.com> - 3.0-0.10.a12 - add [Install] section to service file, so systemctl can enable it * Tue Aug 21 2012 Nils Philippsen <nils@redhat.com> - 3.0-0.9.a12 - use systemd macros from F-18/RHEL-7 on - use %%{_unitdir} macro for systemd unit paths * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.8.a12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Tue Jan 10 2012 Nils Philippsen <nils@redhat.com> - 3.0-0.7.a12 - version 3.0a12 * Tue Aug 02 2011 Nils Philippsen <nils@redhat.com> - 3.0-0.6.a10 - add native systemd support * Mon Aug 01 2011 Nils Philippsen <nils@redhat.com> - 3.0-0.5.a10 - require python-setuptools (#725191) * Tue Apr 05 2011 Nils Philippsen <nils@redhat.com> - 3.0-0.4.a10 - version 3.0a10 - fix source URL - don't use macros for system executables (except python) * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.3.a8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 3.0-0.2.a8 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Tue Apr 13 2010 Nils Philippsen <nils@redhat.com> - 3.0-0.1.a8 - add BR: python-setuptools * Mon Apr 12 2010 Nils Philippsen <nils@redhat.com> - bundle updated config file * Sat Apr 10 2010 Nils Philippsen <nils@redhat.com> - version 3.0a8 - update URLs - versionize python-meld3 dependency * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.1-6 - Rebuild for Python 2.6 * Sat Sep 6 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.1-5 - fix license tag * Mon Jan 07 2008 Toshio Kuratomi <toshio@fedoraproject.org> 2.1-4 - Include egginfo files when python generates them. * Sun Apr 22 2007 Mike McGrath <mmcgrath@redhat.com> 2.1-3 - Added BuildRequires of python-devel * Fri Apr 20 2007 Mike McGrath <mmcgrath@redhat.com> 2.1-2 - Added patch suggested in #153225 * Fri Apr 20 2007 Mike McGrath <mmcgrath@redhat.com> 2.1-1 - Initial packaging