5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module psycopg2
9 Summary: psycopg is a PostgreSQL database adapter for Python
10 Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: http://initd.org/psycopg/tarballs/PSYCOPG-2-5/%{module}-%{version}.tar.gz
17 # Source0-md5: 1b433f83d50d1bc61e09026e906d84c7
18 #Patch0: %{name}-lib64.patch
19 URL: http://www.initd.org/software/psycopg/
20 BuildRequires: autoconf
21 BuildRequires: postgresql-backend-devel
22 BuildRequires: postgresql-devel
23 %{?with_python2:BuildRequires: python-devel >= 2.5}
24 %{?with_python3:BuildRequires: python3-devel}
25 BuildRequires: rpm-pythonprov
26 Requires: postgresql-libs
27 Requires: python-modules
29 %if "%{pld_release}" == "ac"
30 BuildRequires: python-mx-DateTime-devel
31 Requires: python-mx-DateTime
33 # if somebody really needs mx.DateTime, then one can request mx.Datetime
35 # it is pointless to use 'Requires' or 'Suggest' field because
36 # - python provides its own datetime implementation
37 # - one can request it on runtime (as said above)
38 # - usage of mx.DateTime type is application specific
39 # Sure, but make mx-DateTime conditional build work
40 BuildConflicts: python-egenix-mx-base
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 psycopg is a PostgreSQL database adapter for the Python programming
46 language (just like pygresql and popy.) It was written from scratch
47 with the aim of being very small and fast, and stable as a rock. The
48 main advantages of psycopg are that it supports the full Python
49 DBAPI-2.0 and being thread safe at level 2.
51 %description -l pl.UTF-8
52 psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych
53 PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku z
54 założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą
55 psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest
56 'thread safe' na poziomie 2.
58 %package -n python3-%{module}
59 Summary: psycopg is a PostgreSQL database adapter for Python
60 Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL
61 Group: Libraries/Python
62 Requires: python3-modules
63 Requires: python3-pytz
65 %description -n python3-%{module}
66 psycopg is a PostgreSQL database adapter for the Python programming
67 language (just like pygresql and popy.) It was written from scratch
68 with the aim of being very small and fast, and stable as a rock. The
69 main advantages of psycopg are that it supports the full Python
70 DBAPI-2.0 and being thread safe at level 2.
72 %description -n python3-%{module} -l pl.UTF-8
73 psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych
74 PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku z
75 założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą
76 psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest
77 'thread safe' na poziomie 2.
80 %setup -q -n %{module}-%{version}
81 #%if "%{_lib}" == "lib64"
87 %{__python} setup.py build
90 %{__python3} setup.py build
94 rm -rf $RPM_BUILD_ROOT
96 %{__python} setup.py install \
98 --root=$RPM_BUILD_ROOT
103 %{__python3} setup.py install \
105 --root=$RPM_BUILD_ROOT
109 rm -rf $RPM_BUILD_ROOT
113 %defattr(644,root,root,755)
114 %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS
115 %dir %{py_sitedir}/%{module}
116 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
117 %{py_sitedir}/%{module}/*.py[co]
118 %if "%{pld_release}" != "ac"
119 %{py_sitedir}/*.egg-info
121 %{py_sitedir}/%{module}/tests
125 %files -n python3-%{module}
126 %defattr(644,root,root,755)
127 %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS
128 %dir %{py3_sitedir}/%{module}
129 %dir %{py3_sitedir}/%{module}/__pycache__
130 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
131 %{py3_sitedir}/%{module}/*.py
132 %{py3_sitedir}/%{module}/__pycache__/*.py*
133 %{py3_sitedir}/*.egg-info
134 %{py3_sitedir}/%{module}/tests