bfe71dc
%global module_name catkin_pkg
cd45b7d
%global commit f5e19aadafc9cea59f41f018e3a2fc2517d434a9
a7e32b4
%global shortcommit %(c=%{commit}; echo ${c:0:7})
76ce6b6
2bd113a
%if 0%{?fedora} > 12
2bd113a
%global with_python3 1
2bd113a
%else
2bd113a
%{!?__python2: %global __python2 /usr/bin/python2}
2bd113a
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
2bd113a
%{!?python2_version: %global python2_version %(%{__python2} -c "from sys import stdout, version; stdout.write(version[:3])")}
2bd113a
%endif
2bd113a
bfe71dc
Name:           python-%{module_name}
cd45b7d
Version:        0.3.1
7f8eb34
Release:        2%{?dist}
bfe71dc
Summary:        Library for retrieving information about catkin packages
bfe71dc
bfe71dc
License:        BSD
bfe71dc
URL:            https://github.com/ros-infrastructure/%{module_name}
bfe71dc
BuildArch:      noarch
a7e32b4
Source0:        https://github.com/ros-infrastructure/%{module_name}/archive/%{commit}/%{module_name}-%{commit}.tar.gz
76ce6b6
2bd113a
BuildRequires:  python2-devel
76ce6b6
BuildRequires:  python-dateutil
76ce6b6
BuildRequires:  python-docutils
76ce6b6
BuildRequires:  python-mock
2bd113a
BuildRequires:  python-nose
2bd113a
BuildRequires:  python-setuptools
a7e32b4
%if !0%{?rhel} || 0%{?rhel} > 6
a7e32b4
BuildRequires:  python-sphinx
a7e32b4
%endif
2bd113a
fb6b985
%description
fb6b985
Library for retrieving information about catkin packages
fb6b985
093a10c
%package -n python2-%{module_name}
093a10c
Summary:        Library for retrieving information about catkin packages
093a10c
%{?python_provide:%python_provide python2-%{module_name}}
093a10c
Requires:       python-dateutil
093a10c
Requires:       python-docutils
093a10c
093a10c
%description -n python2-%{module_name}
093a10c
Library for retrieving information about catkin packages
093a10c
2bd113a
%if 0%{?with_python3}
2bd113a
%package -n python3-%{module_name}
2bd113a
Summary:        Library for retrieving information about catkin packages
2bd113a
2bd113a
Requires:       python3-dateutil
2bd113a
Requires:       python3-docutils
2bd113a
BuildRequires:  python3-dateutil
2bd113a
BuildRequires:  python3-devel
2bd113a
BuildRequires:  python3-docutils
2bd113a
BuildRequires:  python3-mock
2bd113a
BuildRequires:  python3-nose
2bd113a
BuildRequires:  python3-setuptools
a7e32b4
BuildRequires:  python3-sphinx
bfe71dc
2bd113a
%description -n python3-%{module_name}
2bd113a
Library for retrieving information about catkin packages
2bd113a
%endif
2bd113a
bfe71dc
%prep
a7e32b4
%setup -qc
a7e32b4
a7e32b4
mv %{module_name}-%{commit} python2
bfe71dc
2bd113a
%if 0%{?with_python3}
a7e32b4
cp -a python2 python3
a7e32b4
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
2bd113a
%endif
2bd113a
a7e32b4
find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
2bd113a
cd45b7d
sed -i "s/  'catkin_/  'python3-catkin_/g" python3/setup.py
cd45b7d
bfe71dc
%build
a7e32b4
pushd python2
2bd113a
%{__python2} setup.py build
a7e32b4
%if !0%{?rhel} || 0%{?rhel} > 6
a7e32b4
PYTHONPATH=%{_builddir}/%{name}-%{version}/python2/build/lib make %{?_smp_mflags} -C doc html
a7e32b4
rm -f doc/_build/html/.buildinfo
a7e32b4
%endif
a7e32b4
popd
2bd113a
2bd113a
%if 0%{?with_python3}
a7e32b4
pushd python3
2bd113a
%{__python3} setup.py build
a7e32b4
PYTHONPATH=%{_builddir}/%{name}-%{version}/python3/build/lib make %{?_smp_mflags} -C doc html SPHINXAPIDOC=sphinx-apidoc-%{python3_version} SPHINXBUILD=sphinx-build-%{python3_version}
a7e32b4
rm -f doc/_build/html/.buildinfo
cd45b7d
pushd bin
2bd113a
for f in *; do mv $f python3-$f; done
2bd113a
popd
2bd113a
popd
2bd113a
%endif
bfe71dc
bfe71dc
%install
a7e32b4
pushd python2
2bd113a
%{__python2} setup.py install --skip-build --root %{buildroot}
a7e32b4
popd
2bd113a
2bd113a
%if 0%{?with_python3}
a7e32b4
pushd python3
2bd113a
%{__python3} setup.py install --skip-build --root %{buildroot}
2bd113a
popd
2bd113a
%endif
bfe71dc
76ce6b6
%check
a7e32b4
pushd python2
2bd113a
%if "%{python2_version}" == "2.6"
2bd113a
# Skip tests that use python 2.7 assertions
2bd113a
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)"
2bd113a
%else
2bd113a
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests-%{python2_version} -w test
2bd113a
%endif
a7e32b4
popd
2bd113a
2bd113a
%if 0%{?with_python3}
a7e32b4
pushd python3
2bd113a
PYTHONPATH=%{buildroot}%{python3_sitelib} nosetests-%{python3_version} -w test
2bd113a
popd
2bd113a
%endif
2bd113a
093a10c
%files -n python2-%{module_name}
a7e32b4
%if !0%{?rhel} || 0%{?rhel} > 6
a7e32b4
%doc python2/doc/_build/html python2/README.rst
8dbb0ed
%license python2/LICENSE
a7e32b4
%else
8dbb0ed
%doc python2/LICENSE python2/README.rst
a7e32b4
%endif
bfe71dc
%{_bindir}/catkin_create_pkg
76ce6b6
%{_bindir}/catkin_find_pkg
bfe71dc
%{_bindir}/catkin_generate_changelog
bfe71dc
%{_bindir}/catkin_tag_changelog
bfe71dc
%{_bindir}/catkin_test_changelog
2bd113a
%{python2_sitelib}/%{module_name}/
2bd113a
%{python2_sitelib}/%{module_name}-%{version}-py?.?.egg-info
2bd113a
2bd113a
%if 0%{?with_python3}
2bd113a
%files -n python3-%{module_name}
a7e32b4
%doc python3/doc/_build/html python3/README.rst
8dbb0ed
%license python3/LICENSE
2bd113a
%{_bindir}/python3-catkin_create_pkg
2bd113a
%{_bindir}/python3-catkin_find_pkg
2bd113a
%{_bindir}/python3-catkin_generate_changelog
2bd113a
%{_bindir}/python3-catkin_tag_changelog
2bd113a
%{_bindir}/python3-catkin_test_changelog
2bd113a
%{python3_sitelib}/%{module_name}/
2bd113a
%{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info
2bd113a
%endif
bfe71dc
bfe71dc
%changelog
7f8eb34
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-2
7f8eb34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7f8eb34
cd45b7d
* Sun Apr 09 2017 Rich Mattes <richmattes@gmail.com> - 0.3.1-1
cd45b7d
- Update to release 0.3.1 (rhbz#1422069)
cd45b7d
4259c12
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.10-7
4259c12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
4259c12
c50144b
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.2.10-6
c50144b
- Rebuild for Python 3.6
c50144b
093a10c
* Tue Sep 27 2016 Rich Mattes <richmattes@gmail.com> - 0.2.10-5
093a10c
- Remove argparse requirement
093a10c
643ec20
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.10-4
643ec20
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
643ec20
566cb47
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.10-3
566cb47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
566cb47
681ce66
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.10-2
681ce66
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
681ce66
fb6b985
* Thu Sep 17 2015 Rich Mattes <richmattes@gmail.com> - 0.2.10-1
fb6b985
- Update to release 0.2.10 (rhbz#1250758)
fb6b985
- Remove upstreamed patches
fb6b985
- Fix spec file layout so spectool can parse it
fb6b985
a7e32b4
* Tue Jun 30 2015 Scott K Logan <logans@cottsay.net> - 0.2.9-1
a7e32b4
- Update to 0.2.9
a7e32b4
- Switch to Github upstream to get docs
a7e32b4
- Update to latest packaging guidelines
a7e32b4
650a552
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.7-2
650a552
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
650a552
92dc450
* Thu Mar 12 2015 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.2.7-1
92dc450
- Update to 0.2.7
92dc450
3c5c952
* Sat Oct 25 2014 Scott K Logan <logans@cottsay.net> - 0.2.6-1
3c5c952
- Update to 0.2.6
3c5c952
2bd113a
* Sat Oct 18 2014 Scott K Logan <logans@cottsay.net> - 0.2.5-1
2bd113a
- Update to 0.2.5
2bd113a
- Add python3 package
2bd113a
- Exclude tests which are not compatible with python 2.6
2bd113a
5ad1f29
* Thu Jul 31 2014 Scott K Logan <logans@cottsay.net> - 0.2.4-1
5ad1f29
- Update to 0.2.4
5ad1f29
- Remove README.rst (not present in Pypi sources)
5ad1f29
f27a4c6
* Wed Jul 16 2014 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.2.3-1
f27a4c6
- Update to latest upstream release
f27a4c6
773b682
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-2
773b682
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
773b682
8c2809e
* Sat May 10 2014 Scott K Logan <logans@cottsay.net> - 0.2.2-1
8c2809e
- Update to 0.2.2
8c2809e
9c0203d
* Thu Feb 06 2014 Scott K Logan <logans@cottsay.net> - 0.1.28-1
9c0203d
- Update to 0.1.28
9c0203d
76ce6b6
* Thu Feb 06 2014 Scott K Logan <logans@cottsay.net> - 0.1.25-1
76ce6b6
- Update to 0.1.25
76ce6b6
- Added check section
76ce6b6
- Added python-dateutil Requires/BuildRequires
76ce6b6
- Added python-docutils Requires/BuildRequires
76ce6b6
- Added python-nose BuildRequires
76ce6b6
- Added python-mock BuildRequires
76ce6b6
f0d0354
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.18-2
f0d0354
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f0d0354
bfe71dc
* Wed Jul 17 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.1.18-1
bfe71dc
- Update to 1.18
bfe71dc
- https://bugzilla.redhat.com/show_bug.cgi?id=926034
bfe71dc
bfe71dc
* Sat Mar 16 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 0.1.10-1
bfe71dc
- Initial rpm build
bfe71dc
bfe71dc
bfe71dc