Blob Blame History Raw
%global commit f4a8015564ff2f621e6f1ff6126d9b5a8d1161d3
%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.12
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

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

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

%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
%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
* 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