49b86ee
%global commit f4a8015564ff2f621e6f1ff6126d9b5a8d1161d3
c2f8e54
%global shortcommit %(c=%{commit}; echo ${c:0:7})
4918e8f
%global module_name wstool
4918e8f
b3fae5d
%if 0%{?fedora} > 12
b3fae5d
%global with_python3 1
b3fae5d
%else
b3fae5d
%{!?__python2: %global __python2 /usr/bin/python2}
b3fae5d
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
b3fae5d
%endif
b3fae5d
4918e8f
Name:           python-%{module_name}
49b86ee
Version:        0.1.12
4918e8f
Release:        1%{?dist}
4918e8f
Summary:        Tool for managing a workspace of multiple heterogeneous SCM repositories
4918e8f
4918e8f
License:        BSD
4918e8f
URL:            http://www.ros.org/wiki/%{module_name}
444c9d5
Source0:        https://github.com/vcstools/%{module_name}/archive/%{commit}/%{module_name}-%{commit}.tar.gz
d7e67e9
# Patch to remove a duplicate installed file.  Not submitted upstream
d7e67e9
Patch0:         %{module_name}-0.1.9-fedora.patch
4918e8f
BuildArch:      noarch
4918e8f
b3fae5d
BuildRequires:  bzr
b3fae5d
BuildRequires:  git
b3fae5d
BuildRequires:  mercurial
b3fae5d
BuildRequires:  python-coverage
b3fae5d
BuildRequires:  python-dateutil
b3fae5d
BuildRequires:  python2-devel
b3fae5d
BuildRequires:  python-mock
b3fae5d
BuildRequires:  python-nose
b3fae5d
BuildRequires:  python-rosinstall
b3fae5d
BuildRequires:  python-setuptools
f07971b
BuildRequires:  python-sphinx
49b86ee
BuildRequires:  python-vcstools >= 0.1.38
b3fae5d
BuildRequires:  PyYAML
b3fae5d
BuildRequires:  subversion
b3fae5d
b3fae5d
Requires:       bzr
b3fae5d
Requires:       git
b3fae5d
Requires:       mercurial
4918e8f
Requires:       python-dateutil
b3fae5d
Requires:       python-rosinstall
49b86ee
Requires:       python-vcstools >= 0.1.38
b3fae5d
Requires:       PyYAML
b3fae5d
Requires:       subversion
4918e8f
4918e8f
%description
4918e8f
wstool provides commands to manage several local SCM repositories (supports
4918e8f
git, mercurial, subversion, bazaar) based on a single workspace definition file
4918e8f
(.rosinstall).
4918e8f
4918e8f
wstool replaces the rosws tool for catkin workspaces. As catkin workspaces
4918e8f
create their own setup file and environment, wstool is reduced to version
4918e8f
control functions only. So wstool does not have a "regenerate" command, and
4918e8f
does not allow adding non-version controlled elements to workspaces. In all
4918e8f
other respects, it behaves the same as rosws.
4918e8f
4918e8f
%if 0%{?with_python3}
b3fae5d
%package -n python3-%{module_name}
4918e8f
Summary:        Tool for managing a workspace of multiple heterogeneous SCM repositories
b3fae5d
b3fae5d
BuildRequires:  python3-coverage
b3fae5d
BuildRequires:  python3-dateutil
b3fae5d
BuildRequires:  python3-devel
b3fae5d
BuildRequires:  python3-mock
b3fae5d
BuildRequires:  python3-nose
b3fae5d
BuildRequires:  python-rosinstall
b3fae5d
BuildRequires:  python3-setuptools
49b86ee
BuildRequires:  python3-vcstools >= 0.1.38
b3fae5d
BuildRequires:  python3-PyYAML
b3fae5d
b3fae5d
Requires:       bzr
b3fae5d
Requires:       git
b3fae5d
Requires:       mercurial
4918e8f
Requires:       python3-dateutil
b3fae5d
Requires:       python-rosinstall
49b86ee
Requires:       python3-vcstools >= 0.1.38
b3fae5d
Requires:       python3-PyYAML
b3fae5d
Requires:       subversion
4918e8f
b3fae5d
%description -n python3-%{module_name}
4918e8f
wstool provides commands to manage several local SCM repositories (supports
4918e8f
git, mercurial, subversion, bazaar) based on a single workspace definition file
4918e8f
(.rosinstall).
4918e8f
4918e8f
wstool replaces the rosws tool for catkin workspaces. As catkin workspaces
4918e8f
create their own setup file and environment, wstool is reduced to version
4918e8f
control functions only. So wstool does not have a "regenerate" command, and
4918e8f
does not allow adding non-version controlled elements to workspaces. In all
4918e8f
other respects, it behaves the same as rosws.
4918e8f
%endif # with_python3
4918e8f
4918e8f
%prep
c2f8e54
%setup -qn %{module_name}-%{commit}
d7e67e9
%patch0 -p0 -b .fedora
4918e8f
4918e8f
%if 0%{?with_python3}
4918e8f
rm -rf %{py3dir}
4918e8f
cp -a . %{py3dir}
4918e8f
%endif # with_python3
4918e8f
4918e8f
%build
b3fae5d
%{__python2} setup.py build
4918e8f
4918e8f
%if 0%{?with_python3}
4918e8f
pushd %{py3dir}
4918e8f
%{__python3} setup.py build
b3fae5d
mv -v build/scripts-%{python3_version}/%{module_name} build/scripts-%{python3_version}/python3-%{module_name}
4918e8f
popd
4918e8f
%endif # with_python3
4918e8f
4918e8f
%install
d7e67e9
%{__python2} setup.py install --skip-build --root %{buildroot} --prefix %{_usr}
4918e8f
4918e8f
%if 0%{?with_python3}
4918e8f
pushd %{py3dir}
d7e67e9
%{__python3} setup.py install --skip-build --root %{buildroot} --prefix %{_usr}
b3fae5d
popd
b3fae5d
%endif # with_python3
b3fae5d
b3fae5d
%check
b3fae5d
export BZR_EMAIL="Foo Bar <foo@example.com>"
b3fae5d
export GIT_AUTHOR_EMAIL="foo@example.com"
b3fae5d
export GIT_AUTHOR_NAME="Foo Bar"
b3fae5d
export GIT_COMMITTER_EMAIL="foo@example.com"
b3fae5d
export GIT_COMMITTER_NAME="Foo Bar"
b3fae5d
b3fae5d
nosetests --with-coverage --cover-package=%{module_name} -w test
b3fae5d
b3fae5d
%if 0%{?with_python3}
b3fae5d
pushd %{py3dir}
b3fae5d
nosetests-%{python3_version} --with-coverage --cover-package=%{module_name} -w test
4918e8f
popd
4918e8f
%endif # with_python3 
4918e8f
4918e8f
%files
4918e8f
%doc LICENSE README.rst doc/changelog.rst
4918e8f
%{_bindir}/%{module_name}
4918e8f
%{python_sitelib}/%{module_name}/
4918e8f
%{python_sitelib}/%{module_name}-%{version}-py?.?.egg-info/
d7e67e9
%{_mandir}/man1/*.1.*
d7e67e9
# bash completion
d7e67e9
%config(noreplace) %{_sysconfdir}/bash_completion.d/*
d7e67e9
# zsh completion
d7e67e9
%dir %{_datadir}/zsh/
d7e67e9
%dir %{_datadir}/zsh/site-functions/
d7e67e9
%{_datadir}/zsh/site-functions/_wstool
d7e67e9
4918e8f
4918e8f
%if 0%{?with_python3}
b3fae5d
%files -n python3-%{module_name}
4918e8f
%doc LICENSE README.rst doc/changelog.rst
4918e8f
%{_bindir}/python3-%{module_name}
4918e8f
%{python3_sitelib}/%{module_name}/
4918e8f
%{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info/
4918e8f
%endif # with_python3
4918e8f
4918e8f
%changelog
49b86ee
* Tue Oct 20 2015 Rich Mattes <richmattes@gmail.com> - 0.1.12-1
49b86ee
- Update to release 0.1.12 (rhbz#1271029)
49b86ee
f07971b
* Wed Sep 16 2015 Rich Mattes <richmattes@gmail.com> - 0.1.10-1
f07971b
- Update to release 0.1.10 (rhbz#1261684)
f07971b
d7e67e9
* Sun Sep 13 2015 Rich Mattes <richmattes@gmail.com> - 0.1.9-1
d7e67e9
- Update to release 0.1.9 (rhbz#1261684)
d7e67e9
444c9d5
* Wed Mar 04 2015 Rich Mattes <richmattes@gmail.com> - 0.1.6-1
444c9d5
- Update to release 0.1.6 (rhbz#1195537)
444c9d5
b3fae5d
* Sun Dec 14 2014 Scott K Logan <logans@cottsay.net> - 0.1.5-1
b3fae5d
- Update to 0.1.5
b3fae5d
- Update to python packaging guidelines
b3fae5d
- Add check section
b3fae5d
c2f8e54
* Sun Jan 12 2014 Rich Mattes <richmattes@gmail.com> - 0.1.1-1
c2f8e54
- Update to 0.1.1
c2f8e54
4918e8f
* Mon Aug 26 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.0.3-1
4918e8f
- Rename python3 bin script
4918e8f
4918e8f
* Sun Aug 25 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.0.3-1
4918e8f
- Update source to github source
4918e8f
- Add py3 support
4918e8f
4918e8f
* Sat Mar 16 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.0.3-1
4918e8f
- Initial rpmbuild
4918e8f