]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - lib64 patch | |
3 | ||
4 | # Conditional build: | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
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} | |
12 | Version: 2.8.4 | |
13 | Release: 4 | |
14 | License: GPL | |
15 | Group: Libraries/Python | |
16 | Source0: http://initd.org/psycopg/tarballs/PSYCOPG-2-8/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: dbb5a67dd57cfa905de37ab9678a92f6 | |
18 | #Patch0: %{name}-lib64.patch | |
19 | URL: http://www.initd.org/software/psycopg/ | |
20 | BuildRequires: rpmbuild(macros) >= 1.710 | |
21 | BuildRequires: autoconf | |
22 | BuildRequires: postgresql-backend-devel | |
23 | BuildRequires: postgresql-devel | |
24 | %{?with_python2:BuildRequires: python-devel >= 2.5} | |
25 | %{?with_python3:BuildRequires: python3-devel} | |
26 | BuildRequires: rpm-pythonprov | |
27 | Requires: postgresql-libs | |
28 | Requires: python-modules | |
29 | Requires: python-pytz | |
30 | %if "%{pld_release}" == "ac" | |
31 | BuildRequires: python-mx-DateTime-devel | |
32 | Requires: python-mx-DateTime | |
33 | %else | |
34 | # if somebody really needs mx.DateTime, then one can request mx.Datetime | |
35 | # usage on runtime; | |
36 | # it is pointless to use 'Requires' or 'Suggest' field because | |
37 | # - python provides its own datetime implementation | |
38 | # - one can request it on runtime (as said above) | |
39 | # - usage of mx.DateTime type is application specific | |
40 | # Sure, but make mx-DateTime conditional build work | |
41 | BuildConflicts: python-egenix-mx-base | |
42 | %endif | |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | psycopg is a PostgreSQL database adapter for the Python programming | |
47 | language (just like pygresql and popy.) It was written from scratch | |
48 | with the aim of being very small and fast, and stable as a rock. The | |
49 | main advantages of psycopg are that it supports the full Python | |
50 | DBAPI-2.0 and being thread safe at level 2. | |
51 | ||
52 | %description -l pl.UTF-8 | |
53 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych | |
54 | PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku z | |
55 | założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą | |
56 | psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest | |
57 | 'thread safe' na poziomie 2. | |
58 | ||
59 | %package -n python3-%{module} | |
60 | Summary: psycopg is a PostgreSQL database adapter for Python | |
61 | Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL | |
62 | Group: Libraries/Python | |
63 | Requires: python3-modules | |
64 | Requires: python3-pytz | |
65 | ||
66 | %description -n python3-%{module} | |
67 | psycopg is a PostgreSQL database adapter for the Python programming | |
68 | language (just like pygresql and popy.) It was written from scratch | |
69 | with the aim of being very small and fast, and stable as a rock. The | |
70 | main advantages of psycopg are that it supports the full Python | |
71 | DBAPI-2.0 and being thread safe at level 2. | |
72 | ||
73 | %description -n python3-%{module} -l pl.UTF-8 | |
74 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych | |
75 | PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku z | |
76 | założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą | |
77 | psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest | |
78 | 'thread safe' na poziomie 2. | |
79 | ||
80 | %prep | |
81 | %setup -q -n %{module}-%{version} | |
82 | #%if "%{_lib}" == "lib64" | |
83 | #%patch0 -p1 | |
84 | #%endif | |
85 | ||
86 | %build | |
87 | %if %{with python2} | |
88 | %py_build | |
89 | %endif | |
90 | %if %{with python3} | |
91 | %py3_build | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | %if %{with python2} | |
97 | %py_install | |
98 | ||
99 | %py_postclean | |
100 | %endif | |
101 | %if %{with python3} | |
102 | %py3_install | |
103 | %endif | |
104 | ||
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
109 | %files | |
110 | %defattr(644,root,root,755) | |
111 | %doc NEWS AUTHORS doc/SUCCESS | |
112 | %dir %{py_sitedir}/%{module} | |
113 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
114 | %{py_sitedir}/%{module}/*.py[co] | |
115 | %if "%{pld_release}" != "ac" | |
116 | %{py_sitedir}/*.egg-info | |
117 | %endif | |
118 | %endif | |
119 | ||
120 | %if %{with python3} | |
121 | %files -n python3-%{module} | |
122 | %defattr(644,root,root,755) | |
123 | %doc NEWS AUTHORS 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 | %endif |