Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           python-atfork
Version:        0.1.2
Release:        10%{?dist}
Summary:        Provides an API to register callbacks when forking
Group:          Development/Languages
License:        ASL 2.0
URL:            https://code.google.com/p/python-atfork
Source0:        http://python-atfork.googlecode.com/files/atfork-%{version}.zip
# This patch is temporary to resolve non-executable-script rpmlint errors
Patch0:         0001-Resolve-rpmlint-non-executable-script-error.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  python-setuptools

%description
Atfork provides a pthread_atfork() work-a-like API for Python 2.4, 2.5 and 2.6
along with fixers to monkey patch standard library modules at run time to be
safe in programs using both threading and forking.

While mixing threads and forking in a program is generally considered to be a
bad idea it need not be so painful.

A missing API in the Python is an atfork mechanism so that locks can be
acquired and released properly around fork calls.  This module adds that.  It
also provides monkey patchers that fix the standard library to properly
register callbacks for locks they create.


%prep
%setup -q -n atfork-%{version}
%patch0 -p1


%build
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
%{__python} setup.py build
%else
CFLAGS="$RPM_OPT_FLAGS" %{__python} -c 'import setuptools; execfile("setup.py")' build
%endif


%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%else
%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root $RPM_BUILD_ROOT
%endif


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%{python_sitelib}/atfork
%{python_sitelib}/*egg-info


%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-10
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 0.1.2-7
- Replace python-setuptools-devel BR with python-setuptools

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

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu May 26 2011 James Laska<jlaska@redhat.com> - 0.1.2-1
- Initial packaging