a36f446
%{?!_without_doc:%global with_doc 0%{?_with_doc:1} || !0%{?rhel} || 0%{?rhel} >= 7}
117e795
%{?!_without_python2:%global with_python2 0%{?_with_python2:1} || !(0%{?fedora} >= 32 || 0%{?rhel} >= 8)}
a36f446
%{?!_without_python3:%global with_python3 0%{?_with_python3:1} || !0%{?rhel} || 0%{?rhel} >= 7}
2bd113a
8b73c8a
%global srcname catkin_pkg
8b73c8a
8b73c8a
Name:           python-%{srcname}
117e795
Version:        0.4.14
a36f446
Release:        1%{?dist}
bfe71dc
Summary:        Library for retrieving information about catkin packages
bfe71dc
bfe71dc
License:        BSD
8b73c8a
URL:            https://github.com/ros-infrastructure/%{srcname}
8b73c8a
Source0:        https://github.com/ros-infrastructure/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz
76ce6b6
8b73c8a
BuildArch:      noarch
2bd113a
fb6b985
%description
8b73c8a
%{summary}
fb6b985
a36f446
a36f446
%if 0%{?with_doc}
a36f446
%package doc
a36f446
Summary:        HTML documentation for %{name}
a36f446
BuildRequires:  python%{python3_pkgversion}-sphinx
a36f446
a36f446
%description doc
a36f446
HTML API documentation for the Python module '%{srcname}'
a36f446
%endif # with_doc
a36f446
a36f446
8b73c8a
%if 0%{?with_python2}
8b73c8a
%package -n python2-%{srcname}
8b73c8a
Summary:        %{summary}
8b73c8a
BuildRequires:  python2-dateutil
8b73c8a
BuildRequires:  python2-devel
8b73c8a
BuildRequires:  python2-docutils
8b73c8a
BuildRequires:  python2-mock
8b73c8a
BuildRequires:  python2-nose
8b73c8a
BuildRequires:  python2-pyparsing
8b73c8a
BuildRequires:  python2-setuptools
a36f446
%{?python_provide:%python_provide python2-%{srcname}}
a36f446
7f048dc
%if %{undefined __pythondist_requires}
a36f446
Requires:       python2-dateutil
a36f446
Requires:       python2-docutils
a36f446
Requires:       python2-pyparsing
7f048dc
%endif # __pythondist_requires
093a10c
117e795
%if (0%{?fedora} || 0%{?rhel} >= 8) && (0%{?with_doc})
a36f446
Suggests:       %{name}-doc = %{version}-%{release}
117e795
%endif # (fedora || rhel >= 8) && with_doc
a7e32b4
8b73c8a
%description -n python2-%{srcname}
8b73c8a
%{summary}
8b73c8a
%endif # with_python2
bfe71dc
a36f446
2bd113a
%if 0%{?with_python3}
8b73c8a
%package -n python%{python3_pkgversion}-%{srcname}
8b73c8a
Summary:        %{summary}
8b73c8a
BuildRequires:  python%{python3_pkgversion}-dateutil
8b73c8a
BuildRequires:  python%{python3_pkgversion}-devel
8b73c8a
BuildRequires:  python%{python3_pkgversion}-docutils
8b73c8a
BuildRequires:  python%{python3_pkgversion}-mock
8b73c8a
BuildRequires:  python%{python3_pkgversion}-nose
8b73c8a
BuildRequires:  python%{python3_pkgversion}-pyparsing
8b73c8a
BuildRequires:  python%{python3_pkgversion}-setuptools
a36f446
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
a36f446
7f048dc
%if %{undefined __pythondist_requires}
a36f446
Requires:       python%{python3_pkgversion}-dateutil
a36f446
Requires:       python%{python3_pkgversion}-docutils
a36f446
Requires:       python%{python3_pkgversion}-pyparsing
7f048dc
%endif # __pythondist_requires
8b73c8a
117e795
%if (0%{?fedora} || 0%{?rhel} >= 8) && (0%{?with_doc})
a36f446
Suggests:       %{name}-doc = %{version}-%{release}
117e795
%endif # (fedora || rhel >= 8) && with_doc
8b73c8a
8b73c8a
%description -n python%{python3_pkgversion}-%{srcname}
8b73c8a
%{summary}
8b73c8a
%endif # with_python3
8b73c8a
cd45b7d
8b73c8a
%prep
8b73c8a
%autosetup -p1 -n %{srcname}-%{version}
5bfb4ee
a36f446
bfe71dc
%build
8b73c8a
%if 0%{?with_python2}
8b73c8a
%py2_build
8b73c8a
%endif # with_python2
2bd113a
2bd113a
%if 0%{?with_python3}
8b73c8a
%py3_build
8b73c8a
%endif # with_python3
8b73c8a
8b73c8a
%if 0%{?with_doc}
8b73c8a
PYTHONPATH=$PWD/build/lib \
8b73c8a
    PYTHONDONTWRITEBYTECODE=1 \
