# for better compatibility with SCL spec file %global pkg_name mongo-cxx-driver Name: mongo-cxx-driver Version: 0.11.0 Release: 1%{?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}.tar.gz#/%{pkg_name}-%{version}.tar.gz # FIXME revise requires (pthread, ssl, llvm (for sanitizer), gcov (gnu # compiler tools test coverage), mongodb headers BuildRequires: boost-devel >= 1.44 BuildRequires: openssl-devel BuildRequires: libgcrypt-devel BuildRequires: scons %description A legacy C++ Driver for MongoDB. %package -n lib%{pkg_name} Summary: MongoDB shared libraries Group: Development/Libraries %description -n lib%{pkg_name} Shared library for the MongoDB client. %prep # -n the name of the directory to cd after unpacking %setup -q -n %{name}-legacy-%{version} #%%setup -q -n %{pkg_name}-r%{version} # 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 *= *env.Clone.*)|\1$pre\n\1\2\n\1$post|" \ -e "s|(sharedLibEnv.)Install *\(|\1InstallVersionedLib(|" \ src/SConscript.client) %build # see add_option() calls in SConstruct for options # note, that scons outputs nonsensical errors when some lib is missing (e.g. # --ssl requires `ssl' and `crypto', i.e. `openssl-devel' and # `libgcrypt-devel') scons \ %{?_smp_mflags} \ --sharedclient \ --prefix=%{buildroot}%{_prefix}/ \ --cpppath=%{_includedir}/ \ --libpath=%{_libdir}/ \ --ssl %install # NOTE: If install flags are not EXACTLY the same as in %%build, # it will be built twice! scons install \ %{?_smp_mflags} \ --sharedclient \ --prefix=%{buildroot}%{_prefix}/ \ --cpppath=%{_includedir}/ \ --libpath=%{_libdir}/ \ --ssl # FIXME still needed? #rm -f %{buildroot}%{_lib}/libmongoclient.a #rm -f %{buildroot}%{_lib}/../lib/libmongoclient.a # TODO EPEL 4 & 5 expands to %{_prefix}/com, otherwise to /var/lib #mkdir -p %{buildroot}%{_sharedstatedir}/%{pkg_name} mkdir -p %{buildroot}%{_localstatedir}/lib/%{pkg_name} install -d -m 755 %{buildroot}%{_mandir}/man1 install -p -m 644 debian/*.1 %{buildroot}%{_mandir}/man1/ %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %doc README.md APACHE-2.0.txt #%{_mandir}/man1/mongotop.1* %files -n lib%{pkg_name} %{_lib}/libmongoclient.so.%{version} %changelog