File mongo-c-driver.spec of Package mongo-c-driver
#
# spec file for package mongo-c-driver
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define DriverName mongo-c-driver
%define MongocName libmongoc-1_0-0
%define BsonName libbson-1_0-0
Name: %{MongocName}
Version: 1.13.0
Release: 0
Summary: MongoDB C Driver
License: Apache-2.0
Group: Development/Libraries/C and C++
URL: https://github.com/mongodb/mongo-c-driver
Source0: %{DriverName}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: cyrus-sasl-devel
BuildRequires: libtool
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: python3
BuildRequires: python3-Sphinx
BuildRequires: python3-xml
BuildRequires: snappy-devel
Provides: %{DriverName} = %{version}
%description
mongo-c-driver is a library for building high-performance
applications that communicate with the MongoDB NoSQL
database in the C language. It can also be used to write
fast client implementations in languages such as Python,
Ruby, or Perl.
%package devel
Summary: Development files for mongo-c-driver
Group: Development/Libraries/C and C++
Requires: %{MongocName} = %{version}
%description devel
The %{MongocName}-devel package contains libraries and header files for
developing applications that use %{DriverName}.
%package -n %{BsonName}
Summary: A library for parsing and generating BSON documents
Group: System/Libraries
%description -n %{BsonName}
Libbson is a library providing useful routines related to
building, parsing, and iterating BSON documents. It is a
useful base for those wanting to write high-performance
C extensions to higher level languages such as Python,
Ruby, or Perl.
%package -n %{BsonName}-devel
Summary: Development files for libbson
Group: Development/Libraries/C and C++
Requires: %{BsonName} = %{version}
%description -n %{BsonName}-devel
The %{BsonName}-devel package contains libraries and header files for
developing applications that use %{BsonName}.
%prep
%setup -q -n %{DriverName}-%{version}
#sed - i 's/MONGOC_VERSION \"\${MONGOC_MAJOR_VERSION}.\${MONGOC_MINOR_VERSION}.\${MONGOC_MICRO_VERSION}\"/MONGOC_VERSION %{version}/' CMakeLists.txt
%build
%cmake \
-DENABLE_BSON=ON \
-DENABLE_STATIC=OFF \
-DENABLE_TESTS=OFF
make %{?_smp_mflags}
%install
%cmake_install
rm -R %{buildroot}/%{_datadir}/%{DriverName} ||:
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n %{BsonName} -p /sbin/ldconfig
%postun -n %{BsonName} -p /sbin/ldconfig
%files
%{_libdir}/libmongoc-1.0.so.*
%files -n %{BsonName}
%{_libdir}/libbson-1.0.so.*
%files devel
%dir %{_includedir}/libmongoc-1.0*
%{_includedir}/libmongoc-1.0/mongoc*
%{_libdir}/libmongoc-1.0.so
%{_libdir}/pkgconfig/libmongoc-1.0.pc
%{_libdir}/pkgconfig/libmongoc-ssl-1.0.pc
%dir %{_libdir}/cmake
%{_libdir}/cmake/libmongoc-1.0
%{_bindir}/mongoc-stat
%files -n %{BsonName}-devel
%dir %{_includedir}/libbson-1.0*
%{_includedir}/libbson-1.0/bson*
%{_libdir}/libbson-1.0.so
%{_libdir}/pkgconfig/libbson-1.0.pc
%dir %{_libdir}/cmake
%{_libdir}/cmake/libbson-1.0
%changelog