Blob Blame History Raw
%global pypi pg8000

Name:           python-%{pypi}
Version:        1.10.4
Release:        1%{?dist}
Summary:        Pure Python PostgreSQL Driver
License:        BSD
URL:            http://pythonhosted.org/pg8000/
Source0:        https://github.com/mfenniak/%{pypi}/archive/%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  dos2unix

%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-six
Requires:       python-six
Suggests:       python2-sqlalchemy
Suggests:       postgresql
Enhances:       %{name}-docs == %{version}-%{release}
%{?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.

%package -n python3-%{pypi}
Summary:        Pure Python3 PostgreSQL Driver
BuildRequires:  python3-devel
BuildRequires:  python3-six
Requires:       python3-six
Suggests:       python3-sqlalchemy
Suggests:       postgresql
Enhances:       %{name}-docs == %{version}-%{release}
%{?python_provide:%python_provide python3-%{pypi}}

%description -n python3-%{pypi}
pg8000 is a pure Python3 PostgreSQL driver that complies with DB-API 2.0. 
The driver communicates with the database using the PostgreSQL Backend / 
Frontend Protocol.

%package docs
Summary:        HTML documentation for %{name}
BuildRequires:  python-sphinx

%description docs
HTML documentation for pg8000, a pure Python2 and Python3 PostgreSQL 
driver that complies with DB-API 2.0.

%prep
%setup -q -n %{pypi}-%{version}
dos2unix doc/index.rst

%build
%py2_build
%py3_build

%{__python2} setup.py build_sphinx
rm -rf build/sphinx/html/.buildinfo
rm -rf build/sphinx/html/_static/__tmp__.txt

%install
%py2_install
%py3_install

%check
#Test requires a runing PostgreSQL instance

%files -n python2-%{pypi}
%license LICENSE
%doc README.creole
%{python2_sitelib}/*

%files -n python3-%{pypi}
%license LICENSE
%doc README.creole
%{python3_sitelib}/*

%files docs
%license LICENSE
%doc build/sphinx/html

%changelog
* Tue Mar 01 2016 William Moreno <williamjmorenor@gmail.com> - 1.10.4-1
- Upadete to 1.10.4
- Remove patch1 included in upstream release

* 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