]>
Commit | Line | Data |
---|---|---|
fa6eecba | 1 | # |
f53e9079 | 2 | # Conditional build: |
3 | %bcond_with mx # build with egenix mx datetime support | |
4 | # | |
fa6eecba | 5 | # todo: |
6 | # - zope adapter | |
7 | # - lib64 patch | |
8 | # | |
50248341 | 9 | # WARNING! Please note, that mx.DateTime is optional. You can use |
10 | # mx.DateTime with your apps, but other see datetime datatype more | |
11 | # suitable for date and time as it is standard in Python. | |
f93a45b9 | 12 | |
fa6eecba | 13 | %define module psycopg2 |
f93a45b9 | 14 | |
3bacd1f7 | 15 | Summary: psycopg is a PostgreSQL database adapter for Python |
f4a85503 | 16 | Summary(pl.UTF-8): psycopg jest przeznaczonym dla Pythona interfejsem do bazy PostgreSQL |
3bacd1f7 | 17 | Name: python-%{module} |
d9fab9e8 | 18 | Version: 2.0.7 |
f53e9079 | 19 | Release: 2 |
258ebeda | 20 | License: GPL |
4b5b5919 | 21 | Group: Libraries/Python |
dd6f52dd | 22 | Source0: http://initd.org/pub/software/psycopg/%{module}-%{version}.tar.gz |
d9fab9e8 | 23 | # Source0-md5: 39a2a2ec16f031d2bb1c54de403d4d77 |
fa6eecba | 24 | #Patch0: %{name}-lib64.patch |
258ebeda | 25 | URL: http://www.initd.org/software/psycopg/ |
dd6f8fe2 | 26 | BuildRequires: autoconf |
258ebeda | 27 | BuildRequires: postgresql-backend-devel |
c72332e3 | 28 | BuildRequires: postgresql-devel |
258ebeda | 29 | BuildRequires: python-devel |
399bddde | 30 | BuildRequires: rpm-pythonprov |
f53e9079 | 31 | %if %{with mx} |
84a640a1 | 32 | BuildRequires: python-mx-DateTime-devel |
33 | Requires: python-mx-DateTime | |
f53e9079 | 34 | %else |
35 | BuildConflicts: python-mx-DateTime | |
36 | %endif | |
258ebeda | 37 | Requires: postgresql-libs |
44843cf9 | 38 | %pyrequires_eq python-modules |
3bacd1f7 | 39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
3bacd1f7 | 40 | |
f1720923 | 41 | %define zope_subname ZPsycopgDA |
e8c205e6 | 42 | |
3bacd1f7 MK |
43 | %description |
44 | psycopg is a PostgreSQL database adapter for the Python programming | |
45 | language (just like pygresql and popy.) It was written from scratch | |
46 | with the aim of being very small and fast, and stable as a rock. The | |
47 | main advantages of psycopg are that it supports the full Python | |
48 | DBAPI-2.0 and being thread safe at level 2. | |
49 | ||
3a08e339 | 50 | %description -l pl.UTF-8 |
3bacd1f7 | 51 | psycopg jest przeznaczonym dla Pythona interfejsem do bazy danych |
3a08e339 JR |
52 | PostgreSQL (tak jak pygresql i popy). Został zakodowany od początku |
53 | z założeniem że ma być bardzo mały, szybki i stabilny. Główna zaletą | |
54 | psycopg jest, że w jest pełni zgodny z standardem DBAPI-2.0 i jest | |
3bacd1f7 MK |
55 | 'thread safe' na poziomie 2. |
56 | ||
f1720923 | 57 | %package -n Zope-%{zope_subname} |
e8c205e6 | 58 | Summary: Zope PostgreSQL database adapter |
f4a85503 | 59 | Summary(pl.UTF-8): Interfejs bazy danych PostgreSQL do Zope |
e8c205e6 | 60 | Group: Development/Languages/Python |
ea893739 | 61 | Requires: %{name} = %{version}-%{release} |
e8c205e6 | 62 | Requires: Zope |
e8c205e6 | 63 | |
f1720923 | 64 | %description -n Zope-%{zope_subname} |
e8c205e6 JK |
65 | Zope PostgreSQL database adapter. |
66 | ||
3a08e339 | 67 | %description -n Zope-%{zope_subname} -l pl.UTF-8 |
e8c205e6 JK |
68 | Interfejs bazy danych PostgreSQL do Zope. |
69 | ||
3bacd1f7 | 70 | %prep |
ad85baa5 | 71 | %setup -q -n %{module}-%{version} |
fa6eecba | 72 | #%if "%{_lib}" == "lib64" |
73 | #%patch0 -p1 | |
74 | #%endif | |
3bacd1f7 MK |
75 | |
76 | %build | |
fa6eecba | 77 | python setup.py build |
3bacd1f7 MK |
78 | |
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
3bacd1f7 | 81 | |
fa6eecba | 82 | python setup.py install --optimize=2 --root=$RPM_BUILD_ROOT |
83 | ||
84 | find $RPM_BUILD_ROOT%{py_libdir} -type f -name "*.py" | xargs rm | |
85 | ||
86 | #install -d $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname} | |
3bacd1f7 | 87 | |
fa6eecba | 88 | #cp -ar %{zope_subname}/* $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname} |
89 | #%py_comp $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname} | |
90 | #%py_ocomp $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname} | |
91 | #rm -f $RPM_BUILD_ROOT%{_datadir}/Zope-%{zope_subname}/*.py | |
e8c205e6 | 92 | |
3bacd1f7 MK |
93 | %clean |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
fa6eecba | 96 | #%post -n Zope-%{zope_subname} |
97 | #/usr/sbin/installzopeproduct %{_datadir}/Zope-%{zope_subname} %{zope_subname} | |
98 | #if [ -f /var/lock/subsys/zope ]; then | |
99 | # /etc/rc.d/init.d/zope restart >&2 | |
100 | #fi | |
f1720923 | 101 | |
fa6eecba | 102 | #%postun -n Zope-%{zope_subname} |
103 | #if [ "$1" = "0" ]; then | |
104 | # /usr/sbin/installzopeproduct -d %{zope_subname} | |
105 | # if [ -f /var/lock/subsys/zope ]; then | |
106 | # /etc/rc.d/init.d/zope restart >&2 | |
107 | # fi | |
108 | #fi | |
f1720923 | 109 | |
3bacd1f7 MK |
110 | %files |
111 | %defattr(644,root,root,755) | |
fa6eecba | 112 | %doc ChangeLog AUTHORS README doc/HACKING doc/SUCCESS doc/TODO |
113 | %dir %{py_sitedir}/%{module} | |
114 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
115 | %{py_sitedir}/%{module}/*.py[co] | |
f53e9079 | 116 | %{py_sitedir}/*.egg-info |
fa6eecba | 117 | |
118 | #%files -n Zope-%{zope_subname} | |
119 | #%defattr(644,root,root,755) | |
120 | #%{_datadir}/Zope-%{zope_subname} |