[python-setproctitle/f15] initial import

Haïkel Guémar hguemar at fedoraproject.org
Fri Mar 9 16:53:45 UTC 2012


commit 43fcc9ff19aca7948d5dfc730a2a1d3e48bf6ee7
Author: Haïkel Guémar <hguemar at fedoraproject.org>
Date:   Fri Mar 9 17:53:36 2012 +0100

    initial import

 .gitignore               |    1 +
 python-setproctitle.spec |  124 ++++++++++++++++++++++++++++++++++++++++++++++
 sources                  |    1 +
 3 files changed, 126 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..a06e37b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/setproctitle-1.1.3.tar.gz
diff --git a/python-setproctitle.spec b/python-setproctitle.spec
new file mode 100644
index 0000000..6e9125b
--- /dev/null
+++ b/python-setproctitle.spec
@@ -0,0 +1,124 @@
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+%global with_python3 1
+%else
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
+
+%global tarname setproctitle
+
+Name:           python-setproctitle
+Version:        1.1.3
+Release:        2%{?dist}
+Summary:        Python module to customize a process title
+
+License:        BSD
+URL:            http://pypi.python.org/pypi/%{tarname}
+Source0:        http://pypi.python.org/packages/source/s/%{tarname}/%{tarname}-%{version}.tar.gz
+
+BuildRequires:  python2-devel
+BuildRequires:  python-setuptools
+BuildRequires:  python-nose
+BuildRequires:  python-tools
+BuildRequires:  udev
+%{?filter_setup:
+%filter_provides_in %{python_sitearch}/.*\.so$
+%filter_setup
+}
+
+
+%description
+Python module allowing a process to change its title as displayed by
+system tool such as ps and top.
+
+It's useful in multiprocess systems, allowing to identify tasks each forked
+process is busy with. This technique has been used by PostgreSQL and OpenSSH.
+
+It's based on PostgreSQL implementation which has proven to be portable.
+
+
+
+%if 0%{?with_python3}
+%package -n python3-%{tarname}
+Summary:        Python module to customize a process title
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-nose
+
+%description -n python3-%{tarname}
+Python module allowing a process to change its title as displayed by
+system tool such as ps and top.
+
+It's useful in multi-process systems, allowing to identify tasks each forked
+process is busy with. This technique has been used by PostgreSQL and OpenSSH.
+
+It's based on PostgreSQL implementation which has proven to be portable.
+%endif
+
+%prep
+%setup -q -n %{tarname}-%{version}
+%{?with_python3: cp -a . %{py3dir}}
+
+
+%build
+# Remove CFLAGS=... for noarch packages (unneeded)
+CFLAGS="%{optflags}" %{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+CFLAGS="%{optflags}" %{__python3} setup.py build
+popd
+%endif
+
+%install
+%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+chmod 0755 %{buildroot}%{python_sitearch}/setproctitle.so
+%if 0%{?with_python3}
+pushd %{py3dir}
+CFLAGS="%{optflags}" %{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
+chmod 0755 %{buildroot}%{python3_sitearch}/setproctitle*.so
+%endif
+
+%check
+BUILD_DIR=$(%{__python} -c "import sys; import platform; \
+print('build/lib.linux-{0}-{1}.{2}'.format(platform.machine(), \
+sys.version_info[0], sys.version_info[1]))")
+gcc `pkg-config --cflags --libs python` -o tests/pyrun tests/pyrun.c
+PYTHONPATH=$BUILD_DIR:$PYTHONPATH ROOT_PATH=$(pwd) \
+                                  %{__python} tests/setproctitle_test.py -v
+# FIXME: tests are broken with python3
+%if 0%{?with_python3}
+pushd %{py3dir}
+BUILD_DIR=$(%{__python3} -c "import sys; import platform; \
+print('build/lib.linux-{0}-{1}.{2}'.format(platform.machine(), \
+sys.version_info[0], sys.version_info[1]))")
+# looks like tests are not 2to3'ed by setup.py
+2to3 -w --no-diffs tests
+gcc `pkg-config --cflags --libs python3` -o tests/pyrun tests/pyrun.c
+PYTHONPATH=$BUILD_DIR:$PYTHONPATH ROOT_PATH=$(pwd) \
+                                  %{__python3} tests/setproctitle_test.py -v || :
+popd
+%endif
+
+
+%files
+%doc README COPYRIGHT
+# For arch-specific packages: sitearch
+%{python_sitearch}/*
+
+%if 0%{?with_python3}
+%files -n python3-%{tarname}
+%doc README COPYRIGHT
+# For arch-specific packages: sitearch
+%{python3_sitearch}/*
+%endif
+
+%changelog
+* Mon Mar 05 2012 Haïkel Guémar <hguemar at fedoraproject.org> - 1.1.3-2
+- enable tests execution
+- spec cleaning
+
+* Sun Jan 29 2012 Haïkel Guémar <hguemar at fedoraproject.org> - 1.1.3-1
+- initial packaging
+
diff --git a/sources b/sources
index e69de29..1069f3d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+64028521850dc68c5b90d45377de3f5c  setproctitle-1.1.3.tar.gz


More information about the scm-commits mailing list