]>
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 |
330f6d72 | 13 | Release: 6 |
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 |
62f76467 ER |
23 | %{?with_python2:BuildRequires: python-devel >= 2.5} |
24 | %{?with_python3:BuildRequires: python3-devel} | |
399bddde | 25 | BuildRequires: rpm-pythonprov |
258ebeda | 26 | Requires: postgresql-libs |
89ddf330 | 27 | Requires: python-modules |
62f76467 | 28 | Requires: python-pytz |
07c88ab6 | 29 | %if "%{pld_release}" == "ac" |
54964aba | 30 | BuildRequires: python-mx-DateTime-devel |
31 | Requires: python-mx-DateTime | |
07c88ab6 | 32 | %else |
4093edd6 | 33 | # if somebody really needs mx.DateTime, then one can request mx.Datetime |
34 | # usage on runtime; | |
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 | |
0e0021ce | 39 | # Sure, but make mx-DateTime conditional build work |
62f76467 | 40 | BuildConflicts: python-egenix-mx-base |
1ce53046 | 41 | %endif |
3bacd1f7 | 42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
3bacd1f7 MK |
43 | |
44 | %description | |
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. | |
50 | ||
3a08e339 | 51 | %description -l pl.UTF-8 |
3bacd1f7 | 52 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych |
62f76467 ER |
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ą | |
3a08e339 | 55 | psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest |
3bacd1f7 MK |
56 | 'thread safe' na poziomie 2. |
57 | ||
1ce53046 JK |
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 | |
121405c1 MK |
62 | Requires: python3-modules |
63 | Requires: python3-pytz | |
121405c1 | 64 | |
1ce53046 JK |
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. | |
71 | ||
72 | %description -n python3-%{module} -l pl.UTF-8 | |
73 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych | |
62f76467 ER |
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ą | |
1ce53046 JK |
76 | psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest |
77 | 'thread safe' na poziomie 2. | |
78 | ||
3bacd1f7 | 79 | %prep |
ad85baa5 | 80 | %setup -q -n %{module}-%{version} |
fa6eecba | 81 | #%if "%{_lib}" == "lib64" |
82 | #%patch0 -p1 | |
83 | #%endif | |
3bacd1f7 MK |
84 | |
85 | %build | |
1ce53046 | 86 | %if %{with python2} |
528a4b45 | 87 | %py_build |
1ce53046 JK |
88 | %endif |
89 | %if %{with python3} | |
528a4b45 | 90 | %py3_build |
1ce53046 | 91 | %endif |
3bacd1f7 MK |
92 | |
93 | %install | |
94 | rm -rf $RPM_BUILD_ROOT | |
1ce53046 | 95 | %if %{with python2} |
528a4b45 | 96 | %py_install |
fa6eecba | 97 | |
921d82ea | 98 | %py_postclean |
1ce53046 JK |
99 | %endif |
100 | %if %{with python3} | |
528a4b45 | 101 | %py3_install |
1ce53046 | 102 | %endif |
fa6eecba | 103 | |
3bacd1f7 MK |
104 | %clean |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
1ce53046 | 107 | %if %{with python2} |
3bacd1f7 MK |
108 | %files |
109 | %defattr(644,root,root,755) | |
1ce53046 | 110 | %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS |
fa6eecba | 111 | %dir %{py_sitedir}/%{module} |
112 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
113 | %{py_sitedir}/%{module}/*.py[co] | |
432cab47 | 114 | %if "%{pld_release}" != "ac" |
f53e9079 | 115 | %{py_sitedir}/*.egg-info |
df9bb384 | 116 | %endif |
1ce53046 JK |
117 | %{py_sitedir}/%{module}/tests |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %files -n python3-%{module} | |
122 | %defattr(644,root,root,755) | |
123 | %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS | |
124 | %dir %{py3_sitedir}/%{module} | |
125 | %dir %{py3_sitedir}/%{module}/__pycache__ | |
126 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
127 | %{py3_sitedir}/%{module}/*.py | |
128 | %{py3_sitedir}/%{module}/__pycache__/*.py* | |
129 | %{py3_sitedir}/*.egg-info | |
130 | %{py3_sitedir}/%{module}/tests | |
131 | %endif |