[python-catkin_pkg/el6] Update to 0.2.5

Scott K Logan cottsay at fedoraproject.org
Tue Oct 21 02:41:53 UTC 2014


commit 51ca3842286e8a220e40cc4227dafd3db8291f9e
Author: Scott K Logan <logans at cottsay.net>
Date:   Sat Oct 18 14:30:57 2014 -0700

    Update to 0.2.5
    
    Also:
    - Add python3 package
    - Exclude tests which are not compatible with python 2.6
    - Remove README.rst (not present in Pypi sources)

 .gitignore             |    1 +
 python-catkin_pkg.spec |  107 ++++++++++++++++++++++++++++++++++++++++--------
 sources                |    2 +-
 3 files changed, 92 insertions(+), 18 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 292ebbd..acb71bc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /catkin_pkg-0.1.18-90db8ac.tar.gz
 /catkin_pkg-0.1.25-2f7a797.tar.gz
+/catkin_pkg-0.2.5.tar.gz
diff --git a/python-catkin_pkg.spec b/python-catkin_pkg.spec
index 42ef8c7..8626a86 100644
--- a/python-catkin_pkg.spec
+++ b/python-catkin_pkg.spec
@@ -1,58 +1,131 @@
-%global commit 2f7a797f33842e21ff22f97b664b87ab79c866d9
+%global commit b055637aad36fe0c6a35d721c9dbf64ea8c8015c
 %global shortcommit %(c=%{commit}; echo ${c:0:7})
 %global module_name catkin_pkg
 
+%if 0%{?fedora} > 12
+%global with_python3 1
+%else
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%{!?python2_version: %global python2_version %(%{__python2} -c "from sys import stdout, version; stdout.write(version[:3])")}
+%endif
+
 Name:           python-%{module_name}
-Version:        0.1.25
+Version:        0.2.5
 Release:        1%{?dist}
 Summary:        Library for retrieving information about catkin packages
 
 License:        BSD
 URL:            https://github.com/ros-infrastructure/%{module_name}
-Source0:        https://github.com/ros-infrastructure/%{module_name}/archive/%{commit}/%{module_name}-%{version}-%{shortcommit}.tar.gz
-
 BuildArch:      noarch
+Source0:        https://pypi.python.org/packages/source/c/%{module_name}/%{module_name}-%{version}.tar.gz
 
 Requires:       python-argparse
 Requires:       python-dateutil
 Requires:       python-docutils
+BuildRequires:  python2-devel
 BuildRequires:  python-argparse
-BuildRequires:  python-devel
-BuildRequires:  python-setuptools
 BuildRequires:  python-dateutil
 BuildRequires:  python-docutils
-BuildRequires:  python-nose
 BuildRequires:  python-mock
+BuildRequires:  python-nose
+BuildRequires:  python-setuptools
+
+%if 0%{?with_python3}
+%package -n python3-%{module_name}
+Summary:        Library for retrieving information about catkin packages
+
+Requires:       python3-dateutil
+Requires:       python3-docutils
+BuildRequires:  python3-dateutil
+BuildRequires:  python3-devel
+BuildRequires:  python3-docutils
+BuildRequires:  python3-mock
+BuildRequires:  python3-nose
+BuildRequires:  python3-setuptools
+%endif
 
 %description
 Library for retrieving information about catkin packages
 
+%if 0%{?with_python3}
+%description -n python3-%{module_name}
+Library for retrieving information about catkin packages
+%endif
+
 %prep
-%setup -q -n %{module_name}-%{commit}
+%setup -q -n %{module_name}-%{version}
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif
+
+find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
 
 %build
-%{__python} setup.py build
+%{__python2} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+pushd build/scripts-%{python3_version}
+for f in *; do mv $f python3-$f; done
+popd
+popd
+%endif
 
 %install
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+%{__python2} setup.py install --skip-build --root %{buildroot}
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
 
-# Tests require python 2.7
-%if 0%{?fedora}
 %check
-PYTHONPATH=$RPM_BUILD_ROOT%{python_sitelib} nosetests -w test
-%endif 
+%if "%{python2_version}" == "2.6"
+# Skip tests that use python 2.7 assertions
+PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests -w test -e "(test_topological_order_packages_with_duplicates|test_validate_metapackage|test_package_decorator_init|test_create_package_template)"
+%else
+PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests-%{python2_version} -w test
+%endif
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version} -w test
+popd
+%endif
 
 %files
-%doc README.rst
 %{_bindir}/catkin_create_pkg
 %{_bindir}/catkin_find_pkg
 %{_bindir}/catkin_generate_changelog
 %{_bindir}/catkin_tag_changelog
 %{_bindir}/catkin_test_changelog
-%{python_sitelib}/%{module_name}/
-%{python_sitelib}/%{module_name}-%{version}-py?.?.egg-info
+%{python2_sitelib}/%{module_name}/
+%{python2_sitelib}/%{module_name}-%{version}-py?.?.egg-info
+
+%if 0%{?with_python3}
+%files -n python3-%{module_name}
+%{_bindir}/python3-catkin_create_pkg
+%{_bindir}/python3-catkin_find_pkg
+%{_bindir}/python3-catkin_generate_changelog
+%{_bindir}/python3-catkin_tag_changelog
+%{_bindir}/python3-catkin_test_changelog
+%{python3_sitelib}/%{module_name}/
+%{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info
+%endif
 
 %changelog
+* Sat Oct 18 2014 Scott K Logan <logans at cottsay.net> - 0.2.5-1
+- Update to 0.2.5
+- Add python3 package
+- Exclude tests which are not compatible with python 2.6
+- Remove README.rst (not present in Pypi sources)
+
 * Thu Feb 06 2014 Scott K Logan <logans at cottsay.net> - 0.1.25-1
 - Update to 0.1.25
 - Added check section
diff --git a/sources b/sources
index eb80a48..eb64ebe 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-532e4611ae7315c439edb47702c49fea  catkin_pkg-0.1.25-2f7a797.tar.gz
+e8c91b081228c461dffbc387a2811ec7  catkin_pkg-0.2.5.tar.gz


More information about the scm-commits mailing list