Compare commits
No commits in common. "e933066b7e603963cc8dc6779359fe1da1234202" and "0f5d7c68d8355b339b1a86d80111676e0311cbd6" have entirely different histories.
e933066b7e
...
0f5d7c68d8
BIN
2_8_6.tar.gz
BIN
2_8_6.tar.gz
Binary file not shown.
BIN
psycopg2-2.7.5.tar.gz
Normal file
BIN
psycopg2-2.7.5.tar.gz
Normal file
Binary file not shown.
@ -1,45 +1,68 @@
|
|||||||
%global selfcheck 0
|
Name: python-psycopg2
|
||||||
%define release_version %(echo %{version} | awk -F. '{print $1"_"$2"_"$3}')
|
Version: 2.7.5
|
||||||
|
Release: 3.2
|
||||||
|
Summary: PostgreSQL database adapter for the Python programming language
|
||||||
|
License: LGPLv3+ with exceptions
|
||||||
|
URL: http://www.psycopg.org/psycopg/
|
||||||
|
Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-%{version}.tar.gz
|
||||||
|
|
||||||
|
%bcond_without python2
|
||||||
%bcond_without python3
|
%bcond_without python3
|
||||||
%bcond_without python3_debug
|
%bcond_without check
|
||||||
%if 0%{?selfcheck}
|
|
||||||
%bcond_without tests
|
|
||||||
%else
|
|
||||||
%bcond_with tests
|
|
||||||
%endif
|
|
||||||
Name: python-psycopg2
|
|
||||||
Version: 2.8.6
|
|
||||||
Release: 2
|
|
||||||
Summary: PostgreSQL database adapter for the Python programming language
|
|
||||||
License: GPL-3.0-only and LGPL-3.0-only
|
|
||||||
URL: http://www.psycopg.org/psycopg/
|
|
||||||
Source0: https://github.com/psycopg/psycopg2/archive/%{release_version}.tar.gz
|
|
||||||
|
|
||||||
%global desc Psycopg is the most popular PostgreSQL adapter for the Python \
|
%global desc Psycopg is the most popular PostgreSQL adapter for the Python \
|
||||||
programming language. Its core is a complete implementation of the Python DB \
|
programming language. Its core is a complete implementation of the Python DB \
|
||||||
API 2.0 specifications. Several extensions allow access to many of the \
|
API 2.0 specifications. Several extensions allow access to many of the \
|
||||||
features offered by PostgreSQL.
|
features offered by PostgreSQL.
|
||||||
|
|
||||||
%global python_runtimes %{?with_python3:python3 python3-debug}
|
%global python_runtimes %{?with_python2:python2 python2-debug} \\\
|
||||||
|
%{?with_python3:python3 python3-debug}
|
||||||
|
|
||||||
%{!?with_python2:%{!?with_python3:%{error:one python version eneeded}}}
|
%{!?with_python2:%{!?with_python3:%{error:one python version eneeded}}}
|
||||||
|
|
||||||
BuildRequires: gcc,postgresql-devel
|
BuildRequires: gcc,pkgconfig(libpq)
|
||||||
|
|
||||||
%{?with_python3:BuildRequires: python3-debug python3-devel}
|
%{?with_python2:BuildRequires: python2-debug python2-devel}
|
||||||
|
%{?with_python3:BuildRequires: python3-debug python3-devel}
|
||||||
|
|
||||||
%if %{with tests}
|
%if %{with check}
|
||||||
BuildRequires: postgresql-test-rpm-macros
|
BuildRequires: postgresql-test-rpm-macros
|
||||||
%endif
|
%endif
|
||||||
Conflicts: python-psycopg2-zope < %{version}
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%{desc}
|
%{desc}
|
||||||
|
|
||||||
|
|
||||||
|
%package -n python2-psycopg2
|
||||||
|
%{?python_provide:%python_provide python2-psycopg2}
|
||||||
|
Summary: %{summary}
|
||||||
|
|
||||||
|
%description -n python2-psycopg2
|
||||||
|
%{desc}
|
||||||
|
|
||||||
|
|
||||||
|
%package -n python2-psycopg2-tests
|
||||||
|
Summary: A testsuite for %{summary}
|
||||||
|
Requires: python2-psycopg2 = %version-%release
|
||||||
|
|
||||||
|
%description -n python2-psycopg2-tests
|
||||||
|
%desc
|
||||||
|
This sub-package delivers set of tests for the adapter.
|
||||||
|
|
||||||
|
|
||||||
|
%package -n python2-psycopg2-debug
|
||||||
|
Summary: A PostgreSQL database adapter for Python 2 (debug build)
|
||||||
|
# Require the base package, as we're sharing .py/.pyc files:
|
||||||
|
Requires: %{name} = %{version}-%{release}
|
||||||
|
%{?python_provide:%python_provide python2-psycopg2-debug}
|
||||||
|
|
||||||
|
%description -n python2-psycopg2-debug
|
||||||
|
This is a build of the psycopg PostgreSQL database adapter for the debug
|
||||||
|
build of Python 2.
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%package -n python3-psycopg2
|
%package -n python3-psycopg2
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
%{?python_provide:%python_provide python3-psycopg2}
|
%{?python_provide:%python_provide python3-psycopg2}
|
||||||
|
|
||||||
%description -n python3-psycopg2
|
%description -n python3-psycopg2
|
||||||
@ -47,25 +70,29 @@ Summary: %{summary}
|
|||||||
|
|
||||||
|
|
||||||
%package -n python3-psycopg2-tests
|
%package -n python3-psycopg2-tests
|
||||||
Summary: A testsuite for %{summary}
|
Summary: A testsuite for %{summary}
|
||||||
Requires: python3-psycopg2 = %version-%release
|
Requires: python3-psycopg2 = %version-%release
|
||||||
|
|
||||||
%description -n python3-psycopg2-tests
|
%description -n python3-psycopg2-tests
|
||||||
%desc
|
%desc
|
||||||
This sub-package delivers set of tests for the adapter.
|
This sub-package delivers set of tests for the adapter.
|
||||||
|
|
||||||
%package -n python3-psycopg2-debug
|
%package -n python3-psycopg2-debug
|
||||||
Summary: A PostgreSQL database adapter for Python 3 (debug build)
|
Summary: A PostgreSQL database adapter for Python 3 (debug build)
|
||||||
Requires: python3-psycopg2 = %{version}-%{release}
|
# Require base python 3 package, as we're sharing .py/.pyc files:
|
||||||
|
Requires: python3-psycopg2 = %{version}-%{release}
|
||||||
|
|
||||||
%description -n python3-psycopg2-debug
|
%description -n python3-psycopg2-debug
|
||||||
This is a build of the psycopg PostgreSQL database adapter for the debug
|
This is a build of the psycopg PostgreSQL database adapter for the debug
|
||||||
build of Python 3.
|
build of Python 3.
|
||||||
|
%endif # python3
|
||||||
|
|
||||||
|
|
||||||
%package doc
|
%package doc
|
||||||
Summary: Documentation for psycopg python PostgreSQL database adapter
|
Summary: Documentation for psycopg python PostgreSQL database adapter
|
||||||
Requires: %{name} = %{version}-%{release}
|
Group: Documentation
|
||||||
|
Requires: %{name} = %{version}-%{release}
|
||||||
|
%{?with_python2:Provides: python2-psycopg2-doc = %{version}-%{release}}
|
||||||
%{?with_python3:Provides: python3-psycopg2-doc = %{version}-%{release}}
|
%{?with_python3:Provides: python3-psycopg2-doc = %{version}-%{release}}
|
||||||
|
|
||||||
%description doc
|
%description doc
|
||||||
@ -73,51 +100,79 @@ Documentation and example files for the psycopg python PostgreSQL
|
|||||||
database adapter.
|
database adapter.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n psycopg2-%{release_version}
|
%autosetup -p1 -n psycopg2-%{version}
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS=${RPM_OPT_FLAGS} LDFLAGS=${RPM_LD_FLAGS}
|
|
||||||
for python in %{python_runtimes} ; do
|
for python in %{python_runtimes} ; do
|
||||||
$python setup.py build
|
$python setup.py build
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Fix for wrong-file-end-of-line-encoding problem; upstream also must fix this.
|
||||||
for i in `find doc -iname "*.html"`; do sed -i 's/\r//' $i; done
|
for i in `find doc -iname "*.html"`; do sed -i 's/\r//' $i; done
|
||||||
for i in `find doc -iname "*.css"`; do sed -i 's/\r//' $i; done
|
for i in `find doc -iname "*.css"`; do sed -i 's/\r//' $i; done
|
||||||
|
|
||||||
|
# Get rid of a "hidden" file that rpmlint complains about
|
||||||
rm -f doc/html/.buildinfo
|
rm -f doc/html/.buildinfo
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if %{with tests}
|
%if %{with check}
|
||||||
export PGTESTS_LOCALE=C.UTF-8
|
export PGTESTS_LOCALE=C.UTF-8
|
||||||
%postgresql_tests_run
|
%postgresql_tests_run
|
||||||
|
|
||||||
export PSYCOPG2_TESTDB=${PGTESTS_DATABASES##*:}
|
export PSYCOPG2_TESTDB=${PGTESTS_DATABASES##*:}
|
||||||
export PSYCOPG2_TESTDB_HOST=$PGHOST
|
export PSYCOPG2_TESTDB_HOST=$PGHOST
|
||||||
export PSYCOPG2_TESTDB_PORT=$PGPORT
|
export PSYCOPG2_TESTDB_PORT=$PGPORT
|
||||||
cmd="import tests; tests.unittest.main(defaultTest='tests.test_suite')"
|
|
||||||
|
|
||||||
PYTHONPATH=%buildroot%python3_sitearch %__python3 -c "$cmd" --verbose
|
cmd="from psycopg2 import tests; tests.unittest.main(defaultTest='tests.test_suite')"
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
|
PYTHONPATH=%buildroot%python2_sitearch %__python2 -c "$cmd" --verbose
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
|
PYTHONPATH=%buildroot%python3_sitearch %__python3 -c "$cmd" --verbose
|
||||||
|
%endif
|
||||||
|
%endif # check
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export CFLAGS=${RPM_OPT_FLAGS} LDFLAGS=${RPM_LD_FLAGS}
|
|
||||||
for python in %{python_runtimes} ; do
|
for python in %{python_runtimes} ; do
|
||||||
$python setup.py install --no-compile --root %{buildroot}
|
$python setup.py install --no-compile --root %{buildroot}
|
||||||
done
|
done
|
||||||
|
|
||||||
cp -r tests/ %{buildroot}%{python3_sitearch}/psycopg2/tests/
|
# This test is skipped on 3.7 and has a syntax error so brp-python-bytecompile would choke on it
|
||||||
for i in `find %{buildroot}%{python3_sitearch}/psycopg2/tests/ -iname "*.py"`; do
|
|
||||||
sed -i 's|#!/usr/bin/env python|#!/usr/bin/python3|' $i
|
|
||||||
done
|
|
||||||
%{?with_python3:rm -r %{buildroot}%{python3_sitearch}/psycopg2/tests/test_async_keyword.py}
|
%{?with_python3:rm -r %{buildroot}%{python3_sitearch}/psycopg2/tests/test_async_keyword.py}
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
|
%files -n python2-psycopg2
|
||||||
|
%license LICENSE
|
||||||
|
%doc AUTHORS NEWS README.rst
|
||||||
|
%dir %{python2_sitearch}/psycopg2
|
||||||
|
%{python2_sitearch}/psycopg2/*.py
|
||||||
|
%{python2_sitearch}/psycopg2/*.pyc
|
||||||
|
%{python2_sitearch}/psycopg2/_psycopg.so
|
||||||
|
%{python2_sitearch}/psycopg2/*.pyo
|
||||||
|
%{python2_sitearch}/psycopg2-%{version}-py2*.egg-info
|
||||||
|
|
||||||
|
|
||||||
|
%files -n python2-psycopg2-tests
|
||||||
|
%{python2_sitearch}/psycopg2/tests
|
||||||
|
|
||||||
|
|
||||||
|
%files -n python2-psycopg2-debug
|
||||||
|
%license LICENSE
|
||||||
|
%{python2_sitearch}/psycopg2/_psycopg_d.so
|
||||||
|
%endif # python2
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%files -n python3-psycopg2
|
%files -n python3-psycopg2
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc AUTHORS NEWS README.rst
|
%doc AUTHORS NEWS README.rst
|
||||||
%dir %{python3_sitearch}/psycopg2
|
%dir %{python3_sitearch}/psycopg2
|
||||||
%{python3_sitearch}/psycopg2/*.py
|
%{python3_sitearch}/psycopg2/*.py
|
||||||
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?[!d]*.so
|
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?m*.so
|
||||||
%dir %{python3_sitearch}/psycopg2/__pycache__
|
%dir %{python3_sitearch}/psycopg2/__pycache__
|
||||||
%{python3_sitearch}/psycopg2/__pycache__/*.py{c,o}
|
%{python3_sitearch}/psycopg2/__pycache__/*.py{c,o}
|
||||||
%{python3_sitearch}/psycopg2-%{version}-py3*.egg-info
|
%{python3_sitearch}/psycopg2-%{version}-py3*.egg-info
|
||||||
@ -126,30 +181,18 @@ done
|
|||||||
%files -n python3-psycopg2-tests
|
%files -n python3-psycopg2-tests
|
||||||
%{python3_sitearch}/psycopg2/tests
|
%{python3_sitearch}/psycopg2/tests
|
||||||
|
|
||||||
|
|
||||||
%files -n python3-psycopg2-debug
|
%files -n python3-psycopg2-debug
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?d*.so
|
%{python3_sitearch}/psycopg2/_psycopg.cpython-3?dm*.so
|
||||||
|
%endif # python3
|
||||||
|
|
||||||
|
|
||||||
%files doc
|
%files doc
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc doc
|
%doc doc examples/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Nov 22 2022 Ge Wang <wangge20@h-partners.com> - 2.8.6-2
|
|
||||||
- bring source file into correspondence with described in spec file
|
|
||||||
|
|
||||||
* Wed Jul 28 2021 liksh <liks11@chinaunicom.cn> -2.8.6-1
|
|
||||||
- update to 2.8.6
|
|
||||||
|
|
||||||
* Mon Jul 26 2021 zhouwenpei <zhouwenpei1@huawei.com> - 2.8.4-3
|
|
||||||
- modify build require and fix licenses failed
|
|
||||||
|
|
||||||
* Thu Oct 29 2020 xinghe <xinghe1@huawei.com> - 2.8.4-2
|
|
||||||
- remove python2 dependency
|
|
||||||
|
|
||||||
* Sat Jun 20 2020 Jeffery.Gao <gaojianxing@huawei.com> - 2.8.4-1
|
|
||||||
- Upgrade package & fixed build as root errors
|
|
||||||
|
|
||||||
* Tue Mar 10 2020 chenli <chenli147@huawei.com> - 2.7.5-3.2
|
* Tue Mar 10 2020 chenli <chenli147@huawei.com> - 2.7.5-3.2
|
||||||
- Fix python2-psycopg2-tests install error
|
- Fix python2-psycopg2-tests install error
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user