]>
Commit | Line | Data |
---|---|---|
215dd3ea ER |
1 | # |
2 | # Conditional build: | |
228c1fc7 JB |
3 | %bcond_with tests # build with tests |
4 | %bcond_without doc # HTML and man documentation | |
5 | %bcond_with sasl # SASL authentication (for Kerberos) | |
6 | %bcond_without ssl # TLS connections and SCRAM-SHA-1 authentication | |
215dd3ea ER |
7 | |
8 | # NOTE about arch: | |
9 | # See https://jira.mongodb.org/browse/CDRIVER-1186 | |
10 | # 32-bit MongoDB support was officially deprecated | |
11 | # in MongoDB 3.2, and support is being removed in 3.4. | |
12 | ||
13 | Summary: Client library written in C for MongoDB | |
228c1fc7 | 14 | Summary(pl.UTF-8): Biblioteka kliencka do MongoDB napisana w C |
215dd3ea | 15 | Name: mongo-c-driver |
101c7924 | 16 | Version: 1.16.2 |
e832db1e | 17 | Release: 1 |
215dd3ea ER |
18 | License: Apache v2.0 |
19 | Group: Libraries | |
228c1fc7 | 20 | #Source0Download: https://github.com/mongodb/mongo-c-driver/releases/ |
215dd3ea | 21 | Source0: https://github.com/mongodb/mongo-c-driver/releases/download/%{version}/%{name}-%{version}.tar.gz |
101c7924 JB |
22 | # Source0-md5: 6561011b25d0e690d0759247bcd390e4 |
23 | Patch0: %{name}-sphinx.patch | |
215dd3ea | 24 | URL: https://github.com/mongodb/mongo-c-driver |
228c1fc7 | 25 | BuildRequires: cmake >= 3.1 |
6ce258cc | 26 | %{?with_sasl:BuildRequires: cyrus-sasl-devel} |
228c1fc7 | 27 | BuildRequires: libicu-devel |
a9b4913f | 28 | %{?with_ssl:BuildRequires: openssl-devel} |
624ce5af | 29 | BuildRequires: pkgconfig |
101c7924 | 30 | BuildRequires: python |
215dd3ea | 31 | BuildRequires: snappy-devel |
228c1fc7 | 32 | %{?with_doc:BuildRequires: sphinx-pdg} |
101c7924 JB |
33 | BuildRequires: zlib-devel >= 1.2.11 |
34 | BuildRequires: zstd-devel | |
215dd3ea ER |
35 | %if %{with tests} |
36 | BuildRequires: mongodb-server | |
37 | BuildRequires: openssl | |
38 | %endif | |
215dd3ea ER |
39 | Requires: %{name}-libs = %{version}-%{release} |
40 | Obsoletes: mongo-c-driver-tools < 1.3.0 | |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %define libver 1.0 | |
44 | ||
45 | %description | |
a9b4913f | 46 | mongo-c-driver is a client library written in C for MongoDB. |
215dd3ea | 47 | |
228c1fc7 JB |
48 | %description -l pl.UTF-8 |
49 | mongo-c-driver to biblioteka kliencka do MongoDB napisana w C. | |
50 | ||
215dd3ea | 51 | %package libs |
228c1fc7 JB |
52 | Summary: Shared library for mongo-c-driver |
53 | Summary(pl.UTF-8): Biblioteka współdzielona mongo-c-driver | |
54 | Group: Libraries | |
10e2f500 | 55 | Requires: libbson = %{version}-%{release} |
101c7924 | 56 | Requires: zlib >= 1.2.11 |
215dd3ea ER |
57 | |
58 | %description libs | |
228c1fc7 JB |
59 | This package contains the shared library for mongo-c-driver. |
60 | ||
61 | %description libs -l pl.UTF-8 | |
62 | Ten pakiet zawiera bibliotekę współdzieloną mongo-c-driver. | |
215dd3ea ER |
63 | |
64 | %package devel | |
228c1fc7 JB |
65 | Summary: Header files for mongo-c-driver library |
66 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki mongo-c-driver | |
215dd3ea ER |
67 | Group: Development/Libraries |
68 | Requires: %{name}-libs = %{version}-%{release} | |
69 | ||
70 | %description devel | |
228c1fc7 JB |
71 | This package contains the header files for mongo-c-driver library. |
72 | ||
73 | Documentation: http://mongoc.org/libmongoc/%{version}/ | |
74 | ||
75 | %description devel -l pl.UTF-8 | |
76 | Ten pakiet zawiera pliki nagłówkowe biblioteki mongo-c-driver. | |
215dd3ea | 77 | |
228c1fc7 JB |
78 | Dokumentacja: http://mongoc.org/libmongoc/%{version}/ |
79 | ||
80 | %package apidocs | |
81 | Summary: API documentation for mongo-c-driver library | |
82 | Summary(pl.UTF-8): Dokumentacja API biblioteki mongo-c-driver | |
83 | Group: Documentation | |
84 | ||
85 | %description apidocs | |
86 | API documentation for mongo-c-driver library. | |
87 | ||
88 | %description apidocs -l pl.UTF-8 | |
89 | Dokumentacja API biblioteki mongo-c-driver. | |
215dd3ea | 90 | |
10e2f500 ER |
91 | %package -n libbson |
92 | Summary: Building, parsing, and iterating BSON documents | |
228c1fc7 JB |
93 | Summary(pl.UTF-8): Tworzenie, analiza i przechodzenie dokumentów BSON |
94 | License: Apache v2.0 and ISC and MIT and zlib | |
10e2f500 | 95 | Group: Libraries |
215dd3ea | 96 | |
10e2f500 ER |
97 | %description -n libbson |
98 | This is a library providing useful routines related to building, | |
99 | parsing, and iterating BSON documents <http://bsonspec.org/>. | |
100 | ||
228c1fc7 JB |
101 | %description -n libbson -l pl.UTF-8 |
102 | Ta biblioteka udostępnia przydatne funkcje związane z budowaniem, | |
103 | analizą i przechodzeniem dokumentów BSON (<http://bsonspec.org/>). | |
104 | ||
10e2f500 ER |
105 | %package -n libbson-devel |
106 | Summary: Development files for libbson | |
228c1fc7 | 107 | Summary(pl.UTF-8): Pliki programistyczne biblioteki libbson |
10e2f500 ER |
108 | License: Apache v2.0 |
109 | Group: Development/Libraries | |
110 | Requires: libbson = %{version}-%{release} | |
215dd3ea | 111 | |
10e2f500 ER |
112 | %description -n libbson-devel |
113 | This package contains libraries and header files needed for developing | |
114 | applications that use libbson. | |
215dd3ea | 115 | |
228c1fc7 JB |
116 | %description -n libbson-devel -l pl.UTF-8 |
117 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
118 | wykorzystujących bibliotekę libbson. | |
119 | ||
120 | %package -n libbson-apidocs | |
121 | Summary: API documentation for libbson library | |
122 | Summary(pl.UTF-8): Dokumentacja API biblioteki libbson | |
123 | Group: Documentation | |
124 | ||
125 | %description -n libbson-apidocs | |
126 | API documentation for libbson library. | |
127 | ||
128 | %description -n libbson-apidocs -l pl.UTF-8 | |
129 | Dokumentacja API biblioteki libbson. | |
130 | ||
10e2f500 ER |
131 | %prep |
132 | %setup -q | |
101c7924 | 133 | %patch0 -p1 |
10e2f500 ER |
134 | |
135 | %build | |
136 | install -d cmake-build | |
137 | cd cmake-build | |
228c1fc7 | 138 | %cmake .. \ |
10e2f500 | 139 | -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \ |
228c1fc7 | 140 | -DENABLE_BSON=ON \ |
10e2f500 | 141 | -DENABLE_EXAMPLES=ON \ |
228c1fc7 | 142 | -DENABLE_HTML_DOCS=%{!?with_doc:OFF}%{?with_doc:ON} \ |
10e2f500 | 143 | -DENABLE_MAN_PAGES=%{!?with_doc:OFF}%{?with_doc:ON} \ |
228c1fc7 | 144 | -DENABLE_SASL=%{!?with_sasl:OFF}%{?with_sasl:CYRUS} \ |
10e2f500 ER |
145 | -DENABLE_SHM_COUNTERS=ON \ |
146 | -DENABLE_SSL=%{!?with_ssl:OFF}%{?with_ssl:OPENSSL -DENABLE_CRYPTO_SYSTEM_PROFILE=ON} \ | |
147 | -DENABLE_STATIC=OFF \ | |
148 | -DENABLE_TESTS=%{!?with_tests:OFF}%{?with_tests:ON} \ | |
228c1fc7 | 149 | -DENABLE_ZLIB=SYSTEM |
10e2f500 | 150 | |
101c7924 | 151 | %{__make} -j1 |
215dd3ea ER |
152 | |
153 | %if %{with tests} | |
154 | : Run a server | |
155 | install -d dbtest | |
156 | mongod \ | |
157 | --journal \ | |
158 | --ipv6 \ | |
159 | --unixSocketPrefix /tmp \ | |
228c1fc7 | 160 | --logpath $PWD/server.log \ |
215dd3ea | 161 | --pidfilepath $PWD/server.pid \ |
228c1fc7 | 162 | --dbpath $PWD/dbtest \ |
215dd3ea ER |
163 | --fork |
164 | ||
165 | : Run the test suite | |
166 | ret=0 | |
167 | export MONGOC_TEST_OFFLINE=on | |
168 | #export MONGOC_TEST_SKIP_SLOW=on | |
169 | ||
170 | %{__make} check || ret=1 | |
171 | ||
172 | : Cleanup | |
173 | [ -s server.pid ] && kill $(cat server.pid) | |
174 | ||
175 | exit $ret | |
176 | %endif | |
177 | ||
178 | %install | |
179 | rm -rf $RPM_BUILD_ROOT | |
228c1fc7 | 180 | |
10e2f500 | 181 | %{__make} -C cmake-build install \ |
215dd3ea ER |
182 | DESTDIR=$RPM_BUILD_ROOT |
183 | ||
228c1fc7 JB |
184 | # packaged as %doc / unneeded in rpm |
185 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/{COPYING,NEWS,README.rst,THIRD_PARTY_NOTICES,uninstall.sh} | |
186 | %if %{with doc} | |
187 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{mongo-c-driver,libbson}/html | |
188 | %endif | |
189 | ||
79d243fb ER |
190 | install -d $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version} |
191 | cp -a src/libmongoc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version} | |
192 | ||
193 | install -d $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version} | |
194 | cp -a src/libbson/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version} | |
195 | ||
215dd3ea ER |
196 | %clean |
197 | rm -rf $RPM_BUILD_ROOT | |
198 | ||
199 | %post libs -p /sbin/ldconfig | |
200 | %postun libs -p /sbin/ldconfig | |
201 | ||
10e2f500 ER |
202 | %post -n libbson -p /sbin/ldconfig |
203 | %postun -n libbson -p /sbin/ldconfig | |
204 | ||
215dd3ea ER |
205 | %files |
206 | %defattr(644,root,root,755) | |
207 | %attr(755,root,root) %{_bindir}/mongoc-stat | |
208 | ||
209 | %files libs | |
210 | %defattr(644,root,root,755) | |
228c1fc7 | 211 | %doc NEWS README.rst THIRD_PARTY_NOTICES |
215dd3ea | 212 | %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so.*.*.* |
228c1fc7 | 213 | %attr(755,root,root) %ghost %{_libdir}/libmongoc-%{libver}.so.0 |
215dd3ea ER |
214 | |
215 | %files devel | |
216 | %defattr(644,root,root,755) | |
228c1fc7 | 217 | %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so |
215dd3ea | 218 | %{_includedir}/libmongoc-%{libver} |
228c1fc7 JB |
219 | %{_pkgconfigdir}/libmongoc-%{libver}.pc |
220 | %{_pkgconfigdir}/libmongoc-ssl-%{libver}.pc | |
215dd3ea | 221 | %{_libdir}/cmake/libmongoc-%{libver} |
e832db1e | 222 | %{_libdir}/cmake/mongoc-*.* |
215dd3ea | 223 | %if %{with doc} |
228c1fc7 | 224 | %{_mandir}/man3/mongoc_*.3* |
215dd3ea | 225 | %endif |
79d243fb | 226 | %{_examplesdir}/libmongoc-%{version} |
10e2f500 | 227 | |
228c1fc7 JB |
228 | %if %{with doc} |
229 | %files apidocs | |
230 | %defattr(644,root,root,755) | |
231 | %doc cmake-build/src/libmongoc/doc/html/{_images,_static,*.html,*.js} | |
232 | %endif | |
233 | ||
10e2f500 ER |
234 | %files -n libbson |
235 | %defattr(644,root,root,755) | |
228c1fc7 | 236 | %doc src/libbson/{NEWS,THIRD_PARTY_NOTICES} |
10e2f500 | 237 | %attr(755,root,root) %{_libdir}/libbson-%{libver}.so.*.*.* |
228c1fc7 | 238 | %attr(755,root,root) %ghost %{_libdir}/libbson-%{libver}.so.0 |
10e2f500 ER |
239 | |
240 | %files -n libbson-devel | |
241 | %defattr(644,root,root,755) | |
228c1fc7 | 242 | %attr(755,root,root) %{_libdir}/libbson-%{libver}.so |
10e2f500 | 243 | %{_includedir}/libbson-%{libver} |
10e2f500 | 244 | %{_pkgconfigdir}/libbson-%{libver}.pc |
e832db1e | 245 | %{_libdir}/cmake/bson-*.* |
228c1fc7 JB |
246 | %{_libdir}/cmake/libbson-%{libver} |
247 | %if %{with doc} | |
248 | %{_mandir}/man3/bson_*.3* | |
249 | %endif | |
79d243fb | 250 | %{_examplesdir}/libbson-%{version} |
228c1fc7 JB |
251 | |
252 | %if %{with doc} | |
253 | %files -n libbson-apidocs | |
254 | %defattr(644,root,root,755) | |
255 | %doc cmake-build/src/libbson/doc/html/{_static,*.html,*.js} | |
256 | %endif |