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 61f5f5a2e1fa252cc1852d83ccc17372934af239
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global realname rosinstall
Name:           python-rosinstall
Version:        0.7.7
Release:        3%{?dist}
Summary:        ROS installation utilities

License:        BSD
URL:            http://www.ros.org/wiki/rosinstall
BuildArch:      noarch
Source0:        https://github.com/vcstools/%{realname}/archive/%{commit}/%{realname}-%{commit}.tar.gz

BuildRequires:  python2-devel
BuildRequires:  python-mock
BuildRequires:  python-nose
BuildRequires:  python-rosdistro >= 0.3.0
BuildRequires:  python-setuptools
BuildRequires:  python-sphinx
BuildRequires:  python-catkin-sphinx
BuildRequires:  python-vcstools >= 0.1.38
BuildRequires:  python-wstool >= 0.1.12
BuildRequires:  zsh

%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-mock
BuildRequires:  python3-rosdistro >= 0.3.0
BuildRequires:  python3-setuptools
BuildRequires:  python3-vcstools >= 0.1.38
BuildRequires:  python3-wstool >= 0.1.12
%endif

# install_requires from setup.py
Requires:       python-vcstools >= 0.1.38
Requires:       PyYAML
Requires:       python-rosdistro >= 0.3.0
Requires:       python-catkin_pkg
Requires:       python-wstool >= 0.1.12

%description
rosinstall is a tool to check out ROS source code (or any source code, really)
from multiple version control repositories and updating these checkouts. Given 
a *.rosinstall file that specifies where to get code, rosinstall will check 
out a working copy for you. 

%if 0%{?with_python3}
%package -n python3-%{realname}
Summary: ROS Installation utilities
Requires: python3-vcstools >= 0.1.37
Requires: python3-PyYAML
Requires: python3-rosdistro >= 0.3.0
Requires: python3-catkin_pkg
Requires: python3-wstool >= 0.1.8

%description -n python3-%{realname}
rosinstall is a tool to check out ROS source code (or any source code, really)
from multiple version control repositories and updating these checkouts. Given
a *.rosinstall file that specifies where to get code, rosinstall will check
out a working copy for you.
%endif

%prep
%setup -qn %{realname}-%{commit}
%if 0%{?rhel}
sed -i 's/haiku/default/' doc/conf.py
sed -i 's/:special-members://g' doc/*.rst
%endif

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3

%build
%{__python2} setup.py build
pushd doc
make html
make man
popd

%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
popd
%endif # with_python3

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --force --skip-build --root $RPM_BUILD_ROOT
popd
%endif

%{__python2} setup.py install --force --skip-build --root $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
install -p -m 0644 doc/_build/man/%{realname}.1 $RPM_BUILD_ROOT%{_mandir}/man1/
rm -rf doc/_build/html/.buildinfo

%check
# python-rosinstall tests reach out to github, which won't work in mock.
# Disabling for now
#pushd %{py3dir}
#nosetests
#popd
#nosetests

%files
%license LICENSE
%doc doc/_build/html README.rst
%{_bindir}/*
%{python2_sitelib}/%{realname}
%{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info
%{_mandir}/man1/%{realname}.1.gz

%if 0%{?with_python3}
%files -n python3-%{realname}
%license LICENSE
%{python3_sitelib}/%{realname}
%{python3_sitelib}/%{realname}-%{version}-py?.?.egg-info
%endif

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

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

* Tue Oct 20 2015 Rich Mattes <richmattes@gmail.com> - 0.7.7-1
- Update to release 0.7.7

* Fri Sep 18 2015 Rich Mattes <richmattes@gmail.com> - 0.7.6-2
- Fix python 3 requires versioning

* Wed Sep 16 2015 Rich Mattes <richmattes@gmail.com> - 0.7.6-1
- Update to release 0.7.6

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

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

* Wed Mar 04 2015 Rich Mattes <richmattes@gmail.com> - 0.7.5-1
- Update to release 0.7.5 (rhbz#1195536)
- Add python3 package

* Tue Dec 30 2014 Rich Mattes <richmattes@gmail.com> - 0.7.4-1
- Update to release 0.7.4

* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7.3-3
- Replace python-setuptools-devel BR with python-setuptools

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

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

* Mon Aug 19 2013 Rich Mattes <richmattes@gmail.com> - 0.6.29-1
- Update to release 0.6.29

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

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

* Mon Mar 18 2013 Rich Mattes <richmattes@gmail.com> - 0.6.26-1.20130318git6d482b2
- Update to release 0.6.26

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.22-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jan 02 2013 Rich Mattes <richmattes@gmail.com> - 0.6.22-1
- Update to release 0.6.22

* Fri Oct 26 2012 Rich Mattes <richmattes@gmail.com> - 0.6.20-1
- Update to release 0.6.20

* Mon Oct 08 2012 Rich Mattes <richmattes@gmail.com> - 0.6.19-2
- Separated build and install steps for setup.py
- Added README and LICENSE

* Sun Sep 02 2012 Rich Mattes <richmattes@gmail.com> - 0.6.19-1
- Update to release 0.6.19

* Wed Jun 06 2012 Rich Mattes <richmattes@gmail.com> - 0.6.17-1
- Update to release 0.6.17

* Wed Apr 25 2012 Rich Mattes <richmattes@gmail.com> - 0.6.15-1
- Initial package