7f048dc
    %make_build -C doc html SPHINXBUILD=sphinx-build-%{python3_version} SPHINXAPIDOC=sphinx-apidoc-%{python3_version}
a36f446
rm doc/_build/html/.buildinfo
8b73c8a
%endif # with_doc
bfe71dc
a36f446
bfe71dc
%install
8b73c8a
%if 0%{?with_python2}
8b73c8a
%py2_install
8b73c8a
%endif # with_python2
2bd113a
2bd113a
%if 0%{?with_python3}
a36f446
%py3_install -- --install-scripts %{_bindir}/python%{python3_pkgversion}
8b73c8a
pushd %{buildroot}%{_bindir}/python%{python3_pkgversion}
8b73c8a
for i in *; do mv $i ../python%{python3_pkgversion}-$i; done
2bd113a
popd
8b73c8a
rmdir %{buildroot}%{_bindir}/python%{python3_pkgversion}
8b73c8a
%endif # with_python3
bfe71dc
a36f446
8b73c8a
%check
8b73c8a
%if 0%{?with_python2}
8b73c8a
%if "%{python2_version}" == "2.6"
2bd113a
# Skip tests that use python 2.7 assertions
8b73c8a
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests -w test \
8b73c8a
    -e "(test_check_known_attributes|test_create_package_template|test_flake8|test_package_decorator_init|test_topological_order_packages_with_duplicates|test_validate_metapackage|test_validate_package)"
