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
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.
13 Summary: Client library written in C for MongoDB
14 Summary(pl.UTF-8): Biblioteka kliencka do MongoDB napisana w C
20 #Source0Download: https://github.com/mongodb/mongo-c-driver/releases/
21 Source0: https://github.com/mongodb/mongo-c-driver/releases/download/%{version}/%{name}-%{version}.tar.gz
22 # Source0-md5: db255e7223bee68e97e3fea24ccc1ad5
23 URL: https://github.com/mongodb/mongo-c-driver
24 BuildRequires: cmake >= 3.1
25 %{?with_sasl:BuildRequires: cyrus-sasl-devel}
26 BuildRequires: libicu-devel
27 %{?with_ssl:BuildRequires: openssl-devel}
28 BuildRequires: pkgconfig
30 BuildRequires: snappy-devel
31 %{?with_doc:BuildRequires: sphinx-pdg}
32 BuildRequires: zlib-devel >= 1.2.11
33 BuildRequires: zstd-devel
35 BuildRequires: mongodb-server
36 BuildRequires: openssl
38 Requires: %{name}-libs = %{version}-%{release}
39 Obsoletes: mongo-c-driver-tools < 1.3.0
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 mongo-c-driver is a client library written in C for MongoDB.
47 %description -l pl.UTF-8
48 mongo-c-driver to biblioteka kliencka do MongoDB napisana w C.
51 Summary: Shared library for mongo-c-driver
52 Summary(pl.UTF-8): Biblioteka współdzielona mongo-c-driver
54 Requires: libbson = %{version}-%{release}
55 Requires: zlib >= 1.2.11
58 This package contains the shared library for mongo-c-driver.
60 %description libs -l pl.UTF-8
61 Ten pakiet zawiera bibliotekę współdzieloną mongo-c-driver.
64 Summary: Header files for mongo-c-driver library
65 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki mongo-c-driver
66 Group: Development/Libraries
67 Requires: %{name}-libs = %{version}-%{release}
70 This package contains the header files for mongo-c-driver library.
72 Documentation: http://mongoc.org/libmongoc/%{version}/
74 %description devel -l pl.UTF-8
75 Ten pakiet zawiera pliki nagłówkowe biblioteki mongo-c-driver.
77 Dokumentacja: http://mongoc.org/libmongoc/%{version}/
80 Summary: API documentation for mongo-c-driver library
81 Summary(pl.UTF-8): Dokumentacja API biblioteki mongo-c-driver
85 API documentation for mongo-c-driver library.
87 %description apidocs -l pl.UTF-8
88 Dokumentacja API biblioteki mongo-c-driver.
91 Summary: Building, parsing, and iterating BSON documents
92 Summary(pl.UTF-8): Tworzenie, analiza i przechodzenie dokumentów BSON
93 License: Apache v2.0 and ISC and MIT and zlib
96 %description -n libbson
97 This is a library providing useful routines related to building,
98 parsing, and iterating BSON documents <http://bsonspec.org/>.
100 %description -n libbson -l pl.UTF-8
101 Ta biblioteka udostępnia przydatne funkcje związane z budowaniem,
102 analizą i przechodzeniem dokumentów BSON (<http://bsonspec.org/>).
104 %package -n libbson-devel
105 Summary: Development files for libbson
106 Summary(pl.UTF-8): Pliki programistyczne biblioteki libbson
108 Group: Development/Libraries
109 Requires: libbson = %{version}-%{release}
111 %description -n libbson-devel
112 This package contains libraries and header files needed for developing
113 applications that use libbson.
115 %description -n libbson-devel -l pl.UTF-8
116 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
117 wykorzystujących bibliotekę libbson.
119 %package -n libbson-apidocs
120 Summary: API documentation for libbson library
121 Summary(pl.UTF-8): Dokumentacja API biblioteki libbson
124 %description -n libbson-apidocs
125 API documentation for libbson library.
127 %description -n libbson-apidocs -l pl.UTF-8
128 Dokumentacja API biblioteki libbson.
134 install -d cmake-build
137 -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
139 -DENABLE_EXAMPLES=ON \
140 -DENABLE_HTML_DOCS=%{!?with_doc:OFF}%{?with_doc:ON} \
141 -DENABLE_MAN_PAGES=%{!?with_doc:OFF}%{?with_doc:ON} \
142 -DENABLE_SASL=%{!?with_sasl:OFF}%{?with_sasl:CYRUS} \
143 -DENABLE_SHM_COUNTERS=ON \
144 -DENABLE_SSL=%{!?with_ssl:OFF}%{?with_ssl:OPENSSL -DENABLE_CRYPTO_SYSTEM_PROFILE=ON} \
145 -DENABLE_STATIC=OFF \
146 -DENABLE_TESTS=%{!?with_tests:OFF}%{?with_tests:ON} \
147 -DENABLE_ZLIB=SYSTEM \
158 --unixSocketPrefix /tmp \
159 --logpath $PWD/server.log \
160 --pidfilepath $PWD/server.pid \
161 --dbpath $PWD/dbtest \
166 export MONGOC_TEST_OFFLINE=on
167 #export MONGOC_TEST_SKIP_SLOW=on
169 %{__make} check || ret=1
172 [ -s server.pid ] && kill $(cat server.pid)
178 rm -rf $RPM_BUILD_ROOT
180 %{__make} -C cmake-build install \
181 DESTDIR=$RPM_BUILD_ROOT
183 # packaged as %doc / unneeded in rpm
184 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/{COPYING,NEWS,README.rst,THIRD_PARTY_NOTICES,uninstall.sh}
186 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{mongo-c-driver,libbson}/html
189 install -d $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
190 cp -a src/libmongoc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
192 install -d $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
193 cp -a src/libbson/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
196 rm -rf $RPM_BUILD_ROOT
198 %post libs -p /sbin/ldconfig
199 %postun libs -p /sbin/ldconfig
201 %post -n libbson -p /sbin/ldconfig
202 %postun -n libbson -p /sbin/ldconfig
205 %defattr(644,root,root,755)
206 %attr(755,root,root) %{_bindir}/mongoc-stat
209 %defattr(644,root,root,755)
210 %doc NEWS README.rst THIRD_PARTY_NOTICES
211 %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so.*.*.*
212 %attr(755,root,root) %ghost %{_libdir}/libmongoc-%{libver}.so.0
215 %defattr(644,root,root,755)
216 %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so
217 %{_includedir}/libmongoc-%{libver}
218 %{_pkgconfigdir}/libmongoc-%{libver}.pc
219 %{_pkgconfigdir}/libmongoc-ssl-%{libver}.pc
220 %{_libdir}/cmake/libmongoc-%{libver}
221 %{_libdir}/cmake/mongoc-*.*
223 %{_mandir}/man3/mongoc_*.3*
225 %{_examplesdir}/libmongoc-%{version}
229 %defattr(644,root,root,755)
230 %doc cmake-build/src/libmongoc/doc/html/{_images,_static,*.html,*.js}
234 %defattr(644,root,root,755)
235 %doc src/libbson/{NEWS,THIRD_PARTY_NOTICES}
236 %attr(755,root,root) %{_libdir}/libbson-%{libver}.so.*.*.*
237 %attr(755,root,root) %ghost %{_libdir}/libbson-%{libver}.so.0
239 %files -n libbson-devel
240 %defattr(644,root,root,755)
241 %attr(755,root,root) %{_libdir}/libbson-%{libver}.so
242 %{_includedir}/libbson-%{libver}
243 %{_pkgconfigdir}/libbson-%{libver}.pc
244 %{_libdir}/cmake/bson-*.*
245 %{_libdir}/cmake/libbson-%{libver}
247 %{_mandir}/man3/bson_*.3*
249 %{_examplesdir}/libbson-%{version}
252 %files -n libbson-apidocs
253 %defattr(644,root,root,755)
254 %doc cmake-build/src/libbson/doc/html/{_static,*.html,*.js}