diff --git a/python-rosdep.spec b/python-rosdep.spec index c6b4741..c5774bc 100644 --- a/python-rosdep.spec +++ b/python-rosdep.spec @@ -1,3 +1,10 @@ +%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 + %global commit 23f30f7e42f4a7184de001fe1ef21ad44a015a4c %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global realname rosdep @@ -12,23 +19,31 @@ URL: http://ros.org/wiki/%{realname} Source0: https://github.com/ros-infrastructure/%{realname}/archive/%{commit}/%{realname}-%{commit}.tar.gz BuildArch: noarch +# Documentation +BuildRequires: python-catkin-sphinx +BuildRequires: python-sphinx +# Build Deps BuildRequires: PyYAML BuildRequires: python-catkin_pkg -BuildRequires: python-catkin-sphinx BuildRequires: python2-devel -# BuildRequires: python-mock BuildRequires: python-nose BuildRequires: python-rosdistro >= 0.4.0 BuildRequires: python-rospkg >= 1.0.34 -BuildRequires: python-sphinx Requires: PyYAML >= 3.1 Requires: python-catkin_pkg -Requires: python-rospkg -Requires: python-rosdistro >= 0.3.0 -Requires: ros-release - +Requires: python-rosdistro >= 0.4.0 +Requires: python-rospkg >= 1.0.34 + +%if 0%{?with_python3} +BuildRequires: python3-PyYAML +BuildRequires: python3-catkin_pkg +BuildRequires: python3-devel +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 @@ -38,10 +53,33 @@ 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'. +%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 + +%description -n python3-%{realname} +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 %prep %setup -qn %{realname}-%{commit} +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 + +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %build %{__python2} setup.py build @@ -51,12 +89,21 @@ make html rm -f html/.buildinfo popd +%if 0%{?with_python3} +pushd %{py3dir} +CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build +popd +%endif # with_python3 %install rm -rf $RPM_BUILD_ROOT +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT +popd +%endif # with_python3 + %{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{realname} -install -p -m 0644 manifest.xml $RPM_BUILD_ROOT%{_datadir}/%{realname} 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/ @@ -66,6 +113,9 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python2_sitelib}/%{realname}2/*.py sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python2_sitelib}/%{realname}2/platforms/*.py +sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python3_sitelib}/%{realname}2/*.py +sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python3_sitelib}/%{realname}2/*.py + # Get rid of hidden file in documentation folder rm -f doc/_build/.buildinfo @@ -82,17 +132,23 @@ rm -f doc/_build/.buildinfo %{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info %{python2_sitelib}/%{realname}2 %{_mandir}/man1/*.gz -%{_datadir}/%{realname} %dir %{_sysconfdir}/ros/rosdep/ %dir %{_sysconfdir}/ros/rosdep/sources.list.d/ %ghost %{_sysconfdir}/ros/rosdep/sources.list.d/20-default.list +%if 0%{?with_python3} +%files -n python3-%{realname} +%license LICENSE +%{python3_sitelib}/%{realname}-%{version}-py?.?.egg-info +%{python3_sitelib}/%{realname}2 +%endif %changelog * Wed Mar 04 2015 Rich Mattes - 0.11.2-1 - Update to release 0.11.2 - Update to latest github guidelines - Use license macro for license file +- Added python3 package * Tue Dec 30 2014 Rich Mattes - 0.11.0-1 - Update to release 0.11.0