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: 6561011b25d0e690d0759247bcd390e4
23 Patch0: %{name}-sphinx.patch
24 URL: https://github.com/mongodb/mongo-c-driver
25 BuildRequires: cmake >= 3.1
26 %{?with_sasl:BuildRequires: cyrus-sasl-devel}
27 BuildRequires: libicu-devel
28 %{?with_ssl:BuildRequires: openssl-devel}
29 BuildRequires: pkgconfig
31 BuildRequires: snappy-devel
32 %{?with_doc:BuildRequires: sphinx-pdg}
33 BuildRequires: zlib-devel >= 1.2.11
34 BuildRequires: zstd-devel
36 BuildRequires: mongodb-server
37 BuildRequires: openssl
39 Requires: %{name}-libs = %{version}-%{release}
40 Obsoletes: mongo-c-driver-tools < 1.3.0
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 mongo-c-driver is a client library written in C for MongoDB.
48 %description -l pl.UTF-8
49 mongo-c-driver to biblioteka kliencka do MongoDB napisana w C.
52 Summary: Shared library for mongo-c-driver
53 Summary(pl.UTF-8): Biblioteka współdzielona mongo-c-driver
55 Requires: libbson = %{version}-%{release}
56 Requires: zlib >= 1.2.11
59 This package contains the shared library for mongo-c-driver.
61 %description libs -l pl.UTF-8
62 Ten pakiet zawiera bibliotekę współdzieloną mongo-c-driver.
65 Summary: Header files for mongo-c-driver library
66 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki mongo-c-driver
67 Group: Development/Libraries
68 Requires: %{name}-libs = %{version}-%{release}
71 This package contains the header files for mongo-c-driver library.
73 Documentation: http://mongoc.org/libmongoc/%{version}/
75 %description devel -l pl.UTF-8
76 Ten pakiet zawiera pliki nagłówkowe biblioteki mongo-c-driver.
78 Dokumentacja: http://mongoc.org/libmongoc/%{version}/
81 Summary: API documentation for mongo-c-driver library
82 Summary(pl.UTF-8): Dokumentacja API biblioteki mongo-c-driver
86 API documentation for mongo-c-driver library.
88 %description apidocs -l pl.UTF-8
89 Dokumentacja API biblioteki mongo-c-driver.
92 Summary: Building, parsing, and iterating BSON documents
93 Summary(pl.UTF-8): Tworzenie, analiza i przechodzenie dokumentów BSON
94 License: Apache v2.0 and ISC and MIT and zlib
97 %description -n libbson
98 This is a library providing useful routines related to building,
99 parsing, and iterating BSON documents <http://bsonspec.org/>.
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/>).
105 %package -n libbson-devel
106 Summary: Development files for libbson
107 Summary(pl.UTF-8): Pliki programistyczne biblioteki libbson
109 Group: Development/Libraries
110 Requires: libbson = %{version}-%{release}
112 %description -n libbson-devel
113 This package contains libraries and header files needed for developing
114 applications that use libbson.
116 %description -n libbson-devel -l pl.UTF-8
117 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
118 wykorzystujących bibliotekę libbson.
120 %package -n libbson-apidocs
121 Summary: API documentation for libbson library
122 Summary(pl.UTF-8): Dokumentacja API biblioteki libbson
125 %description -n libbson-apidocs
126 API documentation for libbson library.
128 %description -n libbson-apidocs -l pl.UTF-8
129 Dokumentacja API biblioteki libbson.
136 install -d cmake-build
139 -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
141 -DENABLE_EXAMPLES=ON \
142 -DENABLE_HTML_DOCS=%{!?with_doc:OFF}%{?with_doc:ON} \
143 -DENABLE_MAN_PAGES=%{!?with_doc:OFF}%{?with_doc:ON} \
144 -DENABLE_SASL=%{!?with_sasl:OFF}%{?with_sasl:CYRUS} \
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} \
159 --unixSocketPrefix /tmp \
160 --logpath $PWD/server.log \
161 --pidfilepath $PWD/server.pid \
162 --dbpath $PWD/dbtest \
167 export MONGOC_TEST_OFFLINE=on
168 #export MONGOC_TEST_SKIP_SLOW=on
170 %{__make} check || ret=1
173 [ -s server.pid ] && kill $(cat server.pid)
179 rm -rf $RPM_BUILD_ROOT
181 %{__make} -C cmake-build install \
182 DESTDIR=$RPM_BUILD_ROOT
184 # packaged as %doc / unneeded in rpm
185 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/{COPYING,NEWS,README.rst,THIRD_PARTY_NOTICES,uninstall.sh}
187 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{mongo-c-driver,libbson}/html
190 install -d $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
191 cp -a src/libmongoc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
193 install -d $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
194 cp -a src/libbson/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
197 rm -rf $RPM_BUILD_ROOT
199 %post libs -p /sbin/ldconfig
200 %postun libs -p /sbin/ldconfig
202 %post -n libbson -p /sbin/ldconfig
203 %postun -n libbson -p /sbin/ldconfig
206 %defattr(644,root,root,755)
207 %attr(755,root,root) %{_bindir}/mongoc-stat
210 %defattr(644,root,root,755)
211 %doc NEWS README.rst THIRD_PARTY_NOTICES
212 %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so.*.*.*
213 %attr(755,root,root) %ghost %{_libdir}/libmongoc-%{libver}.so.0
216 %defattr(644,root,root,755)
217 %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so
218 %{_includedir}/libmongoc-%{libver}
219 %{_pkgconfigdir}/libmongoc-%{libver}.pc
220 %{_pkgconfigdir}/libmongoc-ssl-%{libver}.pc
221 %{_libdir}/cmake/libmongoc-%{libver}
222 %{_libdir}/cmake/mongoc-*.*
224 %{_mandir}/man3/mongoc_*.3*
226 %{_examplesdir}/libmongoc-%{version}
230 %defattr(644,root,root,755)
231 %doc cmake-build/src/libmongoc/doc/html/{_images,_static,*.html,*.js}
235 %defattr(644,root,root,755)
236 %doc src/libbson/{NEWS,THIRD_PARTY_NOTICES}
237 %attr(755,root,root) %{_libdir}/libbson-%{libver}.so.*.*.*
238 %attr(755,root,root) %ghost %{_libdir}/libbson-%{libver}.so.0
240 %files -n libbson-devel
241 %defattr(644,root,root,755)
242 %attr(755,root,root) %{_libdir}/libbson-%{libver}.so
243 %{_includedir}/libbson-%{libver}
244 %{_pkgconfigdir}/libbson-%{libver}.pc
245 %{_libdir}/cmake/bson-*.*
246 %{_libdir}/cmake/libbson-%{libver}
248 %{_mandir}/man3/bson_*.3*
250 %{_examplesdir}/libbson-%{version}
253 %files -n libbson-apidocs
254 %defattr(644,root,root,755)
255 %doc cmake-build/src/libbson/doc/html/{_static,*.html,*.js}