]> git.pld-linux.org Git - packages/python-psycopg2.git/blob - python-psycopg2.spec
- python 3.4
[packages/python-psycopg2.git] / python-psycopg2.spec
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.5.1
13 Release:        2
14 License:        GPL
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
28 Requires:       python-pytz
29 %if "%{pld_release}" == "ac"
30 BuildRequires:  python-mx-DateTime-devel
31 Requires:       python-mx-DateTime
32 %else
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
39 # Sure, but make mx-DateTime conditional build work
40 BuildConflicts: python-egenix-mx-base
41 %endif
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
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.
57
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
64
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
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.
78
79 %prep
80 %setup -q -n %{module}-%{version}
81 #%if "%{_lib}" == "lib64"
82 #%patch0 -p1
83 #%endif
84
85 %build
86 %if %{with python2}
87 %{__python} setup.py build
88 %endif
89 %if %{with python3}
90 %{__python3} setup.py build
91 %endif
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95 %if %{with python2}
96 %{__python} setup.py install \
97         --optimize=2 \
98         --root=$RPM_BUILD_ROOT
99
100 %py_postclean
101 %endif
102 %if %{with python3}
103 %{__python3} setup.py install \
104         --optimize=2 \
105         --root=$RPM_BUILD_ROOT
106 %endif
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with python2}
112 %files
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
120 %endif
121 %{py_sitedir}/%{module}/tests
122 %endif
123
124 %if %{with python3}
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
135 %endif
This page took 0.153922 seconds and 3 git commands to generate.