%if 0%{?fedora}
%global with_python3 1
%endif
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
# Manually disable python3 until python3-cliff becomes available. That is
# blocking on python3-prettytable, here.
# https://bugzilla.redhat.com/show_bug.cgi?id=837087
%global with_python3 0
%global modname pkgwat.cli
Name: pkgwat
Version: 0.11
Release: 1%{?dist}
Summary: CLI tool for querying the fedora packages webapp
Group: Development/Libraries
License: LGPLv2+
URL: http://pypi.python.org/pypi/pkgwat.cli
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-pkgwat-api
Requires: python-cliff
Requires: python-fabulous
%description
Pronounced "package WAT", pkgwat is a fast CLI tool for querying the fedora
packages webapp. https://apps.fedoraproject.org/packages/
You can make its search even better by helping us tag packages.
https://apps.fedoraproject.org/tagger
%if 0%{?with_python3}
%package -n python3-pkgwat
Summary: Python API for querying the fedora packages webapp
Group: Development/Libraries
Requires: python3-pkgwat-api
Requires: python3-cliff
%description -n python3-pkgwat
Pronounced "package WAT", pkgwat is a fast CLI tool for querying the fedora
packages webapp. https://apps.fedoraproject.org/packages/
You can make its search even better by helping us tag packages.
https://apps.fedoraproject.org/tagger
%endif
%prep
%setup -q -n %{modname}-%{version}
sed -i "s/ยป/>/g" README.rst
sed -i '/pillow/d' setup.py
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python2} 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}
mv %{buildroot}/%{_bindir}/pkgwat %{buildroot}/%{_bindir}/python3-pkgwat
popd
%endif
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
%files
%doc README.rst LICENSE
%{python2_sitelib}/pkgwat/cli
%{python2_sitelib}/%{modname}-%{version}*
%{_bindir}/pkgwat
%if 0%{?with_python3}
%files -n python3-pkgwat
%doc LICENSE README.rst
%{python3_sitelib}/pkgwat/cli
%{python3_sitelib}/%{modname}-%{version}-*
%{_bindir}/python3-pkgwat
%endif
%changelog
* Fri Jan 23 2015 Ralph Bean <rbean@redhat.com> - 0.11-1
- Latest upstream.
* Wed Oct 01 2014 Ralph Bean <rbean@redhat.com> - 0.10-3
- Define python2 macros for el6.
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Jan 17 2014 Ralph Bean <rbean@redhat.com> - 0.10-1
- Added short flags for pagination.
* Fri Nov 01 2013 Ralph Bean <rbean@redhat.com> - 0.9-1
- Latest upstream with bugfixes for link shortening.
- Modernize python2 rpm macros.
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 03 2013 Ralph Bean <rbean@redhat.com> - 0.8-1
- New pkgwat history subcommand.
- Fix to pkgwat search.
* Thu Jun 13 2013 Ralph Bean <rbean@redhat.com> - 0.7-1
- Latest upstream with datagrepper query.
- Fix when getting info on a subpackage from Ariel Barria.
* Tue May 14 2013 Ralph Bean <rbean@redhat.com> - 0.6-2
- Adjust sed statement.
* Tue May 14 2013 Ralph Bean <rbean@redhat.com> - 0.6-1
- Latest upstream. Fixes issue with PIL/Pillow.
- Removed downstream patch.
* Thu Feb 14 2013 Ralph Bean <rbean@redhat.com> - 0.5-2
- Patch to fix a bug in the updates subcommand.
* Tue Jan 22 2013 Ralph Bean <rbean@redhat.com> - 0.5-1
- Latest upstream.
- Fix a unicode bug when redirecting to files.
- Properly display multi-build updates.
* Wed Jan 16 2013 Ralph Bean <rbean@redhat.com> - 0.4-2
- Remove no-longer-necessary Requires on python-imaging.
- Patch PIL requirement out of setup.py.
* Thu Nov 08 2012 Ralph Bean <rbean@redhat.com> - 0.4-1
- Fixed bug with latest python-requests.
- Gracefully handle unknown commands.
* Fri Nov 02 2012 Ralph Bean <rbean@redhat.com> - 0.3-3
- Bugfix - Require python-imaging and python-fabulous.
* Thu Jul 05 2012 Ralph Bean <rbean@redhat.com> - 0.3-2
- Manually disable python3 support until python3-cliff is available.
* Mon Jul 02 2012 Ralph Bean <rbean@redhat.com> - 0.3-1
- Initial package for Fedora