# for better compatibility with SCL spec file %global pkg_name mongo-cxx-driver Name: mongo-cxx-driver Version: 1.0.0 Release: 0.1.rc0%{?dist} Summary: A legacy C++ Driver for MongoDB Group: Development/Libraries License: ASL 2.0 URL: https://github.com/mongodb/mongo-cxx-driver/wiki Source0: https://github.com/mongodb/%{pkg_name}/archive/legacy-%{version}-rc0.tar.gz # FIXME revise requires (pthread, ssl, llvm (for sanitizer), gcov (gnu # compiler tools test coverage), mongodb headers BuildRequires: boost-devel >= 1.49 BuildRequires: openssl-devel BuildRequires: scons # Mongodb must run on a little-endian CPU (see bug #630898) ExcludeArch: ppc ppc64 %{sparc} s390 s390x Provides: libmongodb = 2.6.0-%{release} Obsoletes: libmongodb <= 2.4.9-8 %description This package provides the shared library for the MongoDB legacy C++ Driver. %package -n %{pkg_name}-devel Summary: MongoDB header files Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Provides: libmongodb-devel = 2.6.0-%{release} Obsoletes: libmongodb-devel <= 2.4.9-8 %description -n %{pkg_name}-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 %{name}-legacy-%{version}-rc0 # CRLF -> LF sed -i 's/\r//' README.md # FIXME put lib dir in correct place # https://jira.mongodb.org/browse/SERVER-10049 # mongoclient # install-mongoclient # check-install-mongoclient # clientTests # smokeClient 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) %build # see 'scons -h' for options scons all \ %{?_smp_mflags} \ --sharedclient \ --cpppath=%{_includedir}/ \ --libpath=%{_libdir}/ \ --ssl %install # NOTE: If install flags are not the same as in %%build, # it will be built twice! scons install-mongoclient \ %{?_smp_mflags} \ --sharedclient \ --prefix=%{buildroot}%{_prefix}/ \ --cpppath=%{_includedir}/ \ --libpath=%{_libdir}/ \ --ssl # There is no option to build without static library rm -f %{buildroot}%{_libdir}/libmongoclient.a %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %doc README.md APACHE-2.0.txt %{_libdir}/libmongoclient.so.* %files -n %{pkg_name}-devel %{_includedir}/* %{_libdir}/libmongoclient.so %changelog * Tue Sep 30 2014 Marek Skalický - 1.0.0-0.1.rc0 - initial port