]> git.pld-linux.org Git - packages/mongo-c-driver.git/blob - mongo-c-driver.spec
f27e29b3e927b0ad47be7c3e58391b316bb3d87c
[packages/mongo-c-driver.git] / mongo-c-driver.spec
1 #
2 # Conditional build:
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
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
14 Summary(pl.UTF-8):      Biblioteka kliencka do MongoDB napisana w C
15 Name:           mongo-c-driver
16 Version:        1.20.0
17 Release:        4
18 License:        Apache v2.0
19 Group:          Libraries
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:  9cd2badc1cea0a7943325ef18caef5c5
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
29 BuildRequires:  python
30 BuildRequires:  snappy-devel
31 %{?with_doc:BuildRequires:      sphinx-pdg}
32 BuildRequires:  zlib-devel >= 1.2.11
33 BuildRequires:  zstd-devel
34 %if %{with tests}
35 BuildRequires:  mongodb-server
36 BuildRequires:  openssl
37 %endif
38 Requires:       %{name}-libs = %{version}-%{release}
39 Obsoletes:      mongo-c-driver-tools < 1.3.0
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         libver       1.0
43
44 %description
45 mongo-c-driver is a client library written in C for MongoDB.
46
47 %description -l pl.UTF-8
48 mongo-c-driver to biblioteka kliencka do MongoDB napisana w C.
49
50 %package libs
51 Summary:        Shared library for mongo-c-driver
52 Summary(pl.UTF-8):      Biblioteka współdzielona mongo-c-driver
53 Group:          Libraries
54 Requires:       libbson = %{version}-%{release}
55 Requires:       zlib >= 1.2.11
56
57 %description libs
58 This package contains the shared library for mongo-c-driver.
59
60 %description libs -l pl.UTF-8
61 Ten pakiet zawiera bibliotekę współdzieloną mongo-c-driver.
62
63 %package devel
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}
68
69 %description devel
70 This package contains the header files for mongo-c-driver library.
71
72 Documentation: http://mongoc.org/libmongoc/%{version}/
73
74 %description devel -l pl.UTF-8
75 Ten pakiet zawiera pliki nagłówkowe biblioteki mongo-c-driver.
76
77 Dokumentacja: http://mongoc.org/libmongoc/%{version}/
78
79 %package apidocs
80 Summary:        API documentation for mongo-c-driver library
81 Summary(pl.UTF-8):      Dokumentacja API biblioteki mongo-c-driver
82 Group:          Documentation
83
84 %description apidocs
85 API documentation for mongo-c-driver library.
86
87 %description apidocs -l pl.UTF-8
88 Dokumentacja API biblioteki mongo-c-driver.
89
90 %package -n libbson
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
94 Group:          Libraries
95
96 %description -n libbson
97 This is a library providing useful routines related to building,
98 parsing, and iterating BSON documents <http://bsonspec.org/>.
99
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/>).
103
104 %package -n libbson-devel
105 Summary:        Development files for libbson
106 Summary(pl.UTF-8):      Pliki programistyczne biblioteki libbson
107 License:        Apache v2.0
108 Group:          Development/Libraries
109 Requires:       libbson = %{version}-%{release}
110
111 %description -n libbson-devel
112 This package contains libraries and header files needed for developing
113 applications that use libbson.
114
115 %description -n libbson-devel -l pl.UTF-8
116 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
117 wykorzystujących bibliotekę libbson.
118
119 %package -n libbson-apidocs
120 Summary:        API documentation for libbson library
121 Summary(pl.UTF-8):      Dokumentacja API biblioteki libbson
122 Group:          Documentation
123
124 %description -n libbson-apidocs
125 API documentation for libbson library.
126
127 %description -n libbson-apidocs -l pl.UTF-8
128 Dokumentacja API biblioteki libbson.
129
130 %prep
131 %setup -q
132
133 %build
134 install -d cmake-build
135 cd cmake-build
136 %cmake \
137         -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
138         -DENABLE_BSON=ON \
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 \
148         ..
149
150 %{__make} -j1
151
152 %if %{with tests}
153 : Run a server
154 install -d dbtest
155 mongod \
156         --journal \
157         --ipv6 \
158         --unixSocketPrefix /tmp \
159         --logpath $PWD/server.log \
160         --pidfilepath $PWD/server.pid \
161         --dbpath $PWD/dbtest \
162         --fork
163
164 : Run the test suite
165 ret=0
166 export MONGOC_TEST_OFFLINE=on
167 #export MONGOC_TEST_SKIP_SLOW=on
168
169 %{__make} check || ret=1
170
171 : Cleanup
172 [ -s server.pid ] && kill $(cat server.pid)
173
174 exit $ret
175 %endif
176
177 %install
178 rm -rf $RPM_BUILD_ROOT
179
180 %{__make} -C cmake-build install \
181         DESTDIR=$RPM_BUILD_ROOT
182
183 # packaged as %doc / unneeded in rpm
184 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/{COPYING,NEWS,README.rst,THIRD_PARTY_NOTICES,uninstall.sh}
185 %if %{with doc}
186 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{mongo-c-driver,libbson}/html
187 %endif
188
189 install -d $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
190 cp -a src/libmongoc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
191
192 install -d $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
193 cp -a src/libbson/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
194
195 %clean
196 rm -rf $RPM_BUILD_ROOT
197
198 %post   libs -p /sbin/ldconfig
199 %postun libs -p /sbin/ldconfig
200
201 %post   -n libbson -p /sbin/ldconfig
202 %postun -n libbson -p /sbin/ldconfig
203
204 %files
205 %defattr(644,root,root,755)
206 %attr(755,root,root) %{_bindir}/mongoc-stat
207
208 %files libs
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
213
214 %files devel
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-*.*
222 %if %{with doc}
223 %{_mandir}/man3/mongoc_*.3*
224 %endif
225 %{_examplesdir}/libmongoc-%{version}
226
227 %if %{with doc}
228 %files apidocs
229 %defattr(644,root,root,755)
230 %doc cmake-build/src/libmongoc/doc/html/{_images,_static,*.html,*.js}
231 %endif
232
233 %files -n libbson
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
238
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}
246 %if %{with doc}
247 %{_mandir}/man3/bson_*.3*
248 %endif
249 %{_examplesdir}/libbson-%{version}
250
251 %if %{with doc}
252 %files -n libbson-apidocs
253 %defattr(644,root,root,755)
254 %doc cmake-build/src/libbson/doc/html/{_static,*.html,*.js}
255 %endif
This page took 0.078871 seconds and 2 git commands to generate.