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