From 859b4d6de0822a96c2e79ceddd3973e7fc704162 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mar 21 2016 14:57:27 +0000 Subject: python3: provide new subpackage As we now have python3-PyGreSQL - for consistency reasons - PyGreSQL package now provides python2-PyGreSQL. We could later rename the package to 'python-PyGreSQL'. Version: 5.0-1 Related: #1310282 --- diff --git a/PyGreSQL.spec b/PyGreSQL.spec index 0299975..5c85348 100644 --- a/PyGreSQL.spec +++ b/PyGreSQL.spec @@ -1,7 +1,10 @@ -Name: PyGreSQL +%global sum A Python client library for PostgreSQL +%global srcname PyGreSQL + +Name: %{srcname} Version: 5.0 Release: 1%{?dist} -Summary: A Python client library for PostgreSQL +Summary: %{sum} Group: Applications/Databases URL: http://www.pygresql.org/ @@ -19,10 +22,12 @@ Source0: http://www.pygresql.org/files/PyGreSQL-%{version}.tar.gz # intention of changing the version numbers in future. Provides: postgresql-python = 8.5.0-1 Obsoletes: postgresql-python < 8.5 +Provides: python2-%{name} = %{version}-%{release} +Provides: python2-%{name}%{?_isa} = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildRequires: postgresql-devel python-devel +BuildRequires: postgresql-devel python2-devel python3-devel %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} @@ -31,19 +36,28 @@ PostgreSQL is an advanced Object-Relational database management system. The PyGreSQL package provides a module for developers to use when writing Python code for accessing a PostgreSQL database. + +%package -n python3-%{srcname} +Summary: %{sum} + +%description -n python3-%{srcname} + + %prep -%setup -q +%autosetup -n %{srcname}-%{version} # PyGreSQL releases have execute bits on all files find -type f -exec chmod 644 {} + %build -CFLAGS="%{optflags}" %{__python} setup.py build +%py2_build +%py3_build %install rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%py2_install +%py3_install %clean rm -rf $RPM_BUILD_ROOT @@ -52,15 +66,26 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %license docs/copyright.rst %doc docs/*.rst -%{python_sitearch}/*.so -%{python_sitearch}/*.py -%{python_sitearch}/*.pyc -%{python_sitearch}/*.pyo -%{python_sitearch}/*.egg-info +%{python2_sitearch}/*.so +%{python2_sitearch}/*.py +%{python2_sitearch}/*.pyc +%{python2_sitearch}/*.pyo +%{python2_sitearch}/*.egg-info + + +%files -n python3-%{srcname} +%license docs/copyright.rst +%doc docs/*.rst +%{python3_sitearch}/*.so +%{python3_sitearch}/*.py +%{python3_sitearch}/__pycache__/*.py{c,o} +%{python3_sitearch}/*.egg-info + %changelog * Mon Mar 21 2016 Pavel Raiskup - 5.0-1 - rebase to 5.0 +- provide python2-PyGreSQL and add python3-PyGreSQL * Wed Feb 03 2016 Fedora Release Engineering - 4.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild