bfe71d
%global module_name catkin_pkg
fb6b98
%global commit fa4b136b16e2d2886ab97257684f6bff243edefb
b6443e
%global shortcommit %(c=%{commit}; echo ${c:0:7})
76ce6b
2bd113
%if 0%{?fedora} > 12
2bd113
%global with_python3 1
2bd113
%else
2bd113
%{!?__python2: %global __python2 /usr/bin/python2}
2bd113
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
2bd113
%{!?python2_version: %global python2_version %(%{__python2} -c "from sys import stdout, version; stdout.write(version[:3])")}
2bd113
%endif
2bd113
bfe71d
Name:           python-%{module_name}
fb6b98
Version:        0.2.10
f27a4c
Release:        1%{?dist}
bfe71d
Summary:        Library for retrieving information about catkin packages
bfe71d
bfe71d
License:        BSD
bfe71d
URL:            https://github.com/ros-infrastructure/%{module_name}
bfe71d
BuildArch:      noarch
b6443e
Source0:        https://github.com/ros-infrastructure/%{module_name}/archive/%{commit}/%{module_name}-%{commit}.tar.gz
76ce6b
2bd113
Requires:       python-argparse
76ce6b
Requires:       python-dateutil
76ce6b
Requires:       python-docutils
2bd113
BuildRequires:  python2-devel
2bd113
BuildRequires:  python-argparse
76ce6b
BuildRequires:  python-dateutil
76ce6b
BuildRequires:  python-docutils
76ce6b
BuildRequires:  python-mock
2bd113
BuildRequires:  python-nose
2bd113
BuildRequires:  python-setuptools
b6443e
%if !0%{?rhel} || 0%{?rhel} > 6
b6443e
BuildRequires:  python-sphinx
b6443e
%endif
2bd113
fb6b98
%description
fb6b98
Library for retrieving information about catkin packages
fb6b98
2bd113
%if 0%{?with_python3}
2bd113
%package -n python3-%{module_name}
2bd113
Summary:        Library for retrieving information about catkin packages
2bd113
2bd113
Requires:       python3-dateutil
2bd113
Requires:       python3-docutils
2bd113
BuildRequires:  python3-dateutil
2bd113
BuildRequires:  python3-devel
2bd113
BuildRequires:  python3-docutils
2bd113
BuildRequires:  python3-mock
2bd113
BuildRequires:  python3-nose
2bd113
BuildRequires:  python3-setuptools
b6443e
BuildRequires:  python3-sphinx
bfe71d
2bd113
%description -n python3-%{module_name}
2bd113
Library for retrieving information about catkin packages
2bd113
%endif
2bd113
bfe71d
%prep
b6443e
%setup -qc
b6443e
b6443e
mv %{module_name}-%{commit} python2
bfe71d
2bd113
%if 0%{?with_python3}
b6443e
cp -a python2 python3
b6443e
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
2bd113
%endif
2bd113
b6443e
find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
2bd113
bfe71d
%build
b6443e
pushd python2
2bd113
%{__python2} setup.py build
b6443e
%if !0%{?rhel} || 0%{?rhel} > 6
b6443e
PYTHONPATH=%{_builddir}/%{name}-%{version}/python2/build/lib make %{?_smp_mflags} -C doc html
b6443e
rm -f doc/_build/html/.buildinfo
b6443e
%endif
b6443e
popd
2bd113
2bd113
%if 0%{?with_python3}
b6443e
pushd python3
2bd113
%{__python3} setup.py build
b6443e
PYTHONPATH=%{_builddir}/%{name}-%{version}/python3/build/lib make %{?_smp_mflags} -C doc html SPHINXAPIDOC=sphinx-apidoc-%{python3_version} SPHINXBUILD=sphinx-build-%{python3_version}
b6443e
rm -f doc/_build/html/.buildinfo
2bd113
pushd build/scripts-%{python3_version}
2bd113
for f in *; do mv $f python3-$f; done
2bd113
popd
2bd113
popd
2bd113
%endif
bfe71d
bfe71d
%install
b6443e
pushd python2
2bd113
%{__python2} setup.py install --skip-build --root %{buildroot}
b6443e
popd
2bd113
2bd113
%if 0%{?with_python3}
b6443e
pushd python3
2bd113
%{__python3} setup.py install --skip-build --root %{buildroot}
2bd113
popd
2bd113
%endif
bfe71d
76ce6b
%check
b6443e
pushd python2
2bd113
%if "%{python2_version}" == "2.6"
2bd113
# Skip tests that use python 2.7 assertions
2bd113
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests -w test -e "(test_topological_order_packages_with_duplicates|test_validate_metapackage|test_package_decorator_init|test_create_package_template)"
2bd113
%else
2bd113
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests-%{python2_version} -w test
2bd113
%endif
b6443e
popd
2bd113
2bd113
%if 0%{?with_python3}
b6443e
pushd python3
2bd113
PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version} -w test
2bd113
popd
2bd113
%endif
2bd113
bfe71d
%files
b6443e
%if !0%{?rhel} || 0%{?rhel} > 6
b6443e
%doc python2/doc/_build/html python2/README.rst
92d728
%license python2/LICENSE
b6443e
%else
92d728
%doc python2/LICENSE python2/README.rst
b6443e
%endif
bfe71d
%{_bindir}/catkin_create_pkg
76ce6b
%{_bindir}/catkin_find_pkg
bfe71d
%{_bindir}/catkin_generate_changelog
bfe71d
%{_bindir}/catkin_tag_changelog
bfe71d
%{_bindir}/catkin_test_changelog
2bd113
%{python2_sitelib}/%{module_name}/
2bd113
%{python2_sitelib}/%{module_name}-%{version}-py?.?.egg-info
2bd113
2bd113
%if 0%{?with_python3}
2bd113
%files -n python3-%{module_name}
b6443e
%doc python3/doc/_build/html python3/README.rst
92d728
%license python3/LICENSE
2bd113
%{_bindir}/python3-catkin_create_pkg
2bd113
%{_bindir}/python3-catkin_find_pkg
2bd113
%{_bindir}/python3-catkin_generate_changelog
2bd113
%{_bindir}/python3-catkin_tag_changelog
2bd113
%{_bindir}/python3-catkin_test_changelog
2bd113
%{python3_sitelib}/%{module_name}/
2bd113
%{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info
2bd113
%endif
bfe71d
bfe71d
%changelog
fb6b98
* Thu Sep 17 2015 Rich Mattes <richmattes@gmail.com> - 0.2.10-1
fb6b98
- Update to release 0.2.10 (rhbz#1250758)
fb6b98
- Remove upstreamed patches
fb6b98
- Fix spec file layout so spectool can parse it
fb6b98
b6443e
* Tue Jun 30 2015 Scott K Logan <logans@cottsay.net> - 0.2.9-1
b6443e
- Update to 0.2.9
b6443e
- Switch to Github upstream to get docs
b6443e
- Update to latest packaging guidelines
b6443e
92dc45
* Thu Mar 12 2015 Ankur Sinha <ankursinha at="" fedoraproject="" dot="" org=""> 0.2.7-1
92dc45
- Update to 0.2.7
92dc45
3c5c95
* Sat Oct 25 2014 Scott K Logan <logans@cottsay.net> - 0.2.6-1
3c5c95
- Update to 0.2.6
3c5c95
2bd113
* Sat Oct 18 2014 Scott K Logan <logans@cottsay.net> - 0.2.5-1
2bd113
- Update to 0.2.5
2bd113
- Add python3 package
2bd113
- Exclude tests which are not compatible with python 2.6
2bd113
5ad1f2
* Thu Jul 31 2014 Scott K Logan <logans@cottsay.net> - 0.2.4-1
5ad1f2
- Update to 0.2.4
5ad1f2
- Remove README.rst (not present in Pypi sources)
5ad1f2
f27a4c
* Wed Jul 16 2014 Ankur Sinha <ankursinha at="" fedoraproject="" dot="" org=""> 0.2.3-1
f27a4c
- Update to latest upstream release
f27a4c
773b68
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-2
773b68
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
773b68
8c2809
* Sat May 10 2014 Scott K Logan <logans@cottsay.net> - 0.2.2-1
8c2809
- Update to 0.2.2
8c2809
9c0203
* Thu Feb 06 2014 Scott K Logan <logans@cottsay.net> - 0.1.28-1
9c0203
- Update to 0.1.28
9c0203
76ce6b
* Thu Feb 06 2014 Scott K Logan <logans@cottsay.net> - 0.1.25-1
76ce6b
- Update to 0.1.25
76ce6b
- Added check section
76ce6b
- Added python-dateutil Requires/BuildRequires
76ce6b
- Added python-docutils Requires/BuildRequires
76ce6b
- Added python-nose BuildRequires
76ce6b
- Added python-mock BuildRequires
76ce6b
f0d035
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.18-2
f0d035
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f0d035
bfe71d
* Wed Jul 17 2013 Ankur Sinha <ankursinha at="" fedoraproject="" dot="" org=""> 0.1.18-1
bfe71d
- Update to 1.18
bfe71d
- https://bugzilla.redhat.com/show_bug.cgi?id=926034
bfe71d
bfe71d
* Sat Mar 16 2013 Ankur Sinha <ankursinha at="" fedoraproject="" dot="" org=""> 0.1.10-1
bfe71d
- Initial rpm build
bfe71d
bfe71d
bfe71d