diff --git a/.gitignore b/.gitignore index 2f2001c..d5dd333 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /rosdep-23f30f7e42f4a7184de001fe1ef21ad44a015a4c.tar.gz /rosdep-6cdef863382f5c812030ee1c15e43c4f0b98149e.tar.gz /rosdep-0.12.2.tar.gz +/rosdep-0.13.0.tar.gz diff --git a/python-rosdep-0.12.2-doc-build-python3.patch b/python-rosdep-0.12.2-doc-build-python3.patch deleted file mode 100644 index 0dffe4a..0000000 --- a/python-rosdep-0.12.2-doc-build-python3.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 1fc7cb713c3062a9e689a2adf38d9082ed33e781 Mon Sep 17 00:00:00 2001 -From: Scott K Logan -Date: Fri, 14 Sep 2018 20:52:03 -0700 -Subject: [PATCH] Decode stdout during documentation build (#628) - -I think that I'm seeing this because doc builds are happening with -python 3 on Fedora. Here is the error I'm seeing: - -``` -... - File "./rosdep_doc_utils.py", line 38, in run - nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out)) - File "/usr/lib64/python3.6/re.py", line 191, in sub - return _compile(pattern, flags).sub(repl, string, count) -TypeError: cannot use a string pattern on a bytes-like object -``` ---- - doc/rosdep_doc_utils.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/doc/rosdep_doc_utils.py b/doc/rosdep_doc_utils.py -index b94a71a..6832a9b 100644 ---- a/doc/rosdep_doc_utils.py -+++ b/doc/rosdep_doc_utils.py -@@ -35,14 +35,14 @@ def run(self): - [py, '-c', "from rosdep2.main import rosdep_main;rosdep_main(['-h'])"] - ) - return [ -- nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out)) -+ nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out.decode())) - ] - if 'install' in self.arguments: - out = subprocess.check_output( - [py, '-c', "from rosdep2.main import rosdep_main;rosdep_main(['install', '-h'])"] - ) - return [ -- nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out)) -+ nodes.literal_block(text=re.sub(escaped_capitalized_usage, '', out.decode())) - ] - - diff --git a/python-rosdep-0.12.2-rpm_expand.patch b/python-rosdep-0.12.2-rpm_expand.patch deleted file mode 100644 index 2de8fb4..0000000 --- a/python-rosdep-0.12.2-rpm_expand.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0fd352821e0c77253445510cbe867df69d726e68 Mon Sep 17 00:00:00 2001 -From: Scott K Logan -Date: Fri, 14 Sep 2018 20:51:29 -0700 -Subject: [PATCH] Direct test for redhat.rpm_expand_cmd at the function itself - (#627) - -This test only applies to rpm_expand_cmd - if they RPM python module -is installed, that will be used instead, which makes this test break -on those systems (when %fedora doesn't expand to 27). - -If we want to cover redhat.rpm_expand or redhat.rpm_expand_py, we -should devise a different approach. ---- - test/test_rosdep_redhat.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/test/test_rosdep_redhat.py b/test/test_rosdep_redhat.py -index 512b467..4069e8c 100644 ---- a/test/test_rosdep_redhat.py -+++ b/test/test_rosdep_redhat.py -@@ -37,20 +37,20 @@ def get_test_dir(): - return os.path.abspath(os.path.join(os.path.dirname(__file__), 'redhat')) - - --def test_rpm_expand(): -- from rosdep2.platforms.redhat import rpm_expand -+def test_rpm_expand_cmd(): -+ from rosdep2.platforms.redhat import rpm_expand_cmd - - m = Mock() - m.return_value = '' - - # Non-macro test, should return the string unmodified -- val = rpm_expand('test-string', exec_fn=m) -+ val = rpm_expand_cmd('test-string', exec_fn=m) - assert val == 'test-string', val - - # Macro test, should return expanded rpm tag - with open(os.path.join(get_test_dir(), 'rpm-E-fedora'), 'r') as f: - m.return_value = f.read() -- val = rpm_expand('%fedora', exec_fn=m) -+ val = rpm_expand_cmd('%fedora', exec_fn=m) - assert val == '27', val - - diff --git a/python-rosdep.spec b/python-rosdep.spec index 8ded658..0b68880 100644 --- a/python-rosdep.spec +++ b/python-rosdep.spec @@ -1,48 +1,18 @@ -%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())")} -%endif +%{?!_without_python2:%global with_python2 0%{?_with_python2:1} || 1} +%{?!_without_python3:%global with_python3 0%{?_with_python3:1} || 0%{?fedora} > 12} -%global realname rosdep +%global srcname rosdep -Name: python-%{realname} -Version: 0.12.2 +Name: python-%{srcname} +Version: 0.13.0 Release: 1%{?dist} Summary: ROS System Dependency Installer License: BSD -URL: http://ros.org/wiki/%{realname} -Source0: https://github.com/ros-infrastructure/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz - -# Already accepted upstream -Patch0: %{name}-0.12.2-rpm_expand.patch -Patch1: %{name}-0.12.2-doc-build-python3.patch +URL: http://ros.org/wiki/%{srcname} +Source0: https://github.com/ros-infrastructure/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch -# Documentation -BuildRequires: python2-catkin-sphinx -BuildRequires: python2-sphinx - -# Build Deps -BuildRequires: python2-pyyaml -BuildRequires: python2-catkin_pkg -BuildRequires: python2-devel -BuildRequires: python2-mock -BuildRequires: python2-nose -BuildRequires: python2-rosdistro >= 0.4.0 -BuildRequires: python2-rospkg >= 1.0.34 - -%if 0%{?with_python3} -BuildRequires: python3-PyYAML -BuildRequires: python3-catkin_pkg -BuildRequires: python3-devel -BuildRequires: python3-mock -BuildRequires: python3-nose -BuildRequires: python3-rosdistro >= 0.4.0 -BuildRequires: python3-rospkg >= 1.0.34 -%endif %description rosdep is a command-line tool for installing system dependencies. For @@ -52,109 +22,149 @@ of installing system dependencies on different platforms. Instead of having to figure out which Debian package on Ubuntu Oneiric contains Boost, you can just specify a dependency on 'boost'. -%package -n python2-%{realname} -Summary: ROS System Dependency Installer +%package doc +Summary: HTML documentation for '%{name}' +BuildRequires: python2-catkin-sphinx +BuildRequires: python2-sphinx + +%description doc +HTML documentation for the '%{srcname}' python module + +%if 0%{?with_python2} +%package -n python2-%{srcname} +Summary: %{summary} Requires: python2-pyyaml >= 3.1 Requires: python2-catkin_pkg Requires: python2-rosdistro >= 0.4.0 -Requires: python2-rospkg >= 1.0.34 +Requires: python2-rospkg >= 1.0.37 +BuildRequires: python2-pyyaml >= 3.1 +BuildRequires: python2-catkin_pkg +BuildRequires: python2-devel +BuildRequires: python2-mock +BuildRequires: python2-nose +BuildRequires: python2-rosdistro >= 0.4.0 +BuildRequires: python2-rospkg >= 1.0.37 %if 0%{?fedora} Recommends: python2-rpm -%endif -Obsoletes: python-%{realname} < 0.11.4-5 -%{?python_provide:%python_provide python2-%{realname}} +Recommends: %{name}-doc = %{version}-%{release} +%endif # fedora +%{?python_provide:%python_provide python2-%{srcname}} -%description -n python2-%{realname} +%description -n python2-%{srcname} rosdep is a command-line tool for installing system dependencies. For end-users, rosdep helps you install system dependencies for software that you are building from source. For developers, rosdep simplifies the problem of installing system dependencies on different platforms. Instead of having to figure out which Debian package on Ubuntu Oneiric contains Boost, you can just specify a dependency on 'boost'. +%endif # with_python2 %if 0%{?with_python3} -%package -n python3-%{realname} -Summary: ROS System Dependency Installer -Requires: python3-PyYAML >= 3.1 -Requires: python3-catkin_pkg -Requires: python3-rosdistro >= 0.4.0 -Requires: python3-rospkg >= 1.0.34 +%package -n python%{python3_pkgversion}-%{srcname} +Summary: %{summary} +Requires: python%{python3_pkgversion}-PyYAML >= 3.1 +Requires: python%{python3_pkgversion}-catkin_pkg +Requires: python%{python3_pkgversion}-rosdistro >= 0.4.0 +Requires: python%{python3_pkgversion}-rospkg >= 1.0.37 +BuildRequires: python%{python3_pkgversion}-PyYAML >= 3.1 +BuildRequires: python%{python3_pkgversion}-catkin_pkg +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-mock +BuildRequires: python%{python3_pkgversion}-nose +BuildRequires: python%{python3_pkgversion}-rosdistro >= 0.4.0 +BuildRequires: python%{python3_pkgversion}-rospkg >= 1.0.37 %if 0%{?fedora} -Recommends: python3-rpm -%endif -%{?python_provide:%python_provide python3-%{realname}} +Recommends: python%{python3_pkgversion}-rpm +Recommends: %{name}-doc = %{version}-%{release} +%endif # fedora +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} -%description -n python3-%{realname} +%description -n python%{python3_pkgversion}-%{srcname} rosdep is a command-line tool for installing system dependencies. For end-users, rosdep helps you install system dependencies for software that you are building from source. For developers, rosdep simplifies the problem of installing system dependencies on different platforms. Instead of having to figure out which Debian package on Ubuntu Oneiric contains Boost, you can just specify a dependency on 'boost'. -%endif +%endif # with_python3 %prep -%autosetup -p1 -n %{realname}-%{version} - -# Get rid of non-executable-script errors from rpmlint -sed -i 's|#!/usr/bin/env python||' src/%{realname}2/*.py src/%{realname}2/platforms/*.py +%autosetup -p1 -n %{srcname}-%{version} %build +%if 0%{?with_python2} %py2_build - -PYTHONPATH=$PWD/src make -C doc man html -rm doc/_build/html/.buildinfo +%endif # with_python2 %if 0%{?with_python3} %py3_build %endif # with_python3 +PYTHONPATH=$PWD/src make -C doc man html +rm doc/_build/html/.buildinfo + %install +%if 0%{?with_python2} %py2_install - -mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 -install -p -m 0644 doc/man/rosdep.1 $RPM_BUILD_ROOT%{_mandir}/man1 -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ros/rosdep/sources.list.d/ -touch $RPM_BUILD_ROOT%{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list +%endif # with_python2 %if 0%{?with_python3} %py3_install %endif # with_python3 +install -D -p -m 0644 doc/man/rosdep.1 %{buildroot}%{_mandir}/man1/rosdep.1 +install -D -p -m 0644 /dev/null %{buildroot}%{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list + # Cannot currently run all of the tests because some need to query Github %check -PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitelib} nosetests-2 test.test_rosdep_redhat +%if 0%{?with_python2} +PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} -m nose test.test_rosdep_redhat +%endif # with_python2 %if 0%{?with_python3} -PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitelib} nosetests-3 test.test_rosdep_redhat -%endif +PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m nose test.test_rosdep_redhat +%endif # with_python3 -%files -n python2-%{realname} +%files doc %license LICENSE -%doc README.md doc/_build/html -%if !0%{?with_python3} +%doc doc/_build/html + +%if 0%{?with_python2} +%files -n python2-%{srcname} +%license LICENSE +%doc README.md +%if !(0%{?with_python3}) %{_bindir}/* +%endif # with_python3 %{_mandir}/man1/*.gz %dir %{_sysconfdir}/ros/rosdep/ %dir %{_sysconfdir}/ros/rosdep/sources.list.d/ %ghost %{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list -%endif -%{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info -%{python2_sitelib}/%{realname}2 +%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info/ +%{python2_sitelib}/%{srcname}2/ +%endif # with_python2 %if 0%{?with_python3} -%files -n python3-%{realname} +%files -n python%{python3_pkgversion}-%{srcname} %license LICENSE +%doc README.md %{_bindir}/* %{_mandir}/man1/*.gz %dir %{_sysconfdir}/ros/rosdep/ %dir %{_sysconfdir}/ros/rosdep/sources.list.d/ %ghost %{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list -%{python3_sitelib}/%{realname}-%{version}-py?.?.egg-info -%{python3_sitelib}/%{realname}2 -%endif +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ +%{python3_sitelib}/%{srcname}2/ +%endif # with_python3 %changelog +* Wed Nov 07 2018 Scott K Logan - 0.13.0-1 +- Update to 0.13.0 +- Conditional python2 package +- Use python3_pkgversion +- Create a separate 'doc' package +- Co-own man page and sources directories among python2 and python3 + * Fri Sep 14 2018 Scott K Logan - 0.12.2-1 - Update to 0.12.2 (rhbz#1476259) - Fix missing infrastructure files after making python 3 the default diff --git a/sources b/sources index 6eea43f..a74e3c9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rosdep-0.12.2.tar.gz) = 0932a5ff9874bbdffa1160fe0a391d27eef9a2f2435d7a89fa3b5e4eab0fc08205d4417aaea1254ab7bfe679cfeb61a6f1b199f06d65154b30505e2a280c0b61 +SHA512 (rosdep-0.13.0.tar.gz) = c42aa17ee9b31f7013415e99a484a66a7a7fb52abef4cc9045658150ce0c36b475f2885ebfff537f9ce9f8fd5eeaef5482226c5bff5b4a3df03cc72b149db07a