zbyszek / rpms / PyGreSQL

Forked from rpms/PyGreSQL 6 years ago
Clone
859b4d6
%global sum		A Python client library for PostgreSQL
859b4d6
%global srcname	PyGreSQL
859b4d6
859b4d6
Name:		%{srcname}
f85e72e
Version:	5.0
f85e72e
Release:	1%{?dist}
859b4d6
Summary:	%{sum}
a5898f6
a5898f6
Group:		Applications/Databases
a5898f6
URL:		http://www.pygresql.org/
a5898f6
# Author states his intention is to dual license under PostgreSQL or Python
a5898f6
# licenses --- this is not too clear from the current tarball documentation,
a5898f6
# but hopefully will be clearer in future releases.
Tom Lane c145e99
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
Tom Lane c145e99
# recognizes it as an independent license, so we do as well.
Tom Lane c145e99
License:	PostgreSQL or Python
a5898f6
f85e72e
Source0:	http://www.pygresql.org/files/PyGreSQL-%{version}.tar.gz
a5898f6
a5898f6
# PyGreSQL was originally shipped as a sub-RPM of the PostgreSQL package;
Tom Lane c145e99
# these Provides/Obsoletes give a migration path.  Note there is no
Tom Lane c145e99
# intention of changing the version numbers in future.
a5898f6
Provides:	postgresql-python = 8.5.0-1
a5898f6
Obsoletes:	postgresql-python < 8.5
859b4d6
Provides:	python2-%{name} = %{version}-%{release}
859b4d6
Provides:	python2-%{name}%{?_isa} = %{version}-%{release}
a5898f6
859b4d6
BuildRequires:	postgresql-devel python2-devel python3-devel
a5898f6
e99faa2
# For testsuite
e99faa2
BuildRequires:	postgresql-server
e99faa2
b429467
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
a5898f6
a5898f6
%description
a5898f6
PostgreSQL is an advanced Object-Relational database management system.
a5898f6
The PyGreSQL package provides a module for developers to use when writing
a5898f6
Python code for accessing a PostgreSQL database.
a5898f6
859b4d6
859b4d6
%package -n python3-%{srcname}
859b4d6
Summary:	%{sum}
859b4d6
859b4d6
%description -n python3-%{srcname}
859b4d6
859b4d6
a5898f6
%prep
859b4d6
%autosetup -n %{srcname}-%{version}
a5898f6
559275e
# PyGreSQL releases have execute bits on all files
559275e
find -type f -exec chmod 644 {} +
a5898f6
238846c
a5898f6
%build
859b4d6
%py2_build
859b4d6
%py3_build
a5898f6
a5898f6
238846c
%install
859b4d6
%py2_install
859b4d6
%py3_install
a5898f6
238846c
a5898f6
%clean
238846c
a5898f6
a5898f6
%files
559275e
%license docs/copyright.rst
559275e
%doc docs/*.rst
859b4d6
%{python2_sitearch}/*.so
859b4d6
%{python2_sitearch}/*.py
859b4d6
%{python2_sitearch}/*.pyc
859b4d6
%{python2_sitearch}/*.pyo
859b4d6
%{python2_sitearch}/*.egg-info
859b4d6
859b4d6
859b4d6
%files -n python3-%{srcname}
859b4d6
%license docs/copyright.rst
859b4d6
%doc docs/*.rst
859b4d6
%{python3_sitearch}/*.so
859b4d6
%{python3_sitearch}/*.py
859b4d6
%{python3_sitearch}/__pycache__/*.py{c,o}
859b4d6
%{python3_sitearch}/*.egg-info
859b4d6
a5898f6
e99faa2
%check
e99faa2
pgdatadir=datadir
e99faa2
pghost=/tmp
e99faa2
pgport=54321
e99faa2
pgdb=unittest
e99faa2
e99faa2
pg_start ()
e99faa2
{
e99faa2
	initdb "$pgdatadir" -U $(id -u -n) \
e99faa2
		--auth-local=peer --auth-host=ident
e99faa2
	pg_ctl -D "$pgdatadir" -l logfile start -o "-k $pghost -p $pgport" -w
e99faa2
}
e99faa2
e99faa2
pg_stop ()
e99faa2
{
e99faa2
	pg_ctl -D "$pgdatadir" stop
e99faa2
}
e99faa2
e99faa2
pg_createdb ()
e99faa2
{
e99faa2
	createdb -h $pghost -p $pgport "$@"
e99faa2
}
e99faa2
e99faa2
pg_start
e99faa2
pg_createdb "$pgdb"
e99faa2
trap pg_stop EXIT
e99faa2
e99faa2
cat > LOCAL_PyGreSQL.py <
e99faa2
dbname = '$pgdb'
e99faa2
dbhost = '$pghost'
e99faa2
dbport = $pgport
e99faa2
EOF
e99faa2
e99faa2
%{__python2} setup.py test
e99faa2
%{__python3} setup.py test
e99faa2
e99faa2
a5898f6
%changelog
f85e72e
* Mon Mar 21 2016 Pavel Raiskup <praiskup@redhat.com> - 5.0-1
f85e72e
- rebase to 5.0
859b4d6
- provide python2-PyGreSQL and add python3-PyGreSQL
e99faa2
- enable testsuite
238846c
- cleanup obsoleted spec statements
f85e72e
0166e63
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.2-2
0166e63
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
0166e63
559275e
* Tue Jan 26 2016 Pavel Raiskup <praiskup@redhat.com> - 4.2-1
559275e
- rebase (per rhbz#1301241)
559275e
29ed3e1
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.1-4
29ed3e1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
29ed3e1
58a181f
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.1-3
58a181f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
58a181f
771d8e3
* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.1-2
771d8e3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
771d8e3
Jozef Mlich c1d1d40
* Wed Mar 12 2014 Jozef Mlich <jmlich@redhat.com> - 4.1.1-1
Jozef Mlich c1d1d40
- Rebase to 4.1.1.
Jozef Mlich c1d1d40
  See changelog http://www.pygresql.org/changelog.html
Jozef Mlich c1d1d40
  Resolves: #1071940
Jozef Mlich c1d1d40
81a48b5
* Fri Aug 02 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-8
81a48b5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
81a48b5
8ca4177
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-7
8ca4177
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
8ca4177
Tom Lane 8c02676
* Sat Nov 17 2012 Tom Lane <tgl@redhat.com> 4.0-6
Tom Lane 8c02676
- Update tarball URL in specfile (no actual package change)
Tom Lane 8c02676
3836a2f
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-5
3836a2f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3836a2f
2e5beb3
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-4
2e5beb3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2e5beb3
Tom Lane 5856a81
* Thu Jul  7 2011 Tom Lane <tgl@redhat.com> 4.0-3
Tom Lane 5856a81
- Add upstream patch for set_decimal bug
Tom Lane 5856a81
Resolves: #719093
Tom Lane 5856a81
ca0bca6
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-2
ca0bca6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
ca0bca6
Tom Lane c145e99
* Wed Dec 29 2010 Tom Lane <tgl@redhat.com> 4.0-1
Tom Lane c145e99
- Update to PyGreSQL 4.0
Tom Lane c145e99
- Relabel license as PostgreSQL now that that's separately recognized by OSI.
Tom Lane c145e99
2585f3d
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 3.8.1-3
2585f3d
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
2585f3d
a5898f6
* Tue Nov 24 2009 Tom Lane <tgl@redhat.com> 3.8.1-2
a5898f6
- Fix License tag and permissions on example scripts under tutorial/,
a5898f6
  per discussion in package review request.
a5898f6
Related: #452321
a5898f6
a5898f6
* Fri Jun 20 2008 Tom Lane <tgl@redhat.com> 3.8.1-1
a5898f6
- Created package by stripping down postgresql specfile and adjusting
a5898f6
  to meet current packaging guidelines for python modules.