]>
Commit | Line | Data |
---|---|---|
fa6eecba | 1 | # |
2 | # todo: | |
fa6eecba | 3 | # - lib64 patch |
df9bb384 | 4 | |
1ce53046 JK |
5 | # Conditional build: |
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
f93a45b9 | 8 | |
1ce53046 | 9 | %define module psycopg2 |
3bacd1f7 | 10 | Summary: psycopg is a PostgreSQL database adapter for Python |
f4a85503 | 11 | Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL |
3bacd1f7 | 12 | Name: python-%{module} |
1ce53046 | 13 | Version: 2.5 |
943dc275 | 14 | Release: 1 |
258ebeda | 15 | License: GPL |
4b5b5919 | 16 | Group: Libraries/Python |
1ce53046 JK |
17 | Source0: http://initd.org/psycopg/tarballs/PSYCOPG-2-5/%{module}-%{version}.tar.gz |
18 | # Source0-md5: facd82faa067e99b80146a0ee2f842f6 | |
fa6eecba | 19 | #Patch0: %{name}-lib64.patch |
258ebeda | 20 | URL: http://www.initd.org/software/psycopg/ |
dd6f8fe2 | 21 | BuildRequires: autoconf |
258ebeda | 22 | BuildRequires: postgresql-backend-devel |
c72332e3 | 23 | BuildRequires: postgresql-devel |
1ce53046 JK |
24 | %if %{with python2} |
25 | BuildRequires: python-devel >= 2.5 | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-devel >= 2.5 | |
29 | %endif | |
399bddde | 30 | BuildRequires: rpm-pythonprov |
258ebeda | 31 | Requires: postgresql-libs |
1ce53046 | 32 | %if %{with python2} |
89ddf330 | 33 | Requires: python-modules |
07c88ab6 | 34 | %if "%{pld_release}" == "ac" |
54964aba | 35 | BuildRequires: python-mx-DateTime-devel |
36 | Requires: python-mx-DateTime | |
07c88ab6 | 37 | %else |
4093edd6 | 38 | # if somebody really needs mx.DateTime, then one can request mx.Datetime |
39 | # usage on runtime; | |
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 | |
0e0021ce | 44 | # Sure, but make mx-DateTime conditional build work |
07c88ab6 | 45 | BuildConflicts: python-egenix-mx-base |
46 | %endif | |
0e0021ce | 47 | Requires: python-pytz |
1ce53046 JK |
48 | %endif |
49 | %if %{with python3} | |
50 | Requires: python3-modules | |
51 | Requires: python3-pytz | |
52 | %endif | |
3bacd1f7 | 53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
3bacd1f7 MK |
54 | |
55 | %description | |
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. | |
61 | ||
3a08e339 | 62 | %description -l pl.UTF-8 |
3bacd1f7 | 63 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych |
3a08e339 JR |
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 | |
3bacd1f7 MK |
67 | 'thread safe' na poziomie 2. |
68 | ||
1ce53046 JK |
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 | |
73 | ||
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. | |
80 | ||
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. | |
87 | ||
88 | ||
3bacd1f7 | 89 | %prep |
ad85baa5 | 90 | %setup -q -n %{module}-%{version} |
fa6eecba | 91 | #%if "%{_lib}" == "lib64" |
92 | #%patch0 -p1 | |
93 | #%endif | |
3bacd1f7 MK |
94 | |
95 | %build | |
1ce53046 JK |
96 | %if %{with python2} |
97 | %{__python} setup.py build | |
98 | %endif | |
99 | %if %{with python3} | |
100 | %{__python3} setup.py build | |
101 | %endif | |
3bacd1f7 MK |
102 | |
103 | %install | |
104 | rm -rf $RPM_BUILD_ROOT | |
3bacd1f7 | 105 | |
1ce53046 JK |
106 | %if %{with python2} |
107 | %{__python} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT | |
fa6eecba | 108 | |
921d82ea MK |
109 | # find $RPM_BUILD_ROOT%{py_libdir} -type f -name "*.py" | xargs rm |
110 | %py_postclean | |
1ce53046 JK |
111 | %endif |
112 | %if %{with python3} | |
113 | %{__python3} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT | |
114 | %endif | |
fa6eecba | 115 | |
3bacd1f7 MK |
116 | %clean |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
1ce53046 | 119 | %if %{with python2} |
3bacd1f7 MK |
120 | %files |
121 | %defattr(644,root,root,755) | |
1ce53046 | 122 | %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS |
fa6eecba | 123 | %dir %{py_sitedir}/%{module} |
124 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
125 | %{py_sitedir}/%{module}/*.py[co] | |
432cab47 | 126 | %if "%{pld_release}" != "ac" |
f53e9079 | 127 | %{py_sitedir}/*.egg-info |
df9bb384 | 128 | %endif |
1ce53046 JK |
129 | %{py_sitedir}/%{module}/tests |
130 | %endif | |
131 | ||
132 | %if %{with python3} | |
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 | |
143 | %endif |