%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 pg8000
Name: python-%{pypi}
Version: 1.10.3
Release: 4%{?dist}
Summary: Pure Python PostgreSQL Driver
License: BSD
URL: http://pythonhosted.org/pg8000/
Source0: https://github.com/mfenniak/%{pypi}/archive/%{version}.tar.gz
#https://github.com/mfenniak/pg8000/pull/101
Patch1: pg8000-remove-six.patch
BuildArch: noarch
%description
pg8000 is a pure-Python PostgreSQL driver that complies with DB-API 2.0.
The driver communicates with the database using the PostgreSQL Backend /
Frontend Protocol.
%package -n python2-%{pypi}
Summary: Pure Python2 PostgreSQL Driver
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-six
Requires: python-six
Provides: python-pg8000
%{?python_provide:%python_provide python2-%{pypi}}
%description -n python2-%{pypi}
pg8000 is a pure Python2 PostgreSQL driver that complies with DB-API 2.0.
The driver communicates with the database using the PostgreSQL Backend /
Frontend Protocol.
%prep
%setup -q -n %{pypi}-%{version}
%patch1
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
%install
%{__python2} setup.py install --skip-build --root %{buildroot}
%check
#Test requires a runing PostgreSQL instance
%files -n python2-%{pypi}
%license LICENSE
%doc README.creole
%{python2_sitelib}/*
%changelog
* Wed Feb 10 2016 William Moreno <williamjmorenor@gmail.com> - 1.10.3-4
- Adjust spect to epel6 packaging
* Wed Feb 10 2016 William Moreno <williamjmorenor at gmail.com> - 1.10.3-3
- Remove python3 subpackage in epel7
* Mon Feb 08 2016 William Moreno <williamjmorenor at gmail.com> - 1.10.3-2
- Remove bundled six library.
* Wed Feb 03 2016 William Moreno <williamjmorenor at gmail.com> - 1.10.3-1
- Initial Packaging