diff --git a/mongo-c-driver-rpm.patch b/mongo-c-driver-rpm.patch new file mode 100644 index 0000000..e377489 --- /dev/null +++ b/mongo-c-driver-rpm.patch @@ -0,0 +1,48 @@ +diff -up ./build/autotools/Libbson.m4.rpm ./build/autotools/Libbson.m4 +--- ./build/autotools/Libbson.m4.rpm 2017-03-08 07:12:55.174477528 +0100 ++++ ./build/autotools/Libbson.m4 2017-03-08 07:13:06.275528419 +0100 +@@ -1,14 +1,14 @@ + # If --with-libbson=auto, determine if there is a system installed libbson + # greater than our required version. + AS_IF([test "x${with_libbson}" = xauto], +- [PKG_CHECK_MODULES(BSON, [libbson-1.0 >= libbson_required_version], ++ [PKG_CHECK_MODULES(BSON, [libbson-1.0 >= 1.6], + [with_libbson=system], + [with_libbson=bundled])]) + + # If we are to use the system, check for libbson enforcing success. + AS_IF([test "x${with_libbson}" = xsystem], + [PKG_CHECK_MODULES(BSON, +- [libbson-1.0 >= libbson_required_version], ++ [libbson-1.0 >= 1.6], + [], + [AC_MSG_ERROR([ + +diff -up ./doc/conf.py.rpm ./doc/conf.py +--- ./doc/conf.py.rpm 2017-03-08 07:00:37.849097371 +0100 ++++ ./doc/conf.py 2017-03-08 07:00:37.850097376 +0100 +@@ -14,7 +14,7 @@ extensions = [ + intersphinx_mapping = { + # TODO: update to http://mongoc.org/libbson/%(version)s once libbson 1.6.0 + # is released. +- 'bson': ('http://mongoc.org/libbson/current', None), ++ 'bson': ('../src/libbson/doc/html', None), + } + + # General information about the project. +diff -up ./Makefile.am.rpm ./Makefile.am +--- ./Makefile.am.rpm 2017-03-07 14:33:43.000000000 +0100 ++++ ./Makefile.am 2017-03-08 07:00:37.848097367 +0100 +@@ -39,10 +39,10 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-sil + + mongocdocdir = ${docdir} + mongocdoc_DATA = \ +- COPYING \ + NEWS \ + README.rst \ +- THIRD_PARTY_NOTICES ++ ChangeLog \ ++ CONTRIBUTING.md + + EXTRA_DIST += $(mongocdoc_DATA) + diff --git a/mongo-c-driver.spec b/mongo-c-driver.spec index 6b5d792..947e6f6 100644 --- a/mongo-c-driver.spec +++ b/mongo-c-driver.spec @@ -25,13 +25,20 @@ Name: mongo-c-driver Summary: Client library written in C for MongoDB Version: 1.6.1 -Release: 1%{?dist} +Release: 2%{?dist} License: ASL 2.0 Group: System Environment/Libraries URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/releases/download/%{version}%{?prever:-%{prever}}/%{gh_project}-%{version}%{?prever:-%{prever}}.tar.gz +# RPM specific changes +# 1. Ignore check for libbson version = libmongoc version +# 2. Use bundled libbson documentation +# https://jira.mongodb.org/browse/CDRIVER-2078 +# 3. Don't install COPYING file which is not doc but license +Patch0: %{name}-rpm.patch + BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(libbson-1.0) > %{bsonver} BuildRequires: pkgconfig(libsasl2) @@ -78,18 +85,14 @@ Documentation: http://api.mongodb.org/c/%{version}/ %prep %setup -q -n %{gh_project}-%{version}%{?prever:-%{prever}} +%patch0 -p1 -b .rpm -# delete sources but keep doc for man pages -rm -r src/libbson/src +: Generate build scripts from sources +autoreconf --force --install --verbose -I build/autotools -# Use bundled libbson documentation -# https://jira.mongodb.org/browse/CDRIVER-2078 -sed -e 's|http://mongoc.org/libbson/current|../src/libbson/doc/html|' \ - -i doc/conf.py +: delete sources but keep doc for man pages +rm -r src/libbson/src -# Ignore check for libbson version = libmongoc version -sed -e 's/libbson-1.0 >= \$MONGOC_RELEASED_VERSION/libbson-1.0 >= %{bsonver}/' \ - -i configure %build @@ -109,6 +112,7 @@ export LIBS=-lpthread --enable-ssl \ --with-libbson=system \ --disable-html-docs \ + --enable-examples \ --enable-man-pages make %{?_smp_mflags} all V=1 @@ -119,8 +123,16 @@ make %{?_smp_mflags} man V=1 %install make install DESTDIR=%{buildroot} -rm %{buildroot}%{_libdir}/*la -rm -r %{buildroot}%{_datadir}/doc/ +rm %{buildroot}%{_libdir}/*la + +: install examples +for i in examples/*.c examples/*/*.c; do + install -Dpm 644 $i %{buildroot}%{_datadir}/doc/%{name}/$i +done + +: Rename documentation to match subpackage name +mv %{buildroot}%{_datadir}/doc/%{name} \ + %{buildroot}%{_datadir}/doc/%{name}-devel %check @@ -160,10 +172,11 @@ exit $ret %files libs %{!?_licensedir:%global license %%doc} %license COPYING +%license THIRD_PARTY_NOTICES %{_libdir}/%{libname}-%{libver}.so.* %files devel -%doc NEWS README* +%{_docdir}/%{name}-devel %{_includedir}/%{libname}-%{libver} %{_libdir}/%{libname}-%{libver}.so %{_libdir}/pkgconfig/%{libname}-*.pc @@ -171,6 +184,11 @@ exit $ret %changelog +* Wed Mar 8 2017 Remi Collet - 1.6.1-2 +- rebuild with new upstream tarball +- add examples in devel documentation +- use patch instead of sed hacks for rpm specific changes + * Tue Mar 7 2017 Remi Collet - 1.6.1-1 - update to 1.6.1 - open https://jira.mongodb.org/browse/CDRIVER-2078 diff --git a/sources b/sources index e92c02b..0e10628 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mongo-c-driver-1.6.1.tar.gz) = b2033aca7a4fc614fa9f53bb3a3854eefb05e5b907be7eef0d673bdc80a018de859b1e5ef1cacc9ef2d4b2fc947a63af9186274c6498ef69348b64264f179cd0 +SHA512 (mongo-c-driver-1.6.1.tar.gz) = 208eda60dcb126039301c896cd5c6a20d73d070cece2bb04a95d8ca1b2c23d5ba73459d8e83c6be6ec343507a50a5b0b74790acbe6fb78d50f618e561f505935