[python-atfork] Initial import (#708115).

James Laska jlaska at fedoraproject.org
Wed Aug 24 16:28:21 UTC 2011


commit 75ffd309b952f6ba67654db9c3e4900c88fd92cf
Author: James Laska <jlaska at redhat.com>
Date:   Wed Aug 24 12:27:30 2011 -0400

    Initial import (#708115).

 .gitignore                                         |    1 +
 ...solve-rpmlint-non-executable-script-error.patch |   33 +++++++++
 python-atfork.spec                                 |   69 ++++++++++++++++++++
 sources                                            |    1 +
 4 files changed, 104 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..e497326 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/atfork-0.1.2.zip
diff --git a/0001-Resolve-rpmlint-non-executable-script-error.patch b/0001-Resolve-rpmlint-non-executable-script-error.patch
new file mode 100644
index 0000000..ef56d47
--- /dev/null
+++ b/0001-Resolve-rpmlint-non-executable-script-error.patch
@@ -0,0 +1,33 @@
+From 33b9ee4bfc249cf7dd58c10ef0942f7234d7a372 Mon Sep 17 00:00:00 2001
+From: James Laska <jlaska at redhat.com>
+Date: Thu, 26 May 2011 14:55:11 -0400
+Subject: [PATCH] Resolve rpmlint non-executable-script error
+
+---
+ atfork/tests/test_atfork.py       |    2 --
+ atfork/tests/test_stdlib_fixer.py |    2 --
+ 2 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/atfork/tests/test_atfork.py b/atfork/tests/test_atfork.py
+index 245d8b2..f69b8e7 100755
+--- a/atfork/tests/test_atfork.py
++++ b/atfork/tests/test_atfork.py
+@@ -1,5 +1,3 @@
+-#!/usr/bin/python
+-#
+ # Copyright 2009 Google Inc.
+ #
+ #   Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/atfork/tests/test_stdlib_fixer.py b/atfork/tests/test_stdlib_fixer.py
+index f082120..121e8d3 100755
+--- a/atfork/tests/test_stdlib_fixer.py
++++ b/atfork/tests/test_stdlib_fixer.py
+@@ -1,5 +1,3 @@
+-#!/usr/bin/python
+-#
+ # Copyright 2009 Google Inc.
+ #
+ #   Licensed under the Apache License, Version 2.0 (the "License");
+-- 
+1.7.5.1
+
diff --git a/python-atfork.spec b/python-atfork.spec
new file mode 100644
index 0000000..537cc3e
--- /dev/null
+++ b/python-atfork.spec
@@ -0,0 +1,69 @@
+%{!?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:        1%{?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
+%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
+BuildRequires:  python-setuptools-devel
+%else
+BuildRequires:  python-setuptools
+%endif
+
+%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
+* Thu May 26 2011 James Laska<jlaska at redhat.com> - 0.1.2-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..ac26bdf 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+76adc44aa9a59df6b7da8acc97140492  atfork-0.1.2.zip


More information about the scm-commits mailing list