# for better compatibility with SCL spec file %global pkg_name mongo-cxx-driver Name: mongo-cxx-driver-legacy Version: 1.1.3 Release: 2%{?dist} Summary: A legacy C++ Driver for MongoDB License: ASL 2.0 and MIT and BSD and zlib and Public Domain URL: https://github.com/mongodb/mongo-cxx-driver/wiki Source0: https://github.com/mongodb/%{pkg_name}/archive/legacy-%{version}.tar.gz Patch1: openssl-cipher-list.patch BuildRequires: boost-devel >= 1.49 BuildRequires: compat-openssl10-devel BuildRequires: scons BuildRequires: cyrus-sasl-devel BuildRequires: gcc-c++ BuildRequires: gtest-devel Obsoletes: mongo-cxx-driver <= 1.1.2 %description This package provides the shared library for the MongoDB legacy C++ Driver. %package devel Summary: MongoDB header files Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: mongo-cxx-driver-devel <= 1.1.2 Conflicts: mongo-cxx-driver-devel %description devel This package provides the header files for MongoDB legacy C++ driver. %prep # -n the name of the directory to cd after unpacking %setup -q -n %{pkg_name}-legacy-%{version} %patch1 -p1 # CRLF -> LF sed -i 's/\r//' README.md # use _lib sed -i -e "s@\$INSTALL_DIR/lib@\$INSTALL_DIR/%{_lib}@g" src/SConscript.client # versioned client library (pre='EnsureSConsVersion(2, 3, 0)' post='sharedLibEnv.AppendUnique(SHLIBVERSION="%{version}")' sed -i -r \ -e "s|([[:space:]]*)(sharedLibEnv *= *libEnv.Clone.*)|\1$pre\n\1\2\n\1$post|" \ -e "s|(sharedLibEnv.)Install *\(|\1InstallVersionedLib(|" \ src/SConscript.client) # use optflags (opt=$(echo "%{optflags}" | sed -r -e 's| |","|g' ) sed -i -r -e "s|(if nix:)|\1\n\n env.Append( CCFLAGS=[\"$opt\"] )\n\n|" SConstruct) # fix one unit test which uses gnu++11 code (c++11 is used) sed -i 's|ASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10);||' src/mongo/base/parse_number_test.cpp # Fix boost:ref usage in examples sed -i -r -e "s|boost::ref|std::ref|g" src/mongo/client/examples/connect.cpp %build # see 'scons -h' for options scons \ %{?_smp_mflags} \ --sharedclient \ --ssl \ --c++11 \ --disable-warnings-as-errors \ --opt=off \ --use-sasl-client %install # NOTE: If install flags are not the same as in %%build, # it will be built twice! scons install \ %{?_smp_mflags} \ --sharedclient \ --ssl \ --c++11 \ --disable-warnings-as-errors \ --opt=off \ --use-sasl-client \ --prefix=%{buildroot}%{_prefix} # There is no option to build without static library rm -f %{buildroot}%{_libdir}/libmongoclient.a %check # Run tests LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH \ scons unit \ %{?_smp_mflags} \ --sharedclient \ --ssl \ --c++11 \ --disable-warnings-as-errors \ --opt=off \ --use-sasl-client \ --gtest-filter=-SASL* \ --propagate-shell-environment %files %doc README.md %license APACHE-2.0.txt THIRD-PARTY-NOTICES %{_libdir}/libmongoclient.so.1* %files devel %{_includedir}/* %{_libdir}/libmongoclient.so %changelog * Thu Oct 04 2018 mskalick@redhat.com - 1.1.3-2 - Additional fixes of issues from package review * Wed Oct 03 2018 mskalick@redhat.com - 1.1.3-1 - Fix issues found during package review - Rebase to latest upstream release * Tue Oct 02 2018 mskalick@redhat.com - 1.1.2-1 - Initial packaging based on mongo-cxx-driver package