Blob Blame Raw
%global commit 6b9e328c321c0e11c90e09f01672376683fcd622
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global module_name wstool

%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

Name:           python-%{module_name}
Version:        0.1.17
Release:        1%{?dist}
Summary:        Tool for managing a workspace of multiple heterogeneous SCM repositories

License:        BSD
URL:            http://www.ros.org/wiki/%{module_name}
Source0:        https://github.com/vcstools/%{module_name}/archive/%{commit}/%{module_name}-%{commit}.tar.gz
# Patch to remove a duplicate installed file.  Not submitted upstream
Patch0:         %{module_name}-0.1.9-fedora.patch
BuildArch:      noarch

BuildRequires:  bzr
BuildRequires:  git
BuildRequires:  mercurial
BuildRequires:  python-coverage
BuildRequires:  python-dateutil
BuildRequires:  python2-devel
BuildRequires:  python-mock
BuildRequires:  python-nose
BuildRequires:  python-rosinstall
BuildRequires:  python-setuptools
BuildRequires:  python-sphinx
BuildRequires:  python-vcstools >= 0.1.38
BuildRequires:  PyYAML
BuildRequires:  subversion

%global _description\
wstool provides commands to manage several local SCM repositories (supports\
git, mercurial, subversion, bazaar) based on a single workspace definition file\
(.rosinstall).\
\
wstool replaces the rosws tool for catkin workspaces. As catkin workspaces\
create their own setup file and environment, wstool is reduced to version\
control functions only. So wstool does not have a "regenerate" command, and\
does not allow adding non-version controlled elements to workspaces. In all\
other respects, it behaves the same as rosws.

%description %_description

%package -n python2-%{module_name}
Summary: %summary
Requires:       bzr
Requires:       git
Requires:       mercurial
Requires:       python-dateutil
Requires:       python-rosinstall
Requires:       python-vcstools >= 0.1.38
Requires:       PyYAML
Requires:       subversion
%{?python_provide:%python_provide python2-%{module_name}}

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

%if 0%{?with_python3}
%package -n python3-%{module_name}
Summary:        Tool for managing a workspace of multiple heterogeneous SCM repositories

BuildRequires:  python3-coverage
BuildRequires:  python3-dateutil
BuildRequires:  python3-devel
BuildRequires:  python3-mock
BuildRequires:  python3-nose
BuildRequires:  python-rosinstall
BuildRequires:  python3-setuptools
BuildRequires:  python3-vcstools >= 0.1.38
BuildRequires:  python3-PyYAML

Requires:       bzr
Requires:       git
Requires:       mercurial
Requires:       python3-dateutil
Requires:       python-rosinstall
Requires:       python3-vcstools >= 0.1.38
Requires:       python3-PyYAML
Requires:       subversion

%description -n python3-%{module_name}
wstool provides commands to manage several local SCM repositories (supports
git, mercurial, subversion, bazaar) based on a single workspace definition file
(.rosinstall).

wstool replaces the rosws tool for catkin workspaces. As catkin workspaces
create their own setup file and environment, wstool is reduced to version
control functions only. So wstool does not have a "regenerate" command, and
does not allow adding non-version controlled elements to workspaces. In all
other respects, it behaves the same as rosws.
%endif # with_python3

%prep
%setup -qn %{module_name}-%{commit}
%patch0 -p0 -b .fedora

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3

%build
%{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
mv -v build/scripts-%{python3_version}/%{module_name} build/scripts-%{python3_version}/python3-%{module_name}
popd
%endif # with_python3

%install
%{__python2} setup.py install --skip-build --root %{buildroot} --prefix %{_usr}

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot} --prefix %{_usr}
popd
%endif # with_python3

%check
export BZR_EMAIL="Foo Bar <foo@example.com>"
export GIT_AUTHOR_EMAIL="foo@example.com"
export GIT_AUTHOR_NAME="Foo Bar"
export GIT_COMMITTER_EMAIL="foo@example.com"
export GIT_COMMITTER_NAME="Foo Bar"

nosetests --with-coverage --cover-package=%{module_name} -w test

%if 0%{?with_python3}
pushd %{py3dir}
nosetests-%{python3_version} --with-coverage --cover-package=%{module_name} -w test
popd
%endif # with_python3 

%files -n python2-%{module_name}
%doc LICENSE README.rst doc/changelog.rst
%{_bindir}/%{module_name}
%{python_sitelib}/%{module_name}/
%{python_sitelib}/%{module_name}-%{version}-py?.?.egg-info/
%{_mandir}/man1/*.1.*
# bash completion
%config(noreplace) %{_sysconfdir}/bash_completion.d/*
# zsh completion
%dir %{_datadir}/zsh/
%dir %{_datadir}/zsh/site-functions/
%{_datadir}/zsh/site-functions/_wstool


%if 0%{?with_python3}
%files -n python3-%{module_name}
%doc LICENSE README.rst doc/changelog.rst
%{_bindir}/python3-%{module_name}
%{python3_sitelib}/%{module_name}/
%{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info/
%endif # with_python3

%changelog
* Thu Jan 11 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.1.17-1
- Update to latest release (rhbz#1533303)

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

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

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

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

* Sun Aug 28 2016 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.1.13-1
- Update to lastest upstream release

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

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

* Tue Oct 20 2015 Rich Mattes <richmattes@gmail.com> - 0.1.12-1
- Update to release 0.1.12 (rhbz#1271029)

* Wed Sep 16 2015 Rich Mattes <richmattes@gmail.com> - 0.1.10-1
- Update to release 0.1.10 (rhbz#1261684)

* Sun Sep 13 2015 Rich Mattes <richmattes@gmail.com> - 0.1.9-1
- Update to release 0.1.9 (rhbz#1261684)

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

* Wed Mar 04 2015 Rich Mattes <richmattes@gmail.com> - 0.1.6-1
- Update to release 0.1.6 (rhbz#1195537)

* Sun Dec 14 2014 Scott K Logan <logans@cottsay.net> - 0.1.5-1
- Update to 0.1.5
- Update to python packaging guidelines
- Add check section

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

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

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Mon May 19 2014 Scott K Logan <logans@cottsay.net> - 0.1.3-1
- Update to 0.1.3
- Add depend on PyYAML

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sun Jan 12 2014 Rich Mattes <richmattes@gmail.com> - 0.1.1-1
- Update to 0.1.1

* Mon Aug 26 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.0.3-1
- Rename python3 bin script

* Sun Aug 25 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.0.3-1
- Update source to github source
- Add py3 support

* Sat Mar 16 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.0.3-1
- Initial rpmbuild