From b71cdf1713df439de9843a93eb34494496c09a3f Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Oct 25 2014 23:24:49 +0000 Subject: Update to release 1.0.31 Also: - Fix test failure on PPC - Remove argparse patch (fixed upstream) - Fix sphinx and nose dependencies in el6 - Add python3 package --- diff --git a/.gitignore b/.gitignore index b2ba3e9..d848fdf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /rospkg-1.0.27-18f227f.tar.gz /rospkg-1.0.28-4cee3f4.tar.gz /rospkg-1.0.29-276598d.tar.gz +/rospkg-1.0.31-ee467fa.tar.gz diff --git a/python-rospkg.spec b/python-rospkg.spec index 366732d..1d0033f 100644 --- a/python-rospkg.spec +++ b/python-rospkg.spec @@ -1,14 +1,16 @@ -%if 0%{?rhel} && 0%{?rhel} <= 6 +%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_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif -%global commit 276598d2c03c07b36add2819c4f8124dfde4e55c +%global commit ee467fa505d04850ebc992d48b5374fb8b054446 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global realname rospkg -Name: python-rospkg -Version: 1.0.29 +Name: python-%{realname} +Version: 1.0.31 Release: 1%{?dist} Summary: Utilities for ROS package, stack, and distribution information @@ -16,19 +18,22 @@ License: BSD URL: http://ros.org/wiki/rospkg Source0: https://github.com/ros-infrastructure/%{realname}/archive/%{commit}/%{realname}-%{version}-%{shortcommit}.tar.gz -# Remove python-argparse from runtime dependency list (rhbz#1088448) -Patch0: %{realname}-1.0.28-argparse.patch -# Add armv7l to the allowed arches in the arch detect test (submitted upstream) -Patch1: %{realname}-1.0.29-arm-detect-test.patch +# Add armv7l/ppc/ppc64 to the allowed arches in the arch detect test (submitted upstream) +Patch0: %{realname}-1.0.31-arch-detect-test.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-argparse -BuildRequires: python-nose BuildRequires: python-setuptools BuildRequires: python-catkin-sphinx +%if 0%{?rhel} && 0%{?rhel} < 7 +BuildRequires: python-sphinx10 +BuildRequires: python-nose1.1 +%else BuildRequires: python-sphinx +BuildRequires: python-nose +%endif BuildRequires: PyYAML BuildRequires: python-mock BuildRequires: python-coverage @@ -36,41 +41,95 @@ BuildRequires: python-coverage Requires: PyYAML Requires: python-argparse +%if 0%{?with_python3} +%package -n python3-%{realname} +Summary: Utilities for ROS package, stack, and distribution information + +BuildRequires: python3-coverage +BuildRequires: python3-devel +BuildRequires: python3-mock +BuildRequires: python3-nose +BuildRequires: python3-PyYAML +BuildRequires: python3-setuptools +BuildRequires: python3-sphinx +Requires: python3-PyYAML +%endif + %description -The ROS packaging system simplifies development and distribution of code -libraries. It enable you to easily specify dependencies between code -libraries, easily interact with those libraries from the command-line, and +The ROS packaging system simplifies development and distribution of code +libraries. It enables you to easily specify dependencies between code +libraries, easily interact with those libraries from the command-line, and +release your code for others to use. + +%if 0%{?with_python3} +%description -n python3-%{realname} +The ROS packaging system simplifies development and distribution of code +libraries. It enables you to easily specify dependencies between code +libraries, easily interact with those libraries from the command-line, and release your code for others to use. +%endif %prep %setup -qn %{realname}-%{commit} -%if 0%{?fedora} || 0%{?rhel} > 6 -%patch0 -p0 -b .argparse +%patch0 -p1 -b .arch-detect-test + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif -%patch1 -p1 -b .arm-detect-test + +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %build %{__python2} setup.py build -pushd doc -make html -make man -popd +%if 0%{?rhel} && 0%{?rhel} < 7 +make -C doc html man SPHINXBUILD=sphinx-1.0-build +%else +make -C doc html man +%endif rm -f doc/_build/html/.buildinfo +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +# TODO: Disabled until python3-catkin-sphinx is built +#make -C doc html man SPHINXBUILD=sphinx-build-%{python3_version} +pushd build/scripts-%{python3_version} +for f in *; do mv $f python3-$f; done +popd +popd +%endif + %check # Tests expect the base folder name to be 'rospkg', so move the source folder cd .. mv %{realname}-%{commit} %{realname} cd %{realname} # Run the nosetests -pushd test -PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests -popd +%if 0%{?rhel} && 0%{?rhel} < 7 +LANG=en_US.utf8 PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests1.1 -w test +%else +LANG=en_US.utf8 PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests -w test +%endif # Put the source folder back to its original name cd .. mv %{realname} %{realname}-%{commit} cd %{realname}-%{commit} +%if 0%{?with_python3} +# Tests expect the base folder name to be 'rospkg', so move the source folder +cd .. +mv %{py3dir} %{realname} +cd %{realname} +# Run the nosetests +LANG=en_US.utf8 PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version} -w test +# Put the source folder back to its original name +cd .. +mv %{realname} %{py3dir} +cd %{py3dir} +%endif + %install rm -rf $RPM_BUILD_ROOT %{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT @@ -81,15 +140,36 @@ install -p -m 0644 doc/man/rosversion.1 $RPM_BUILD_ROOT%{_mandir}/man1 sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python_sitelib}/%{realname}/*.py +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif + %files %doc doc/_build/html -%{_bindir}/* +%{_bindir}/rosversion %{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info %{python2_sitelib}/%{realname} %{_mandir}/man1/*.gz %{_datadir}/%{realname} +%if 0%{?with_python3} +%files -n python3-%{realname} +%doc doc/_build/html +%{_bindir}/python3-rosversion +%{python3_sitelib}/%{realname}-%{version}-py?.?.egg-info +%{python3_sitelib}/%{realname} +%endif + %changelog +* Sat Oct 25 2014 Scott K Logan - 1.0.31-1 +- Update to release 1.0.31 +- Fix test failure on PPC +- Remove argparse patch (fixed upstream) +- Fix sphinx and nose dependencies in el6 +- Add python3 package + * Tue Jul 15 2014 Scott K Logan - 1.0.29-1 - Update to release 1.0.29 - Fix test failure on ARM diff --git a/rospkg-1.0.28-argparse.patch b/rospkg-1.0.28-argparse.patch deleted file mode 100644 index 0fbe46a..0000000 --- a/rospkg-1.0.28-argparse.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./setup.py.argparse ./setup.py ---- ./setup.py.argparse 2014-04-16 19:38:44.171830146 -0400 -+++ ./setup.py 2014-04-16 19:38:53.345243203 -0400 -@@ -10,7 +10,7 @@ setup(name='rospkg', - packages=['rospkg'], - package_dir = {'':'src'}, - scripts = ['scripts/rosversion'], -- install_requires=['argparse', 'PyYAML'], -+ install_requires=['PyYAML'], - author = "Ken Conley", - author_email = "kwc@willowgarage.com", - url = "http://wiki.ros.org/rospkg", diff --git a/rospkg-1.0.29-arm-detect-test.patch b/rospkg-1.0.29-arm-detect-test.patch deleted file mode 100644 index d6d96cc..0000000 --- a/rospkg-1.0.29-arm-detect-test.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a000a9cdb37c9bd858498c8f4f8248514cc93c75 Mon Sep 17 00:00:00 2001 -From: Scott K Logan -Date: Tue, 15 Jul 2014 02:13:30 -0500 -Subject: [PATCH] Fix test for armv7l machines - ---- - test/test_rospkg_os_detect.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/test_rospkg_os_detect.py b/test/test_rospkg_os_detect.py -index ea1b8b3..6208d53 100644 ---- a/test/test_rospkg_os_detect.py -+++ b/test/test_rospkg_os_detect.py -@@ -349,7 +349,7 @@ def test_OsDetector(): - def test_tripwire_uname_get_machine(): - from rospkg.os_detect import uname_get_machine - retval = uname_get_machine() -- assert retval in [None, 'i386', 'i686', 'x86_64'] -+ assert retval in [None, 'armv7l', 'i386', 'i686', 'x86_64'] - - - def test_tripwire_rhel(): --- -1.9.3 - diff --git a/rospkg-1.0.31-arch-detect-test.patch b/rospkg-1.0.31-arch-detect-test.patch new file mode 100644 index 0000000..55ca442 --- /dev/null +++ b/rospkg-1.0.31-arch-detect-test.patch @@ -0,0 +1,22 @@ +From c91a497e2fb13eb575c518c3763d47481e5fa072 Mon Sep 17 00:00:00 2001 +From: Scott K Logan +Date: Tue, 15 Jul 2014 02:13:30 -0500 +Subject: [PATCH] Fix test for armv7l and ppc[64] machines + +--- + test/test_rospkg_os_detect.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test_rospkg_os_detect.py b/test/test_rospkg_os_detect.py +index ea1b8b3..7b2c766 100644 +--- a/test/test_rospkg_os_detect.py ++++ b/test/test_rospkg_os_detect.py +@@ -349,7 +349,7 @@ def test_OsDetector(): + def test_tripwire_uname_get_machine(): + from rospkg.os_detect import uname_get_machine + retval = uname_get_machine() +- assert retval in [None, 'i386', 'i686', 'x86_64'] ++ assert retval in [None, 'armv7l', 'i386', 'i686', 'ppc', 'ppc64', 'x86_64'] + + + def test_tripwire_rhel(): diff --git a/sources b/sources index 570d68d..41c26ff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e497c795cb462b298edee5be28b716ce rospkg-1.0.29-276598d.tar.gz +d7e0313efab1a16f447c38c12983d52b rospkg-1.0.31-ee467fa.tar.gz