File mongo-cxx-driver.spec of Package mongo-cxx-driver
# norootforbuild
#
# spec file for package mongo-cxx-driver
#
# Copyright (c) 2016 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 sover 3_3-0
%define libname libmongocxx-1.0
Name: mongo-cxx-driver
Version: 3.0.2
Release: 0
Summary: MongoDB C++ Driver
Group: System Environment/Libraries/C and C++
License: Apache-2.0
URL: https://github.com/mongodb/mongo-cxx-driver
Source0: %{name}-%{version}.tar.xz
BuildRequires: cmake >= 3.2
#BuildRequires: gcc-c++ >= 5.0
BuildRequires: clang >= 3.9
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libmongoc-1.0) >= 1.8.90
BuildRequires: pkgconfig(libbson-1.0) >= 1.8.90
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(libsasl2)
BuildRequires: pkgconfig(snappy)
BuildRequires: boost-devel
Requires: libmongocxx-%{sover} = %{version}-%{release}
%description
mongo-cxx-driver is a library for building high-performance
C++ applications that communicate with the MongoDB NoSQL
database.
This package contains the new and rewritten driver.
%package -n libmongocxx-%{sover}
Summary: A library for parsing and generating BSON documents
Group: Development/Languages/C and C++
Requires: libbsoncxx-%{sover} = %{version}-%{release}
Provides: %{libname}
Provides: libmongocxx
%description -n libmongocxx-%{sover}
libbsoncxx is a library providing useful C++ routines related to
building, parsing, and iterating BSON documents.
%package -n libmongocxx-devel
Summary: Development files for mongo-cxx-driver
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}-%{release}
Requires: libbsoncxx-devel = %{version}-%{release}
Conflicts: %{name}-devel < 3.0
%description -n libmongocxx-devel
This package contains libraries and header files for developing
C++ applications with mongodb access.
%package -n libbsoncxx-%{sover}
Summary: A library for parsing and generating BSON documents
Group: Development/Languages/C and C++
Provides: libbsoncxx
Provides: libbsoncxx-1.0
%description -n libbsoncxx-%{sover}
libbsoncxx is a library providing useful C++ routines related to
building, parsing, and iterating BSON documents.
%package -n libbsoncxx-devel
Summary: Development files for libbsoncxx
Group: Development/Libraries/C and C++
Requires: libbsoncxx-%{sover} = %{version}-%{release}
%description -n libbsoncxx-devel
This package contains libraries and header files for
developing applications that use libbson.
%prep
%setup -q
# CRLF -> LF
sed -i 's/\r//' README.md
sed -i 's/PACKAGE_LIBRARY_INSTALL_DIRS lib/PACKAGE_LIBRARY_INSTALL_DIRS %{_lib}/' src/mongocxx/CMakeLists.txt
sed -i 's/PACKAGE_LIBRARY_INSTALL_DIRS lib/PACKAGE_LIBRARY_INSTALL_DIRS %{_lib}/' src/bsoncxx/CMakeLists.txt
sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/mongocxx/CMakeLists.txt
sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/bsoncxx/CMakeLists.txt
sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/mongocxx/config/CMakeLists.txt
sed -i 's/DESTINATION lib/DESTINATION %{_lib}/g' src/bsoncxx/config/CMakeLists.txt
%build
%cmake -DCMAKE_CXX_STANDARD=14 \
-DBSONCXX_POLY_USE_BOOST=1
%install
%cmake_install
rm %{buildroot}/%{_libdir}/*._noabi ||:
%post -n libmongocxx-%{sover} -p /sbin/ldconfig
%postun -n libmongocxx-%{sover} -p /sbin/ldconfig
%post -n libbsoncxx-%{sover} -p /sbin/ldconfig
%postun -n libbsoncxx-%{sover} -p /sbin/ldconfig
%files
%doc README.md LICENSE
%files -n libmongocxx-%{sover}
%{_libdir}/libmongo*.so.*
%files -n libmongocxx-devel
%{_includedir}/mongocxx*
%{_libdir}/libmongo*.so
%{_libdir}/cmake/libmongo*
%{_libdir}/pkgconfig/libmongo*
%files -n libbsoncxx-%{sover}
%{_libdir}/libbson*.so.*
%files -n libbsoncxx-devel
%{_includedir}/bsoncxx*
%{_libdir}/libbson*.so
%{_libdir}/cmake/libbson*
%{_libdir}/pkgconfig/libbson*
%changelog