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 6e85b564d7d59ecdffc1d2e9e6b595952ffde75b
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global realname rosinstall
Name:           python-rosinstall
Version:        0.7.8
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:  python2-mock
BuildRequires:  python2-nose
BuildRequires:  python2-rosdistro >= 0.3.0
BuildRequires:  python2-setuptools
BuildRequires:  python2-sphinx
BuildRequires:  python2-catkin-sphinx
BuildRequires:  python2-vcstools >= 0.1.38
BuildRequires:  python2-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

%global _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.

%description %_description

%package -n python2-%{realname}
Summary: %summary
Requires:       python2-vcstools >= 0.1.38
Requires:       python2-pyyaml
Requires:       python2-rosdistro >= 0.3.0
Requires:       python2-catkin_pkg
Requires:       python2-wstool >= 0.1.12
%{?python_provide:%python_provide python2-%{realname}}

%description -n python2-%{realname} %_description

%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
%{__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

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

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

%files -n python2-%{realname}
%license LICENSE
%doc doc/_build/html README.rst
%if !0%{?with_python3}
%{_bindir}/*
%endif
%{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
%{_bindir}/*
%{python3_sitelib}/%{realname}
%{python3_sitelib}/%{realname}-%{version}-py?.?.egg-info
%endif

%changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.7.8-2
- Rebuilt for Python 3.7

* Sun May 27 2018 Rich Mattes <richmattes@gmail.com> - 0.7.8-1
- Update to release 0.7.8

* Mon Mar 19 2018 Jan Beran <jberan@redhat.com> - 0.7.7-11
- Fix of missing Python 3 executables (rhbz 1432565)

* Wed Feb 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.7.7-10
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.7-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.7.7-8
- Python 2 binary package renamed to python2-rosinstall
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.7.7-5
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.7-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* 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