]>
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} |
8b909a84 | 19 | BuildRequires: python-devel >= 2.4 |
29da83ef | 20 | BuildRequires: python-distribute |
5b0859e8 JK |
21 | %endif |
22 | %if %{with python3} | |
8b909a84 JB |
23 | BuildRequires: python3-2to3 >= 3.2 |
24 | BuildRequires: python3-devel >= 3.2 | |
5b0859e8 JK |
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 | ||
29da83ef JK |
66 | %prep |
67 | %setup -q -n %{module}-%{version} | |
68 | ||
69 | %build | |
5b0859e8 | 70 | %if %{with python2} |
29da83ef JK |
71 | CC="%{__cc}" \ |
72 | CFLAGS="%{rpmcflags}" \ | |
5b0859e8 JK |
73 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} |
74 | %endif | |
29da83ef | 75 | |
5b0859e8 JK |
76 | %if %{with python3} |
77 | CC="%{__cc}" \ | |
78 | CFLAGS="%{rpmcflags}" \ | |
79 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
80 | %endif | |
29da83ef JK |
81 | |
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
5b0859e8 JK |
84 | |
85 | %if %{with python2} | |
86 | %{__python} setup.py \ | |
87 | build --build-base build-2 \ | |
88 | install \ | |
29da83ef JK |
89 | --skip-build \ |
90 | --optimize=2 \ | |
91 | --root=$RPM_BUILD_ROOT | |
92 | ||
ab0dd126 | 93 | %py_postclean |
5b0859e8 JK |
94 | %endif |
95 | ||
96 | %if %{with python3} | |
97 | %{__python3} setup.py \ | |
98 | build --build-base build-3 \ | |
99 | install \ | |
100 | --skip-build \ | |
101 | --optimize=2 \ | |
102 | --root=$RPM_BUILD_ROOT | |
103 | %endif | |
29da83ef JK |
104 | |
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
5b0859e8 | 108 | %if %{with python2} |
29da83ef JK |
109 | %files |
110 | %defattr(644,root,root,755) | |
ab0dd126 | 111 | %doc README.rst doc/api doc/examples doc/*.rst |
29da83ef | 112 | %dir %{py_sitedir}/bson |
ab0dd126 JB |
113 | %{py_sitedir}/bson/*.py[co] |
114 | %attr(755,root,root) %{py_sitedir}/bson/_cbson.so | |
29da83ef | 115 | %dir %{py_sitedir}/gridfs |
ab0dd126 | 116 | %{py_sitedir}/gridfs/*.py[co] |
29da83ef | 117 | %dir %{py_sitedir}/pymongo |
ab0dd126 JB |
118 | %{py_sitedir}/pymongo/*.py[co] |
119 | %attr(755,root,root) %{py_sitedir}/pymongo/_cmessage.so | |
120 | %{py_sitedir}/pymongo-%{version}-py*.egg-info | |
5b0859e8 JK |
121 | %endif |
122 | ||
123 | %if %{with python3} | |
124 | %files -n python3-%{module} | |
125 | %defattr(644,root,root,755) | |
126 | %doc README.rst doc/api doc/examples doc/*.rst | |
127 | %dir %{py3_sitedir}/bson | |
128 | %{py3_sitedir}/bson/*.py | |
129 | %{py3_sitedir}/bson/__pycache__ | |
130 | %attr(755,root,root) %{py3_sitedir}/bson/_cbson.*.so | |
131 | %dir %{py3_sitedir}/gridfs | |
132 | %{py3_sitedir}/gridfs/*.py | |
133 | %{py3_sitedir}/gridfs/__pycache__ | |
134 | %dir %{py3_sitedir}/pymongo | |
135 | %{py3_sitedir}/pymongo/*.py | |
136 | %{py3_sitedir}/pymongo/__pycache__ | |
137 | %attr(755,root,root) %{py3_sitedir}/pymongo/_cmessage.*.so | |
138 | %{py3_sitedir}/pymongo-%{version}-py*.egg-info | |
139 | %endif |