Blob Blame History Raw
%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 6cdef863382f5c812030ee1c15e43c4f0b98149e
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global realname rosdep

Name:           python-%{realname}
Version:        0.11.4
Release:        4%{?dist}
Summary:        ROS System Dependency Installer

License:        BSD
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:  python2-devel
BuildRequires:  python-nose
BuildRequires:  python-rosdistro >= 0.4.0
BuildRequires:  python-rospkg >= 1.0.34

Requires:       PyYAML >= 3.1
Requires:       python-catkin_pkg
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 
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'.

%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
pushd doc
make man
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 --force --skip-build --root $RPM_BUILD_ROOT
popd

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
%endif # with_python3

%{__python2} setup.py install --force --skip-build --root $RPM_BUILD_ROOT
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

# Get rid of non-executable-script errors from rpmlint
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

# Get rid of hidden file in documentation folder
rm -f doc/_build/.buildinfo


# Cannot currently run tests because they need to query Github
# %check
# PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitelib} nosetests -w test


%files
%license LICENSE
%doc README.md doc/_build/html
%{_bindir}/*
%{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info
%{python2_sitelib}/%{realname}2
%{_mandir}/man1/*.gz
%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
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.4-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.4-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Sun Oct 18 2015 Rich Mattes <richmattes@gmail.com> - 0.11.4-1
- Update to release 0.11.4
- Remove upstream patches

* Sun Sep 13 2015 Scott K Logan <logans@cottsay.net> - 0.11.2-4
- Add upstream patches for DNF

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Apr 19 2015 Rich Mattes <richmattes@gmail.com> - 0.11.2-2
- Make sure scripts in bindir use python2 instead of python3

* Wed Mar 04 2015 Rich Mattes <richmattes@gmail.com> - 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 <richmattes@gmail.com> - 0.11.0-1
- Update to release 0.11.0

* Mon Nov 24 2014 Scott K Logan <logans@cottsay.net> - 0.10.33-1
- Update to release 0.10.33

* Sat Oct 18 2014 Scott K Logan <logans@cottsay.net> - 0.10.32-1
- Update to release 0.10.32

* Thu Jul 31 2014 Scott K Logan <logans@cottsay.net> - 0.10.30-1
- Update to release 0.10.30

* Mon Jul 28 2014 Scott K Logan <logans@cottsay.net> - 0.10.29-1
- Update to release 0.10.29

* Tue Jul 01 2014 Scott K Logan <logans@cottsay.net> - 0.10.28-1
- Update to release 0.10.28

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.27-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon May 19 2014 Scott K Logan <logans@cottsay.net> - 0.10.27-2
- Fix for F19 release name in exceptions
- Update python macros to packaging spec
- Remove pythonpip patch, which is not needed for F19+

* Sat Apr 12 2014 Rich Mattes <richmattes@gmail.com> - 0.10.27-1
- Update to release 0.10.27
- Build html documentation

* Sat Feb 08 2014 Rich Mattes <richmattes@gmail.com> - 0.10.25-1
- Update to release 0.10.25

* Mon Aug 19 2013 Rich Mattes <richmattes@gmail.com> - 0.10.21-1
- Update to release 0.10.21
- Depend on python-catkin_pkg (rhbz#975896)

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.18-2.20130601git91fb685
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sat Jun 01 2013 Rich Mattes <richmattes@gmail.com> - 0.10.18-1.20130601git91fb6852
- Update to release 0.10.18
- Update github source url

* Mon Mar 18 2013 Rich Mattes <richmattes@gmail.com> - 0.10.14-1.20130318git76a8fef
- Update to release 0.10.14
- Fix installer to look for python-pip instead of pip (rhbz922296)
- Move rosdep cache to /var/cache instead of /etc

* Sun Oct 28 2012 Rich Mattes <richmattes@gmail.com> - 0.10.7-1.20121028gita9d29d2
- Update to 0.10.7
- Depend on /etc/ros from ros-release
- Separate build and install steps

* Mon Sep 17 2012 Rich Mattes <richmattes@gmail.com> - 0.9.7-1.20120917git5e1ecef
- Update to 0.9.7

* Sat Jun 16 2012 Rich Mattes <richmattes@gmail.com> - 0.9.5-1
- Update to 0.9.5

* Sun Apr 29 2012 Rich Mattes <richmattes@gmail.com> - 0.9.3-1
- Initial package