]> git.pld-linux.org Git - packages/mongo-c-driver.git/blob - mongo-c-driver.spec
3c9b987db78c9938cbfdfc6b53130465b8253480
[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.16.2
17 Release:        1
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:  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
30 BuildRequires:  python
31 BuildRequires:  snappy-devel
32 %{?with_doc:BuildRequires:      sphinx-pdg}
33 BuildRequires:  zlib-devel >= 1.2.11
34 BuildRequires:  zstd-devel
35 %if %{with tests}
36 BuildRequires:  mongodb-server
37 BuildRequires:  openssl
38 %endif
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
46 mongo-c-driver is a client library written in C for MongoDB.
47
48 %description -l pl.UTF-8
49 mongo-c-driver to biblioteka kliencka do MongoDB napisana w C.
50
51 %package libs
52 Summary:        Shared library for mongo-c-driver
53 Summary(pl.UTF-8):      Biblioteka współdzielona mongo-c-driver
54 Group:          Libraries
55 Requires:       libbson = %{version}-%{release}
56 Requires:       zlib >= 1.2.11
57
58 %description libs
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.
63
64 %package devel
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}
69
70 %description devel
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.
77
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.
90
91 %package -n libbson
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
95 Group:          Libraries
96
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
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
105 %package -n libbson-devel
106 Summary:        Development files for libbson
107 Summary(pl.UTF-8):      Pliki programistyczne biblioteki libbson
108 License:        Apache v2.0
109 Group:          Development/Libraries
110 Requires:       libbson = %{version}-%{release}
111
112 %description -n libbson-devel
113 This package contains libraries and header files needed for developing
114 applications that use libbson.
115
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
131 %prep
132 %setup -q
133 %patch0 -p1
134
135 %build
136 install -d cmake-build
137 cd cmake-build
138 %cmake .. \
139         -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
140         -DENABLE_BSON=ON \
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} \
149         -DENABLE_ZLIB=SYSTEM
150
151 %{__make} -j1
152
153 %if %{with tests}
154 : Run a server
155 install -d dbtest
156 mongod \
157         --journal \
158         --ipv6 \
159         --unixSocketPrefix /tmp \
160         --logpath $PWD/server.log \
161         --pidfilepath $PWD/server.pid \
162         --dbpath $PWD/dbtest \
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
180
181 %{__make} -C cmake-build install \
182         DESTDIR=$RPM_BUILD_ROOT
183
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
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
196 %clean
197 rm -rf $RPM_BUILD_ROOT
198
199 %post   libs -p /sbin/ldconfig
200 %postun libs -p /sbin/ldconfig
201
202 %post   -n libbson -p /sbin/ldconfig
203 %postun -n libbson -p /sbin/ldconfig
204
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)
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
214
215 %files devel
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-*.*
223 %if %{with doc}
224 %{_mandir}/man3/mongoc_*.3*
225 %endif
226 %{_examplesdir}/libmongoc-%{version}
227
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
234 %files -n libbson
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
239
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}
247 %if %{with doc}
248 %{_mandir}/man3/bson_*.3*
249 %endif
250 %{_examplesdir}/libbson-%{version}
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
This page took 0.085206 seconds and 2 git commands to generate.