Blob Blame Raw
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
%global with_python3 1
%endif

%global modname pkgwat.api

Name:             python-pkgwat-api
Version:          0.5
Release:          2%{?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

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

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

Requires:         python3-six
Requires:         python3-requests

%description -n python3-%{name}
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-%{name}
%doc README.rst LICENSE lgpl-2.1.txt
%{python3_sitelib}/pkgwat
%{python3_sitelib}/%{modname}-%{version}-*

%endif


%changelog
* 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