[packages/mongo-c-driver] up to 1.11.0

glen glen at pld-linux.org
Mon Sep 24 21:27:10 CEST 2018


commit 10e2f5001d03eb0d49f3f415d4f1357704f1207b
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Sep 24 22:17:17 2018 +0300

    up to 1.11.0
    
    - build system switched to cmake
    - libbson built from this package

 mongo-c-driver-rpm.patch |  42 -----------------
 mongo-c-driver.spec      | 120 ++++++++++++++++++++++-------------------------
 2 files changed, 57 insertions(+), 105 deletions(-)
---
diff --git a/mongo-c-driver.spec b/mongo-c-driver.spec
index 6043fc7..747846a 100644
--- a/mongo-c-driver.spec
+++ b/mongo-c-driver.spec
@@ -12,20 +12,15 @@
 
 Summary:	Client library written in C for MongoDB
 Name:		mongo-c-driver
-Version:	1.9.3
-Release:	3
+Version:	1.11.0
+Release:	1
 License:	Apache v2.0
 Group:		Libraries
 Source0:	https://github.com/mongodb/mongo-c-driver/releases/download/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	39adfe23511051c1509890e17a219d8e
-Patch0:		%{name}-rpm.patch
-Patch1:		https://github.com/mongodb/mongo-c-driver/pull/490.patch
-# Patch1-md5:	5d81ac5717da1cb9752837ae40ab0a28
+# Source0-md5:	a1241743ac6c528df0b345560dfd07eb
 URL:		https://github.com/mongodb/mongo-c-driver
-BuildRequires:	autoconf
-BuildRequires:	automake
+BuildRequires:	cmake
 %{?with_sasl:BuildRequires:	cyrus-sasl-devel}
-BuildRequires:	libbson-devel >= 1.9
 BuildRequires:	libtool
 %{?with_ssl:BuildRequires:	openssl-devel}
 BuildRequires:	perl-base
@@ -52,6 +47,7 @@ mongo-c-driver is a client library written in C for MongoDB.
 %package libs
 Summary:	Shared libraries for %{name}
 Group:		Development/Libraries
+Requires:	libbson = %{version}-%{release}
 
 %description libs
 This package contains the shared libraries for %{name}.
@@ -67,50 +63,44 @@ This package contains the header files and development libraries for
 
 Documentation: http://api.mongodb.org/c/%{version}/
 
-%prep
-%setup -q -n %{name}-%{version}%{?prever:-dev}
-%patch0 -p1
-%patch1 -p1
+%package -n libbson
+Summary:	Building, parsing, and iterating BSON documents
+License:	ASL 2.0 and ISC and MIT and zlib
+Group:		Libraries
 
-%build
-%{__aclocal} -I build/autotools -I build/autotools/m4
-%{__libtoolize}
-%{__autoconf} --include=build/autotools
-%{__automake}
-
-export LIBS=-lpthread
-
-%configure \
-	--disable-silent-rules \
-	--disable-optimizations \
-	--enable-shm-counters \
-	--disable-automatic-init-and-cleanup \
-	%{__enable_disable doc man-pages} \
-	%{__enable_disable tests} \
-	--enable-sasl=%{!?with_sasl:no}%{?with_sasl:yes} \
-	--enable-ssl=%{!?with_ssl:no}%{?with_ssl:openssl --enable-crypto-system-profile} \
-	--with-libbson=system \
-	--with-snappy=system \
-	--with-zlib=system \
-	--disable-html-docs \
-	--enable-examples \
-
-%if 0
-# remove these after autofoo as files required by automake
-#configure.ac:68: installing 'build/autotools/missing'
-#configure.ac:81: error: required file 'src/snappy-1.1.3/snappy-stubs-public.h.in' not found
-#configure.ac:81: error: required file 'src/zlib-1.2.11/zconf.h.in' not found
-rm -rf src/snappy-*
-rm -rf src/zlib-*
-rm -rf src/libbson
-%endif
+%description -n libbson
+This is a library providing useful routines related to building,
+parsing, and iterating BSON documents <http://bsonspec.org/>.
+
+%package -n libbson-devel
+Summary:	Development files for libbson
+License:	Apache v2.0
+Group:		Development/Libraries
+Requires:	libbson = %{version}-%{release}
 
-%{__make} all
+%description -n libbson-devel
+This package contains libraries and header files needed for developing
+applications that use libbson.
 
-# Explicit man target is needed for generating manual pages
-%if %{with doc}
-%{__make} doc/man
-%endif
+%prep
+%setup -q
+
+%build
+install -d cmake-build
+cd cmake-build
+%cmake \
+	-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
+	-DENABLE_EXAMPLES=ON \
+	-DENABLE_HTML_DOCS=OFF \
+	-DENABLE_MAN_PAGES=%{!?with_doc:OFF}%{?with_doc:ON} \
+	-DENABLE_SASL=%{!?with_sasl:OFF}%{?with_sasl:ON} \
+	-DENABLE_SHM_COUNTERS=ON \
+	-DENABLE_SSL=%{!?with_ssl:OFF}%{?with_ssl:OPENSSL -DENABLE_CRYPTO_SYSTEM_PROFILE=ON} \
+	-DENABLE_STATIC=OFF \
+	-DENABLE_TESTS=%{!?with_tests:OFF}%{?with_tests:ON} \
+	..
+
+%{__make}
 
 %if %{with tests}
 : Run a server
@@ -139,26 +129,18 @@ exit $ret
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%{__make} -C cmake-build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-rm $RPM_BUILD_ROOT%{_libdir}/*.la
-
-: install examples
-for i in examples/*.c examples/*/*.c; do
-	install -Dpm 644 $i $RPM_BUILD_ROOT%{_docdir}/%{name}/$i
-done
-
-: Rename documentation to match subpackage name
-mv $RPM_BUILD_ROOT%{_docdir}/%{name} \
-   $RPM_BUILD_ROOT%{_docdir}/%{name}-devel
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post   libs -p /sbin/ldconfig
 %postun libs -p /sbin/ldconfig
 
+%post   -n libbson -p /sbin/ldconfig
+%postun -n libbson -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/mongoc-stat
@@ -171,7 +153,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(644,root,root,755)
-%{_docdir}/%{name}-devel
 %{_includedir}/libmongoc-%{libver}
 %{_libdir}/libmongoc-%{libver}.so
 %{_pkgconfigdir}/libmongoc-*.pc
@@ -179,3 +160,16 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with doc}
 %{_mandir}/man3/mongoc*
 %endif
+
+%files -n libbson
+%defattr(644,root,root,755)
+%doc COPYING THIRD_PARTY_NOTICES
+%attr(755,root,root) %{_libdir}/libbson-%{libver}.so.*.*.*
+%ghost %{_libdir}/libbson-%{libver}.so.0
+
+%files -n libbson-devel
+%defattr(644,root,root,755)
+%{_includedir}/libbson-%{libver}
+%{_libdir}/libbson-%{libver}.so
+%{_libdir}/cmake/libbson-%{libver}
+%{_pkgconfigdir}/libbson-%{libver}.pc
diff --git a/mongo-c-driver-rpm.patch b/mongo-c-driver-rpm.patch
deleted file mode 100644
index e5c7679..0000000
--- a/mongo-c-driver-rpm.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-# 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
-
-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.8],
-                          [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.8],
-                          [],
-                          [AC_MSG_ERROR([
- 
-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)
- 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mongo-c-driver.git/commitdiff/10e2f5001d03eb0d49f3f415d4f1357704f1207b



More information about the pld-cvs-commit mailing list