6 %bcond_without python2 # CPython 2.x module
7 %bcond_without python3 # CPython 3.x module
9 %define module psycopg2
10 Summary: psycopg is a PostgreSQL database adapter for Python
11 Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL
12 Name: python-%{module}
16 Group: Libraries/Python
17 Source0: http://initd.org/psycopg/tarballs/PSYCOPG-2-5/%{module}-%{version}.tar.gz
18 # Source0-md5: facd82faa067e99b80146a0ee2f842f6
19 #Patch0: %{name}-lib64.patch
20 URL: http://www.initd.org/software/psycopg/
21 BuildRequires: autoconf
22 BuildRequires: postgresql-backend-devel
23 BuildRequires: postgresql-devel
25 BuildRequires: python-devel >= 2.5
28 BuildRequires: python3-devel >= 2.5
30 BuildRequires: rpm-pythonprov
31 Requires: postgresql-libs
33 Requires: python-modules
34 %if "%{pld_release}" == "ac"
35 BuildRequires: python-mx-DateTime-devel
36 Requires: python-mx-DateTime
38 # if somebody really needs mx.DateTime, then one can request mx.Datetime
40 # it is pointless to use 'Requires' or 'Suggest' field because
41 # - python provides its own datetime implementation
42 # - one can request it on runtime (as said above)
43 # - usage of mx.DateTime type is application specific
44 # Sure, but make mx-DateTime conditional build work
45 BuildConflicts: python-egenix-mx-base
50 Requires: python3-modules
51 Requires: python3-pytz
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 psycopg is a PostgreSQL database adapter for the Python programming
57 language (just like pygresql and popy.) It was written from scratch
58 with the aim of being very small and fast, and stable as a rock. The
59 main advantages of psycopg are that it supports the full Python
60 DBAPI-2.0 and being thread safe at level 2.
62 %description -l pl.UTF-8
63 psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych
64 PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku
65 z założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą
66 psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest
67 'thread safe' na poziomie 2.
69 %package -n python3-%{module}
70 Summary: psycopg is a PostgreSQL database adapter for Python
71 Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL
72 Group: Libraries/Python
74 %description -n python3-%{module}
75 psycopg is a PostgreSQL database adapter for the Python programming
76 language (just like pygresql and popy.) It was written from scratch
77 with the aim of being very small and fast, and stable as a rock. The
78 main advantages of psycopg are that it supports the full Python
79 DBAPI-2.0 and being thread safe at level 2.
81 %description -n python3-%{module} -l pl.UTF-8
82 psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych
83 PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku
84 z założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą
85 psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest
86 'thread safe' na poziomie 2.
90 %setup -q -n %{module}-%{version}
91 #%if "%{_lib}" == "lib64"
97 %{__python} setup.py build
100 %{__python3} setup.py build
104 rm -rf $RPM_BUILD_ROOT
107 %{__python} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT
109 # find $RPM_BUILD_ROOT%{py_libdir} -type f -name "*.py" | xargs rm
113 %{__python3} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT
117 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
122 %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS
123 %dir %{py_sitedir}/%{module}
124 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
125 %{py_sitedir}/%{module}/*.py[co]
126 %if "%{pld_release}" != "ac"
127 %{py_sitedir}/*.egg-info
129 %{py_sitedir}/%{module}/tests
133 %files -n python3-%{module}
134 %defattr(644,root,root,755)
135 %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS
136 %dir %{py3_sitedir}/%{module}
137 %dir %{py3_sitedir}/%{module}/__pycache__
138 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
139 %{py3_sitedir}/%{module}/*.py
140 %{py3_sitedir}/%{module}/__pycache__/*.py*
141 %{py3_sitedir}/*.egg-info
142 %{py3_sitedir}/%{module}/tests