]> git.pld-linux.org Git - packages/mongo-c-driver.git/blob - mongo-c-driver.spec
- updated to 1.23.2
[packages/mongo-c-driver.git] / mongo-c-driver.spec
1 # TODO: mongocrypt support
2 #
3 # Conditional build:
4 %bcond_with     tests   # build with tests
5 %bcond_without  doc     # HTML and man documentation
6 %bcond_with     sasl    # SASL authentication (for Kerberos)
7 %bcond_without  ssl     # TLS connections and SCRAM-SHA-1 authentication
8
9 # NOTE about arch:
10 # See https://jira.mongodb.org/browse/CDRIVER-1186
11 # 32-bit MongoDB support was officially deprecated
12 # in MongoDB 3.2, and support is being removed in 3.4.
13
14 Summary:        Client library written in C for MongoDB
15 Summary(pl.UTF-8):      Biblioteka kliencka do MongoDB napisana w C
16 Name:           mongo-c-driver
17 Version:        1.23.2
18 Release:        1
19 License:        Apache v2.0
20 Group:          Libraries
21 #Source0Download: https://github.com/mongodb/mongo-c-driver/releases/
22 Source0:        https://github.com/mongodb/mongo-c-driver/releases/download/%{version}/%{name}-%{version}.tar.gz
23 # Source0-md5:  a06b6520531993746c0dfba8763749c1
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.12
34 BuildRequires:  zstd-devel >= 0.8.0
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.12
57 Requires:       zstd >= 0.8.0
58
59 %description libs
60 This package contains the shared library for mongo-c-driver.
61
62 %description libs -l pl.UTF-8
63 Ten pakiet zawiera bibliotekę współdzieloną mongo-c-driver.
64
65 %package devel
66 Summary:        Header files for mongo-c-driver library
67 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki mongo-c-driver
68 Group:          Development/Libraries
69 Requires:       %{name}-libs = %{version}-%{release}
70
71 %description devel
72 This package contains the header files for mongo-c-driver library.
73
74 Documentation: http://mongoc.org/libmongoc/%{version}/
75
76 %description devel -l pl.UTF-8
77 Ten pakiet zawiera pliki nagłówkowe biblioteki mongo-c-driver.
78
79 Dokumentacja: http://mongoc.org/libmongoc/%{version}/
80
81 %package apidocs
82 Summary:        API documentation for mongo-c-driver library
83 Summary(pl.UTF-8):      Dokumentacja API biblioteki mongo-c-driver
84 Group:          Documentation
85
86 %description apidocs
87 API documentation for mongo-c-driver library.
88
89 %description apidocs -l pl.UTF-8
90 Dokumentacja API biblioteki mongo-c-driver.
91
92 %package -n libbson
93 Summary:        Building, parsing, and iterating BSON documents
94 Summary(pl.UTF-8):      Tworzenie, analiza i przechodzenie dokumentów BSON
95 License:        Apache v2.0 and ISC and MIT and zlib
96 Group:          Libraries
97
98 %description -n libbson
99 This is a library providing useful routines related to building,
100 parsing, and iterating BSON documents <http://bsonspec.org/>.
101
102 %description -n libbson -l pl.UTF-8
103 Ta biblioteka udostępnia przydatne funkcje związane z budowaniem,
104 analizą i przechodzeniem dokumentów BSON (<http://bsonspec.org/>).
105
106 %package -n libbson-devel
107 Summary:        Development files for libbson
108 Summary(pl.UTF-8):      Pliki programistyczne biblioteki libbson
109 License:        Apache v2.0
110 Group:          Development/Libraries
111 Requires:       libbson = %{version}-%{release}
112
113 %description -n libbson-devel
114 This package contains libraries and header files needed for developing
115 applications that use libbson.
116
117 %description -n libbson-devel -l pl.UTF-8
118 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
119 wykorzystujących bibliotekę libbson.
120
121 %package -n libbson-apidocs
122 Summary:        API documentation for libbson library
123 Summary(pl.UTF-8):      Dokumentacja API biblioteki libbson
124 Group:          Documentation
125
126 %description -n libbson-apidocs
127 API documentation for libbson library.
128
129 %description -n libbson-apidocs -l pl.UTF-8
130 Dokumentacja API biblioteki libbson.
131
132 %prep
133 %setup -q
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
152 %{__make} -j1
153
154 %if %{with tests}
155 : Run a server
156 install -d dbtest
157 mongod \
158         --journal \
159         --ipv6 \
160         --unixSocketPrefix /tmp \
161         --logpath $PWD/server.log \
162         --pidfilepath $PWD/server.pid \
163         --dbpath $PWD/dbtest \
164         --fork
165
166 : Run the test suite
167 ret=0
168 export MONGOC_TEST_OFFLINE=on
169 #export MONGOC_TEST_SKIP_SLOW=on
170
171 %{__make} check || ret=1
172
173 : Cleanup
174 [ -s server.pid ] && kill $(cat server.pid)
175
176 exit $ret
177 %endif
178
179 %install
180 rm -rf $RPM_BUILD_ROOT
181
182 %{__make} -C cmake-build install \
183         DESTDIR=$RPM_BUILD_ROOT
184
185 # packaged as %doc / unneeded in rpm
186 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/{COPYING,NEWS,README.rst,THIRD_PARTY_NOTICES,uninstall.sh}
187 %if %{with doc}
188 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{mongo-c-driver,libbson}/html
189 %endif
190
191 install -d $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
192 cp -a src/libmongoc/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libmongoc-%{version}
193
194 install -d $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
195 cp -a src/libbson/examples/* $RPM_BUILD_ROOT%{_examplesdir}/libbson-%{version}
196
197 %clean
198 rm -rf $RPM_BUILD_ROOT
199
200 %post   libs -p /sbin/ldconfig
201 %postun libs -p /sbin/ldconfig
202
203 %post   -n libbson -p /sbin/ldconfig
204 %postun -n libbson -p /sbin/ldconfig
205
206 %files
207 %defattr(644,root,root,755)
208 %attr(755,root,root) %{_bindir}/mongoc-stat
209
210 %files libs
211 %defattr(644,root,root,755)
212 %doc NEWS README.rst THIRD_PARTY_NOTICES
213 %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so.*.*.*
214 %attr(755,root,root) %ghost %{_libdir}/libmongoc-%{libver}.so.0
215
216 %files devel
217 %defattr(644,root,root,755)
218 %attr(755,root,root) %{_libdir}/libmongoc-%{libver}.so
219 %{_includedir}/libmongoc-%{libver}
220 %{_pkgconfigdir}/libmongoc-%{libver}.pc
221 %{_pkgconfigdir}/libmongoc-ssl-%{libver}.pc
222 %{_libdir}/cmake/libmongoc-%{libver}
223 %{_libdir}/cmake/mongoc-*.*
224 %if %{with doc}
225 %{_mandir}/man3/mongoc_*.3*
226 %endif
227 %{_examplesdir}/libmongoc-%{version}
228
229 %if %{with doc}
230 %files apidocs
231 %defattr(644,root,root,755)
232 %doc cmake-build/src/libmongoc/doc/html/{_images,_static,*.html,*.js}
233 %endif
234
235 %files -n libbson
236 %defattr(644,root,root,755)
237 %doc src/libbson/{NEWS,THIRD_PARTY_NOTICES}
238 %attr(755,root,root) %{_libdir}/libbson-%{libver}.so.*.*.*
239 %attr(755,root,root) %ghost %{_libdir}/libbson-%{libver}.so.0
240
241 %files -n libbson-devel
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_libdir}/libbson-%{libver}.so
244 %{_includedir}/libbson-%{libver}
245 %{_pkgconfigdir}/libbson-%{libver}.pc
246 %{_libdir}/cmake/bson-*.*
247 %{_libdir}/cmake/libbson-%{libver}
248 %if %{with doc}
249 %{_mandir}/man3/bson_*.3*
250 %endif
251 %{_examplesdir}/libbson-%{version}
252
253 %if %{with doc}
254 %files -n libbson-apidocs
255 %defattr(644,root,root,755)
256 %doc cmake-build/src/libbson/doc/html/{_static,*.html,*.js}
257 %endif
This page took 0.096294 seconds and 3 git commands to generate.