# Python2 macros for EPEL
%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
%global pypi_name gerritlib
Name: python-gerritlib
Version: 0.3.0
Release: 6%{?dist}
Summary: Client library for accessing Gerrit
License: ASL 2.0
URL: https://pypi.python.org/pypi/gerritlib
Source0: https://pypi.python.org/packages/source/g/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-pbr
BuildRequires: python-hacking
BuildRequires: python-paramiko
Requires: python-pbr
Requires: python-paramiko
%description
A Python library for interacting with Gerrit
%prep
%setup -q -n %{pypi_name}-%{version}
sed -i 's/\r//' LICENSE
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# We handle requirements ourselves, remove requirements.txt
rm -rf requirements.txt test-requirements.txt
%build
%{__python2} setup.py build
%install
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
%check
%{__python2} setup.py test
%files
%doc README.rst LICENSE AUTHORS ChangeLog
%{python2_sitelib}/*.egg-info
%{python2_sitelib}/%{pypi_name}
%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue Feb 25 2014 Kashyap Chamarthy <kashyapc@fedoraproject.org> - 0.3.0-3
- Add Python2 macros for EPEL
* Tue Feb 25 2014 Kashyap Chamarthy <kashyapc@fedoraproject.org> - 0.3.0-2
- Use %{__python2} macros instead of %{__python} (this is deprecated)
* Mon Feb 24 2014 Kashyap Chamarthy <kashyapc@fedoraproject.org> - 0.3.0-1
- Initial package