8b73c8a
%else # python-2.6
8b73c8a
PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} -m nose -w test -e "(test_flake8)"
8b73c8a
%endif # python-2.6
8b73c8a
%endif # with_python2
8b73c8a
8b73c8a
%if 0%{?with_python3}
8b73c8a
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m nose -w test -e "(test_flake8)"
8b73c8a
%endif # with_python3
8b73c8a
a36f446
a36f446
%if 0%{?with_doc}
a36f446
%files doc
a36f446
%license LICENSE
a36f446
%doc doc/_build/html
a36f446
%endif # with_doc
a36f446
8b73c8a
%if 0%{?with_python2}
8b73c8a
%files -n python2-%{srcname}
8b73c8a
%license LICENSE
8b73c8a
%doc README.rst
8b73c8a
%{python2_sitelib}/%{srcname}/
8b73c8a
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info/
bfe71dc
%{_bindir}/catkin_create_pkg
76ce6b6
%{_bindir}/catkin_find_pkg
bfe71dc
%{_bindir}/catkin_generate_changelog
b4c0cdf
%{_bindir}/catkin_package_version
b4c0cdf
%{_bindir}/catkin_prepare_release
a36f446
%{_bindir}/catkin_tag_changelog
a36f446
%{_bindir}/catkin_test_changelog
8b73c8a
%endif # with_python2
2bd113a
2bd113a
%if 0%{?with_python3}
8b73c8a
%files -n python%{python3_pkgversion}-%{srcname}
8b73c8a
%license LICENSE
8b73c8a
%doc README.rst
8b73c8a
%{python3_sitelib}/%{srcname}/
8b73c8a
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/
8b73c8a
%{_bindir}/python%{python3_pkgversion}-catkin_create_pkg
8b73c8a
%{_bindir}/python%{python3_pkgversion}-catkin_find_pkg
8b73c8a
%{_bindir}/python%{python3_pkgversion}-catkin_generate_changelog
8b73c8a
%{_bindir}/python%{python3_pkgversion}-catkin_package_version
8b73c8a
%{_bindir}/python%{python3_pkgversion}-catkin_prepare_release
a36f446
%{_bindir}/python%{python3_pkgversion}-catkin_tag_changelog
a36f446
%{_bindir}/python%{python3_pkgversion}-catkin_test_changelog
8b73c8a
%endif # with_python3
8b73c8a
bfe71dc
bfe71dc
%changelog
117e795
* Wed Oct 30 2019 Scott K Logan <logans@cottsay.net> - 0.4.14-1
117e795
- Update to 0.4.14 (rhbz#1762232)
117e795
19ba687
* Fri Jul 26 2019 Scott K Logan <logans@cottsay.net> - 0.4.13-1
19ba687
- Update to 0.4.13
19ba687
7f048dc
* Wed Jul 17 2019 Scott K Logan <logans@cottsay.net> - 0.4.12-1
7f048dc
- Update to 0.4.12 (rhbz#1702118)
7f048dc
a36f446
* Mon Mar 25 2019 Scott K Logan <logans@cottsay.net> - 0.4.11-1
a36f446
- Update to 0.4.11
a36f446
- Switch to Python 3 Sphinx
a36f446
- Handle automatic dependency generation (f30+)
a36f446
- Make doc subpackage a weaker dependency
a36f446
89642fb
* Sat Jan 12 2019 Scott K Logan <logans@cottsay.net> - 0.4.10-2
89642fb
- Add patch for argparse on Python 2.7
89642fb
8b73c8a
* Fri Jan 11 2019 Scott K Logan <logans@cottsay.net> - 0.4.10-1
8b73c8a
- Update to 0.4.10
8b73c8a
- Modernize spec
8b73c8a
- Separate doc package
8b73c8a
96e596e
* Thu Sep 13 2018 Scott K Logan <logans@cottsay.net> - 0.4.8-1
96e596e
- Update to 0.4.8 (rhbz#1597686)
2476f4a
- Add runtime requirement for pyparsing (rhbz#1628751)
2476f4a
672727a
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.5-3
672727a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
672727a
68e3901
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.5-2
68e3901
- Rebuilt for Python 3.7
68e3901
d321544
* Fri Jun 29 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.4.5-1
d321544
- Update to 0.4.5
d321544
c4cf8c1
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.3-3
c4cf8c1
- Rebuilt for Python 3.7
c4cf8c1
b4c0cdf
* Sat Jun 09 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.4.3-2
b4c0cdf
- Fix build
b4c0cdf
- Add new bin scripts.
b4c0cdf
0a543ca
* Sat Jun 09 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.4.3-1
0a543ca
- Update to new upstream version
0a543ca
d30bc26
* Sat May 19 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.4.2-1
d30bc26
- Update to latest upstream release
d30bc26
- Tests fail. Disabling
d30bc26
d0b61c4
* Sun Mar 04 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.4.1-2
d0b61c4
- Add BR to fix tests
d0b61c4
d8d8eea
* Sun Mar 04 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.4.1-1
d8d8eea
- Update to latest upstream release
d8d8eea
2143bd8
* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.3.9-4
2143bd8
- Update Python 2 dependency declarations to new packaging standards
2143bd8
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
2143bd8
4cc5987
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-3
4cc5987
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
4cc5987
5bfb4ee
* Sun Dec 17 2017 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.9-2
5bfb4ee
- Remove patch, use sed instead to make it version independent
5bfb4ee
b4329a8
* Sun Dec 17 2017 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.9-1
b4329a8
- Update to latest releas 0.3.9 (rhbz#1508241)
b4329a8
f2d86c0
* Sat Dec 02 2017 Till Hofmann <thofmann@fedoraproject.org> - 0.3.8-2
f2d86c0
- Add patch to remove argparse from the requirements
f2d86c0
6daf71e
* Wed Oct 25 2017 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.3.8-1
6daf71e
- Update to new release 0.3.8 (rhbz#1455183)
6daf71e
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