]>
Commit | Line | Data |
---|---|---|
121405c1 | 1 | # TODO: |
fa6eecba | 2 | # - lib64 patch |
df9bb384 | 3 | |
1ce53046 JK |
4 | # Conditional build: |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
f93a45b9 | 7 | |
1ce53046 | 8 | %define module psycopg2 |
3bacd1f7 | 9 | Summary: psycopg is a PostgreSQL database adapter for Python |
f4a85503 | 10 | Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL |
3bacd1f7 | 11 | Name: python-%{module} |
121405c1 | 12 | Version: 2.5.1 |
943dc275 | 13 | Release: 1 |
258ebeda | 14 | License: GPL |
4b5b5919 | 15 | Group: Libraries/Python |
1ce53046 | 16 | Source0: http://initd.org/psycopg/tarballs/PSYCOPG-2-5/%{module}-%{version}.tar.gz |
121405c1 | 17 | # Source0-md5: 1b433f83d50d1bc61e09026e906d84c7 |
fa6eecba | 18 | #Patch0: %{name}-lib64.patch |
258ebeda | 19 | URL: http://www.initd.org/software/psycopg/ |
dd6f8fe2 | 20 | BuildRequires: autoconf |
258ebeda | 21 | BuildRequires: postgresql-backend-devel |
c72332e3 | 22 | BuildRequires: postgresql-devel |
1ce53046 JK |
23 | %if %{with python2} |
24 | BuildRequires: python-devel >= 2.5 | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel >= 2.5 | |
28 | %endif | |
399bddde | 29 | BuildRequires: rpm-pythonprov |
258ebeda | 30 | Requires: postgresql-libs |
1ce53046 | 31 | %if %{with python2} |
89ddf330 | 32 | Requires: python-modules |
07c88ab6 | 33 | %if "%{pld_release}" == "ac" |
54964aba | 34 | BuildRequires: python-mx-DateTime-devel |
35 | Requires: python-mx-DateTime | |
07c88ab6 | 36 | %else |
4093edd6 | 37 | # if somebody really needs mx.DateTime, then one can request mx.Datetime |
38 | # usage on runtime; | |
39 | # it is pointless to use 'Requires' or 'Suggest' field because | |
40 | # - python provides its own datetime implementation | |
41 | # - one can request it on runtime (as said above) | |
42 | # - usage of mx.DateTime type is application specific | |
0e0021ce | 43 | # Sure, but make mx-DateTime conditional build work |
07c88ab6 | 44 | BuildConflicts: python-egenix-mx-base |
45 | %endif | |
0e0021ce | 46 | Requires: python-pytz |
1ce53046 | 47 | %endif |
3bacd1f7 | 48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
3bacd1f7 MK |
49 | |
50 | %description | |
51 | psycopg is a PostgreSQL database adapter for the Python programming | |
52 | language (just like pygresql and popy.) It was written from scratch | |
53 | with the aim of being very small and fast, and stable as a rock. The | |
54 | main advantages of psycopg are that it supports the full Python | |
55 | DBAPI-2.0 and being thread safe at level 2. | |
56 | ||
3a08e339 | 57 | %description -l pl.UTF-8 |
3bacd1f7 | 58 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych |
3a08e339 JR |
59 | PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku |
60 | z założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą | |
61 | psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest | |
3bacd1f7 MK |
62 | 'thread safe' na poziomie 2. |
63 | ||
121405c1 MK |
64 | |
65 | %if %{with python3} | |
1ce53046 JK |
66 | %package -n python3-%{module} |
67 | Summary: psycopg is a PostgreSQL database adapter for Python | |
68 | Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL | |
69 | Group: Libraries/Python | |
70 | ||
121405c1 MK |
71 | Requires: python3-modules |
72 | Requires: python3-pytz | |
73 | ||
74 | ||
1ce53046 JK |
75 | %description -n python3-%{module} |
76 | psycopg is a PostgreSQL database adapter for the Python programming | |
77 | language (just like pygresql and popy.) It was written from scratch | |
78 | with the aim of being very small and fast, and stable as a rock. The | |
79 | main advantages of psycopg are that it supports the full Python | |
80 | DBAPI-2.0 and being thread safe at level 2. | |
81 | ||
82 | %description -n python3-%{module} -l pl.UTF-8 | |
83 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych | |
84 | PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku | |
85 | z założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą | |
86 | psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest | |
87 | 'thread safe' na poziomie 2. | |
88 | ||
121405c1 | 89 | %endif |
1ce53046 | 90 | |
3bacd1f7 | 91 | %prep |
ad85baa5 | 92 | %setup -q -n %{module}-%{version} |
fa6eecba | 93 | #%if "%{_lib}" == "lib64" |
94 | #%patch0 -p1 | |
95 | #%endif | |
3bacd1f7 MK |
96 | |
97 | %build | |
1ce53046 JK |
98 | %if %{with python2} |
99 | %{__python} setup.py build | |
100 | %endif | |
101 | %if %{with python3} | |
102 | %{__python3} setup.py build | |
103 | %endif | |
3bacd1f7 MK |
104 | |
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
3bacd1f7 | 107 | |
1ce53046 JK |
108 | %if %{with python2} |
109 | %{__python} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT | |
fa6eecba | 110 | |
921d82ea MK |
111 | # find $RPM_BUILD_ROOT%{py_libdir} -type f -name "*.py" | xargs rm |
112 | %py_postclean | |
1ce53046 JK |
113 | %endif |
114 | %if %{with python3} | |
115 | %{__python3} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT | |
116 | %endif | |
fa6eecba | 117 | |
3bacd1f7 MK |
118 | %clean |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
1ce53046 | 121 | %if %{with python2} |
3bacd1f7 MK |
122 | %files |
123 | %defattr(644,root,root,755) | |
1ce53046 | 124 | %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS |
fa6eecba | 125 | %dir %{py_sitedir}/%{module} |
126 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
127 | %{py_sitedir}/%{module}/*.py[co] | |
432cab47 | 128 | %if "%{pld_release}" != "ac" |
f53e9079 | 129 | %{py_sitedir}/*.egg-info |
df9bb384 | 130 | %endif |
1ce53046 JK |
131 | %{py_sitedir}/%{module}/tests |
132 | %endif | |
133 | ||
134 | %if %{with python3} | |
135 | %files -n python3-%{module} | |
136 | %defattr(644,root,root,755) | |
137 | %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS | |
138 | %dir %{py3_sitedir}/%{module} | |
139 | %dir %{py3_sitedir}/%{module}/__pycache__ | |
140 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
141 | %{py3_sitedir}/%{module}/*.py | |
142 | %{py3_sitedir}/%{module}/__pycache__/*.py* | |
143 | %{py3_sitedir}/*.egg-info | |
144 | %{py3_sitedir}/%{module}/tests | |
145 | %endif |