Blob Blame Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global modname pkgwat.api

Name:             python-pkgwat-api
Version:          0.12
Release:          6%{?dist}
Summary:          Python API for querying the fedora packages webapp

Group:            Development/Libraries
License:          LGPLv2+
URL:              http://pypi.python.org/pypi/pkgwat.api
Source0:          http://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:        noarch

BuildRequires:    python2-devel
BuildRequires:    python-setuptools

%if 0%{?with_python3}
BuildRequires:    python3-devel
BuildRequires:    python3-setuptools
%endif

Requires:         python-six
Requires:         python-requests

%if 0%{?rhel} < 7
BuildRequires:    python-ordereddict
Requires:         python-ordereddict
%endif

%description
Python API for pkgwat
http://pypi.python.org/pypi/pkgwat.cli

%if 0%{?with_python3}
%package -n python3-pkgwat-api
Summary:          Python API for querying the fedora packages webapp
Group:            Development/Libraries

Requires:         python3-six
Requires:         python3-requests

# Once upon a time I named the subpackage incorrectly.  We need to obsolete it.
Obsoletes:        python3-python-pkgwat-api
Provides:         python3-python-pkgwat-api

%description -n python3-pkgwat-api
Python API for pkgwat
http://pypi.python.org/pypi/pkgwat.cli.

%endif

%prep
%setup -q -n %{modname}-%{version}

rm -rf pkgwat.api.egg-info

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
popd
%endif

%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

%files
%doc README.rst LICENSE lgpl-2.1.txt
%{python_sitelib}/pkgwat
%{python_sitelib}/%{modname}-%{version}*

%if 0%{?with_python3}
%files -n python3-pkgwat-api
%doc README.rst LICENSE lgpl-2.1.txt
%{python3_sitelib}/pkgwat
%{python3_sitelib}/%{modname}-%{version}-*
%endif

%changelog
* Thu Nov 12 2015 Ralph Bean <rbean@redhat.com> - 0.12-6
- Make python-ordereddict unnecessary on EL7.

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.12-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Thu Nov 14 2013 Ralph Bean <rbean@redhat.com> - 0.12-1
- Fix unicode issues when stripping html from responses.

* Sun Nov 03 2013 Ralph Bean <rbean@redhat.com> - 0.10-2
- Add obsoletes/provides on python3-python-pkgwat-api

* Tue Oct 22 2013 Ralph Bean <rbean@redhat.com> - 0.10-1
- Latest upstream with some bugfixes.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Jun 11 2013 Ralph Bean <rbean@redhat.com> - 0.9-1
- Latest upstream.
- New history function to search datagrepper.
- Subpackages support with patches from Ariel O. Barria.

* Tue Apr 09 2013 Ralph Bean <rbean@redhat.com> - 0.8-1
- Latest upstream with a bugfix for py2.6.
- Conditionally depend on python-ordereddict.
- Remove py3.2 patch.  Now included in upstream's release.

* Wed Mar 20 2013 Ralph Bean <rbean@redhat.com> - 0.7-3
- Correctly name the python3 subpackage.

* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 0.7-2
- Patch to fix syntax error on python3.2.

* Thu Feb 28 2013 Ralph Bean <rbean@redhat.com> - 0.7-1
- Latest upstream with a new "get" function.

* Wed Feb 27 2013 Ralph Bean <rbean@redhat.com> - 0.6-1
- Latest upstream with new functions for querying relationships.
- Removed spurious newlines in .spec file.
- Modernized with_python3 conditional.

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Jan 22 2013 Ralph Bean <rbean@redhat.com> - 0.5-1
- Latest upstream; Fix to the karma formatting.

* Wed Jan 16 2013 Ralph Bean <rbean@redhat.com> - 0.4-1
- Latest upstream with support for newer python-requests.

* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 0.3-5
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jul 05 2012 Ralph Bean <rbean@redhat.com> - 0.3-3
- Remove the bundled egg-info.

* Mon Jul 02 2012 Ralph Bean <rbean@redhat.com> - 0.3-2
- Remove tests for koji.

* Mon Jul 02 2012 Ralph Bean <rbean@redhat.com> - 0.3-1
- Latest upstream, includes unit tests.

* Mon Jul 02 2012 Ralph Bean <rbean@redhat.com> - 0.1-1
- Initial package for Fedora