]> git.pld-linux.org Git - packages/python-psycopg2.git/blob - python-psycopg2.spec
26e8165daf315a7396859217a8383d18ca66d815
[packages/python-psycopg2.git] / python-psycopg2.spec
1 #
2 # todo:
3 # - lib64 patch
4
5 # Conditional build:
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_without  python3 # CPython 3.x module
8
9 %define         module  psycopg2
10 Summary:        psycopg is a PostgreSQL database adapter for Python
11 Summary(pl.UTF-8):      psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL
12 Name:           python-%{module}
13 Version:        2.5
14 Release:        1
15 License:        GPL
16 Group:          Libraries/Python
17 Source0:        http://initd.org/psycopg/tarballs/PSYCOPG-2-5/%{module}-%{version}.tar.gz
18 # Source0-md5:  facd82faa067e99b80146a0ee2f842f6
19 #Patch0:                %{name}-lib64.patch
20 URL:            http://www.initd.org/software/psycopg/
21 BuildRequires:  autoconf
22 BuildRequires:  postgresql-backend-devel
23 BuildRequires:  postgresql-devel
24 %if %{with python2}
25 BuildRequires:  python-devel >= 2.5
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-devel >= 2.5
29 %endif
30 BuildRequires:  rpm-pythonprov
31 Requires:       postgresql-libs
32 %if %{with python2}
33 Requires:       python-modules
34 %if "%{pld_release}" == "ac"
35 BuildRequires:  python-mx-DateTime-devel
36 Requires:       python-mx-DateTime
37 %else
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
44 # Sure, but make mx-DateTime conditional build work
45 BuildConflicts:   python-egenix-mx-base
46 %endif
47 Requires:       python-pytz
48 %endif
49 %if %{with python3}
50 Requires:       python3-modules
51 Requires:       python3-pytz
52 %endif
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
62 %description -l pl.UTF-8
63 psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych
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
67 'thread safe' na poziomie 2.
68
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
89 %prep
90 %setup -q -n %{module}-%{version}
91 #%if "%{_lib}" == "lib64"
92 #%patch0 -p1
93 #%endif
94
95 %build
96 %if %{with python2}
97 %{__python} setup.py build
98 %endif
99 %if %{with python3}
100 %{__python3} setup.py build
101 %endif
102
103 %install
104 rm -rf $RPM_BUILD_ROOT
105
106 %if %{with python2}
107 %{__python} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT
108
109 # find $RPM_BUILD_ROOT%{py_libdir} -type f -name "*.py" | xargs rm
110 %py_postclean
111 %endif
112 %if %{with python3}
113 %{__python3} setup.py install --optimize=2 --root=$RPM_BUILD_ROOT
114 %endif
115
116 %clean
117 rm -rf $RPM_BUILD_ROOT
118
119 %if %{with python2}
120 %files
121 %defattr(644,root,root,755)
122 %doc NEWS AUTHORS README doc/HACKING doc/SUCCESS
123 %dir %{py_sitedir}/%{module}
124 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
125 %{py_sitedir}/%{module}/*.py[co]
126 %if "%{pld_release}" != "ac"
127 %{py_sitedir}/*.egg-info
128 %endif
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
This page took 0.086455 seconds and 2 git commands to generate.