]>
Commit | Line | Data |
---|---|---|
29da83ef JK |
1 | # |
2 | # Conditional build: | |
5b0859e8 JK |
3 | %bcond_without python2 # Python 2.x module |
4 | %bcond_without python3 # Python 3.x module | |
29da83ef JK |
5 | %bcond_with tests # run tests (seem broken) |
6 | ||
7 | %define module pymongo | |
8 | Summary: Python driver for MongoDB | |
9 | Summary(pl.UTF-8): Sterownik Pythona do MongoDB | |
10 | Name: python-%{module} | |
e008cdfb MM |
11 | Version: 2.7.1 |
12 | Release: 1 | |
29da83ef JK |
13 | License: Apache v2.0 |
14 | Group: Development/Languages/Python | |
e008cdfb MM |
15 | Source0: https://pypi.python.org/packages/source/p/pymongo/pymongo-%{version}.tar.gz |
16 | # Source0-md5: 4e4c75e5362f422edb47d27ea6d17a96 | |
29da83ef | 17 | URL: http://api.mongodb.org/python/current/ |
5b0859e8 | 18 | %if %{with python2} |
29da83ef JK |
19 | BuildRequires: python-devel |
20 | BuildRequires: python-distribute | |
5b0859e8 JK |
21 | %endif |
22 | %if %{with python3} | |
23 | BuildRequires: python3-2to3 | |
24 | BuildRequires: python3-devel | |
25 | BuildRequires: python3-distribute | |
26 | %endif | |
29da83ef | 27 | BuildRequires: rpm-pythonprov |
ab0dd126 | 28 | BuildRequires: rpmbuild(macros) >= 1.219 |
29da83ef JK |
29 | Requires: python-libs |
30 | Requires: python-modules | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | The PyMongo distribution contains tools for interacting with MongoDB | |
35 | database from Python. The bson package is an implementation of the | |
36 | BSON format for Python. The pymongo package is a native Python driver | |
37 | for MongoDB. The gridfs package is a gridfs implementation on top of | |
38 | pymongo. | |
39 | ||
ab0dd126 JB |
40 | %description -l pl.UTF-8 |
41 | Dystrybucja PyMongo zawiera narzędzia do współpracy z bazą danych | |
42 | MongoDB z poziomu Pythona. Pakiet bson to implementacja formatu BSON | |
43 | dla Pythona. Pakiet pymongo to natywny sterownik Pythona dla MongoDB. | |
44 | Pakiet gridfs to implementacja gridfs w oparciu o pymongo. | |
45 | ||
5b0859e8 JK |
46 | %package -n python3-%{module} |
47 | Summary: Python driver for MongoDB | |
48 | Summary(pl.UTF-8): Sterownik Pythona do MongoDB | |
49 | Group: Development/Languages/Python | |
50 | Requires: python3-libs | |
51 | Requires: python3-modules | |
52 | ||
53 | %description -n python3-%{module} | |
54 | The PyMongo distribution contains tools for interacting with MongoDB | |
55 | database from Python. The bson package is an implementation of the | |
56 | BSON format for Python. The pymongo package is a native Python driver | |
57 | for MongoDB. The gridfs package is a gridfs implementation on top of | |
58 | pymongo. | |
59 | ||
60 | %description -n python3-%{module} -l pl.UTF-8 | |
61 | Dystrybucja PyMongo zawiera narzędzia do współpracy z bazą danych | |
62 | MongoDB z poziomu Pythona. Pakiet bson to implementacja formatu BSON | |
63 | dla Pythona. Pakiet pymongo to natywny sterownik Pythona dla MongoDB. | |
64 | Pakiet gridfs to implementacja gridfs w oparciu o pymongo. | |
65 | ||
66 | ||
29da83ef JK |
67 | %prep |
68 | %setup -q -n %{module}-%{version} | |
69 | ||
70 | %build | |
5b0859e8 | 71 | %if %{with python2} |
29da83ef JK |
72 | CC="%{__cc}" \ |
73 | CFLAGS="%{rpmcflags}" \ | |
5b0859e8 JK |
74 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} |
75 | %endif | |
29da83ef | 76 | |
5b0859e8 JK |
77 | %if %{with python3} |
78 | CC="%{__cc}" \ | |
79 | CFLAGS="%{rpmcflags}" \ | |
80 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
81 | %endif | |
29da83ef JK |
82 | |
83 | %install | |
84 | rm -rf $RPM_BUILD_ROOT | |
5b0859e8 JK |
85 | |
86 | %if %{with python2} | |
87 | %{__python} setup.py \ | |
88 | build --build-base build-2 \ | |
89 | install \ | |
29da83ef JK |
90 | --skip-build \ |
91 | --optimize=2 \ | |
92 | --root=$RPM_BUILD_ROOT | |
93 | ||
ab0dd126 | 94 | %py_postclean |
5b0859e8 JK |
95 | %endif |
96 | ||
97 | %if %{with python3} | |
98 | %{__python3} setup.py \ | |
99 | build --build-base build-3 \ | |
100 | install \ | |
101 | --skip-build \ | |
102 | --optimize=2 \ | |
103 | --root=$RPM_BUILD_ROOT | |
104 | %endif | |
29da83ef JK |
105 | |
106 | %clean | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
5b0859e8 | 109 | %if %{with python2} |
29da83ef JK |
110 | %files |
111 | %defattr(644,root,root,755) | |
ab0dd126 | 112 | %doc README.rst doc/api doc/examples doc/*.rst |
29da83ef | 113 | %dir %{py_sitedir}/bson |
ab0dd126 JB |
114 | %{py_sitedir}/bson/*.py[co] |
115 | %attr(755,root,root) %{py_sitedir}/bson/_cbson.so | |
29da83ef | 116 | %dir %{py_sitedir}/gridfs |
ab0dd126 | 117 | %{py_sitedir}/gridfs/*.py[co] |
29da83ef | 118 | %dir %{py_sitedir}/pymongo |
ab0dd126 JB |
119 | %{py_sitedir}/pymongo/*.py[co] |
120 | %attr(755,root,root) %{py_sitedir}/pymongo/_cmessage.so | |
121 | %{py_sitedir}/pymongo-%{version}-py*.egg-info | |
5b0859e8 JK |
122 | %endif |
123 | ||
124 | %if %{with python3} | |
125 | %files -n python3-%{module} | |
126 | %defattr(644,root,root,755) | |
127 | %doc README.rst doc/api doc/examples doc/*.rst | |
128 | %dir %{py3_sitedir}/bson | |
129 | %{py3_sitedir}/bson/*.py | |
130 | %{py3_sitedir}/bson/__pycache__ | |
131 | %attr(755,root,root) %{py3_sitedir}/bson/_cbson.*.so | |
132 | %dir %{py3_sitedir}/gridfs | |
133 | %{py3_sitedir}/gridfs/*.py | |
134 | %{py3_sitedir}/gridfs/__pycache__ | |
135 | %dir %{py3_sitedir}/pymongo | |
136 | %{py3_sitedir}/pymongo/*.py | |
137 | %{py3_sitedir}/pymongo/__pycache__ | |
138 | %attr(755,root,root) %{py3_sitedir}/pymongo/_cmessage.*.so | |
139 | %{py3_sitedir}/pymongo-%{version}-py*.egg-info | |
140 | %endif |