From 154b8265765cff0297d6a29032a75dfa0f3ee90c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 4 Oct 2015 09:40:48 +0200 Subject: mongo-c-driver: 1.2.0-rc0 --- mongo-c-driver-pr265.patch | 459 --------------------------------------------- mongo-c-driver.spec | 16 +- 2 files changed, 8 insertions(+), 467 deletions(-) delete mode 100644 mongo-c-driver-pr265.patch diff --git a/mongo-c-driver-pr265.patch b/mongo-c-driver-pr265.patch deleted file mode 100644 index 33243eb..0000000 --- a/mongo-c-driver-pr265.patch +++ /dev/null @@ -1,459 +0,0 @@ -From af2acd17bf4bcb5ef0d812c118628f0ccdf0680f Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 4 Sep 2015 16:58:20 +0200 -Subject: [PATCH] CDRIVER-832: export library verson in the API - ---- - CMakeLists.txt | 2 ++ - build/autotools/versions.ldscript | 5 +++ - build/cmake/libmongoc-ssl.def | 5 +++ - build/cmake/libmongoc.def | 5 +++ - doc/mongoc_check_version.page | 33 +++++++++++++++++ - doc/mongoc_get_major_version.page | 24 +++++++++++++ - doc/mongoc_get_micro_version.page | 24 +++++++++++++ - doc/mongoc_get_minor_version.page | 24 +++++++++++++ - doc/mongoc_get_version.page | 24 +++++++++++++ - doc/mongoc_version.page | 9 +++++ - src/mongoc/Makefile.am | 1 + - src/mongoc/mongoc-version.c | 76 +++++++++++++++++++++++++++++++++++++++ - src/mongoc/mongoc-version.h.in | 5 +++ - tests/Makefile.am | 1 + - tests/test-libmongoc.c | 2 ++ - tests/test-mongoc-version.c | 24 +++++++++++++ - 16 files changed, 264 insertions(+) - create mode 100644 doc/mongoc_check_version.page - create mode 100644 doc/mongoc_get_major_version.page - create mode 100644 doc/mongoc_get_micro_version.page - create mode 100644 doc/mongoc_get_minor_version.page - create mode 100644 doc/mongoc_get_version.page - create mode 100644 src/mongoc/mongoc-version.c - create mode 100644 tests/test-mongoc-version.c - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f1db842..f41017d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -125,6 +125,7 @@ set (SOURCES - ${SOURCE_DIR}/src/mongoc/mongoc-topology-description.c - ${SOURCE_DIR}/src/mongoc/mongoc-topology-scanner.c - ${SOURCE_DIR}/src/mongoc/mongoc-uri.c -+ ${SOURCE_DIR}/src/mongoc/mongoc-version.c - ${SOURCE_DIR}/src/mongoc/mongoc-util.c - ${SOURCE_DIR}/src/mongoc/mongoc-write-command.c - ${SOURCE_DIR}/src/mongoc/mongoc-write-concern.c -@@ -283,6 +284,7 @@ set(test-libmongoc-sources - ${SOURCE_DIR}/tests/test-mongoc-topology-reconcile.c - ${SOURCE_DIR}/tests/test-mongoc-topology-scanner.c - ${SOURCE_DIR}/tests/test-mongoc-uri.c -+ ${SOURCE_DIR}/tests/test-mongoc-version.c - ${SOURCE_DIR}/tests/test-mongoc-usleep.c - ${SOURCE_DIR}/tests/test-mongoc-write-concern.c - ${SOURCE_DIR}/tests/test-sasl.c -diff --git a/build/autotools/versions.ldscript b/build/autotools/versions.ldscript -index 6f0813c..0a68825 100644 ---- a/build/autotools/versions.ldscript -+++ b/build/autotools/versions.ldscript -@@ -256,4 +256,9 @@ LIBMONGOC_1.2 { - mongoc_uri_get_read_prefs_t; - mongoc_client_pool_max_size; - mongoc_client_pool_min_size; -+ mongoc_get_major_version; -+ mongoc_get_minor_version; -+ mongoc_get_micro_version; -+ mongoc_get_version; -+ mongoc_check_version; - } LIBMONGOC_1.1; -diff --git a/build/cmake/libmongoc-ssl.def b/build/cmake/libmongoc-ssl.def -index 6eca72c..7da6aad 100644 ---- a/build/cmake/libmongoc-ssl.def -+++ b/build/cmake/libmongoc-ssl.def -@@ -16,6 +16,7 @@ mongoc_bulk_operation_set_hint - mongoc_bulk_operation_set_write_concern - mongoc_bulk_operation_update - mongoc_bulk_operation_update_one -+mongoc_check_version - mongoc_cleanup - mongoc_client_command - mongoc_client_command_simple -@@ -106,6 +107,10 @@ mongoc_database_remove_all_users - mongoc_database_remove_user - mongoc_database_set_read_prefs - mongoc_database_set_write_concern -+mongoc_get_major_version -+mongoc_get_micro_version -+mongoc_get_minor_version -+mongoc_get_version - mongoc_gridfs_create_file - mongoc_gridfs_create_file_from_stream - mongoc_gridfs_destroy -diff --git a/build/cmake/libmongoc.def b/build/cmake/libmongoc.def -index 35e30bb..bab4963 100644 ---- a/build/cmake/libmongoc.def -+++ b/build/cmake/libmongoc.def -@@ -16,6 +16,7 @@ mongoc_bulk_operation_set_hint - mongoc_bulk_operation_set_write_concern - mongoc_bulk_operation_update - mongoc_bulk_operation_update_one -+mongoc_check_version - mongoc_cleanup - mongoc_client_command - mongoc_client_command_simple -@@ -104,6 +105,10 @@ mongoc_database_remove_all_users - mongoc_database_remove_user - mongoc_database_set_read_prefs - mongoc_database_set_write_concern -+mongoc_get_major_version -+mongoc_get_micro_version -+mongoc_get_minor_version -+mongoc_get_version - mongoc_gridfs_create_file - mongoc_gridfs_create_file_from_stream - mongoc_gridfs_destroy -diff --git a/doc/mongoc_check_version.page b/doc/mongoc_check_version.page -new file mode 100644 -index 0000000..07c2822 ---- /dev/null -+++ b/doc/mongoc_check_version.page -@@ -0,0 +1,33 @@ -+ -+ -+ -+ -+ -+ mongoc_check_major_version() -+ -+
-+ Synopsis -+ -+
-+ -+
-+ Parameters -+ -+ -+ -+ -+

requiredmajor

The minimum major version required.

requiredminor

The minimum minor version required.

requiredmicro

The minimum micro version required.

-+
-+ -+
-+ Returns -+

NULL if requirement is met, else the value of MONGOC_VERSION_S.

-+
-+
-diff --git a/doc/mongoc_get_major_version.page b/doc/mongoc_get_major_version.page -new file mode 100644 -index 0000000..a173504 ---- /dev/null -+++ b/doc/mongoc_get_major_version.page -@@ -0,0 +1,24 @@ -+ -+ -+ -+ -+ -+ mongoc_get_major_version() -+ -+
-+ Synopsis -+ -+
-+ -+
-+ Returns -+

The value of MONGOC_MAJOR_VERSION when Libmongoc was compiled.

-+
-+
-diff --git a/doc/mongoc_get_micro_version.page b/doc/mongoc_get_micro_version.page -new file mode 100644 -index 0000000..ba5588b ---- /dev/null -+++ b/doc/mongoc_get_micro_version.page -@@ -0,0 +1,24 @@ -+ -+ -+ -+ -+ -+ mongoc_get_micro_version() -+ -+
-+ Synopsis -+ -+
-+ -+
-+ Returns -+

The value of MONGOC_MICRO_VERSION when Libmongoc was compiled.

-+
-+
-diff --git a/doc/mongoc_get_minor_version.page b/doc/mongoc_get_minor_version.page -new file mode 100644 -index 0000000..e7b5b7f ---- /dev/null -+++ b/doc/mongoc_get_minor_version.page -@@ -0,0 +1,24 @@ -+ -+ -+ -+ -+ -+ mongoc_get_minor_version() -+ -+
-+ Synopsis -+ -+
-+ -+
-+ Returns -+

The value of MONGOC_MINOR_VERSION when Libmongoc was compiled.

-+
-+
-diff --git a/doc/mongoc_get_version.page b/doc/mongoc_get_version.page -new file mode 100644 -index 0000000..b9ca63e ---- /dev/null -+++ b/doc/mongoc_get_version.page -@@ -0,0 +1,24 @@ -+ -+ -+ -+ -+ -+ mongoc_get_major_version() -+ -+
-+ Synopsis -+ -+
-+ -+
-+ Returns -+

The value of MONGOC_VERSION_S when Libmongoc was compiled.

-+
-+
-diff --git a/doc/mongoc_version.page b/doc/mongoc_version.page -index f0cd67e..6303cd9 100644 ---- a/doc/mongoc_version.page -+++ b/doc/mongoc_version.page -@@ -33,4 +33,13 @@ static void do_something (void) { - #endif]]> - - -+
-+ See Also -+

mongoc_get_major_version().

-+

mongoc_get_minor_version().

-+

mongoc_get_micro_version().

-+

mongoc_get_version().

-+

mongoc_check_version().

-+
-+ - -diff --git a/src/mongoc/Makefile.am b/src/mongoc/Makefile.am -index 1c8b1b4..dc0a5c1 100644 ---- a/src/mongoc/Makefile.am -+++ b/src/mongoc/Makefile.am -@@ -150,6 +150,7 @@ MONGOC_SOURCES_SHARED += \ - src/mongoc/mongoc-topology-scanner.c \ - src/mongoc/mongoc-uri.c \ - src/mongoc/mongoc-util.c \ -+ src/mongoc/mongoc-version.c \ - src/mongoc/mongoc-write-command.c \ - src/mongoc/mongoc-write-concern.c - -diff --git a/src/mongoc/mongoc-version.c b/src/mongoc/mongoc-version.c -new file mode 100644 -index 0000000..b353282 ---- /dev/null -+++ b/src/mongoc/mongoc-version.c -@@ -0,0 +1,76 @@ -+/* -+ * Copyright 2015 MongoDB, Inc. -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+ -+#include "mongoc.h" -+#include "mongoc-version.h" -+ -+/** -+ * mongoc_get_major_version: -+ * -+ * Helper function to return the runtime major version of the library. -+ */ -+int -+mongoc_get_major_version (void) -+{ -+ return MONGOC_MAJOR_VERSION; -+} -+ -+ -+/** -+ * mongoc_get_minor_version: -+ * -+ * Helper function to return the runtime minor version of the library. -+ */ -+int -+mongoc_get_minor_version (void) -+{ -+ return MONGOC_MINOR_VERSION; -+} -+ -+/** -+ * mongoc_get_micro_version: -+ * -+ * Helper function to return the runtime micro version of the library. -+ */ -+int -+mongoc_get_micro_version (void) -+{ -+ return MONGOC_MICRO_VERSION; -+} -+ -+/** -+ * mongoc_get_version: -+ * -+ * Helper function to return the runtime string version of the library. -+ */ -+const char * -+mongoc_get_version (void) -+{ -+ return MONGOC_VERSION_S; -+} -+ -+/** -+ * mongoc_check_version: -+ * -+ * Helper function to check the runtime string version of the library. -+ * return NULL it met the required version, else return the version string. -+ */ -+const char * -+mongoc_check_version (int requiredmajor, int requiredminor, int requiredmicro) -+{ -+ return (MONGOC_CHECK_VERSION(requiredmajor, requiredminor, requiredmicro) ? NULL : MONGOC_VERSION_S); -+} -diff --git a/src/mongoc/mongoc-version.h.in b/src/mongoc/mongoc-version.h.in -index 917a647..536938d 100644 ---- a/src/mongoc/mongoc-version.h.in -+++ b/src/mongoc/mongoc-version.h.in -@@ -91,5 +91,10 @@ - (MONGOC_MAJOR_VERSION == (major) && MONGOC_MINOR_VERSION == (minor) && \ - MONGOC_MICRO_VERSION >= (micro))) - -+int mongoc_get_major_version (void); -+int mongoc_get_minor_version (void); -+int mongoc_get_micro_version (void); -+const char *mongoc_get_version (void); -+const char *mongoc_check_version (int requiredmajor, int requiredminor, int requiredmicro); - - #endif /* MONGOC_VERSION_H */ -diff --git a/tests/Makefile.am b/tests/Makefile.am -index 5fe375f..1c8dcd1 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -121,6 +121,7 @@ test_libmongoc_SOURCES = \ - tests/test-mongoc-topology.c \ - tests/test-mongoc-uri.c \ - tests/test-mongoc-usleep.c \ -+ tests/test-mongoc-version.c \ - tests/test-mongoc-write-concern.c \ - tests/test-libmongoc.h \ - tests/test-sasl.c \ -diff --git a/tests/test-libmongoc.c b/tests/test-libmongoc.c -index 1c5bc1b4..65380d1 100644 ---- a/tests/test-libmongoc.c -+++ b/tests/test-libmongoc.c -@@ -26,6 +26,7 @@ - #include "test-libmongoc.h" - - -+extern void test_version_install (TestSuite *suite); - extern void test_array_install (TestSuite *suite); - extern void test_async_install (TestSuite *suite); - extern void test_buffer_install (TestSuite *suite); -@@ -887,6 +888,7 @@ main (int argc, - - TestSuite_Init (&suite, "", argc, argv); - -+ test_version_install (&suite); - test_array_install (&suite); - test_async_install (&suite); - test_buffer_install (&suite); -diff --git a/tests/test-mongoc-version.c b/tests/test-mongoc-version.c -new file mode 100644 -index 0000000..995aa28 ---- /dev/null -+++ b/tests/test-mongoc-version.c -@@ -0,0 +1,24 @@ -+#include -+ -+#include "TestSuite.h" -+ -+#include "test-libmongoc.h" -+ -+static void -+test_mongoc_version (void) -+{ -+ ASSERT_CMPINT(mongoc_get_major_version(), ==, MONGOC_MAJOR_VERSION); -+ ASSERT_CMPINT(mongoc_get_minor_version(), ==, MONGOC_MINOR_VERSION); -+ ASSERT_CMPINT(mongoc_get_micro_version(), ==, MONGOC_MICRO_VERSION); -+ ASSERT_CMPSTR(mongoc_get_version(), MONGOC_VERSION_S); -+ -+ ASSERT (0 == mongoc_check_version(1,0,0)); -+ ASSERT (0 == mongoc_check_version(MONGOC_MAJOR_VERSION, MONGOC_MINOR_VERSION, MONGOC_MICRO_VERSION)); -+ ASSERT (0 != mongoc_check_version(MONGOC_MAJOR_VERSION, MONGOC_MINOR_VERSION+1, MONGOC_MICRO_VERSION)); -+} -+ -+void -+test_version_install (TestSuite *suite) -+{ -+ TestSuite_Add (suite, "/Version", test_mongoc_version); -+} diff --git a/mongo-c-driver.spec b/mongo-c-driver.spec index 94431b9..cb25479 100644 --- a/mongo-c-driver.spec +++ b/mongo-c-driver.spec @@ -8,25 +8,23 @@ # %global gh_owner mongodb %global gh_project mongo-c-driver -%global gh_commit 3eaf73ed8a88340584a203520ee9ad98fd1b89d3 +%global gh_commit c45526094073e13f2c391c8057fa39e77d20b6b4 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_date 20150903 +#global gh_date 20151001 %global with_tests 0%{!?_without_tests:1} %global libname libmongoc %global libver 1.0 -%global prever beta1 +%global prever rc0 Name: mongo-c-driver Summary: Client library written in C for MongoDB Version: 1.2.0 %if 0%{?gh_date} -Release: 0.5.%{gh_date}git%{gh_short}%{?dist} +Release: 0.6.%{gh_date}git%{gh_short}%{?dist} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{gh_short}.tar.gz -# https://github.com/mongodb/mongo-c-driver/pull/265 -Patch0: %{name}-pr265.patch BuildRequires: libtool autoconf %else -Release: 0.4.%{prever}%{?dist} +Release: 0.6.%{prever}%{?dist} Source0: https://github.com/%{gh_owner}/%{gh_project}/releases/download/%{version}%{?prever:-%{prever}}/%{gh_project}-%{version}%{?prever:-%{prever}}.tar.gz %endif License: ASL 2.0 @@ -79,7 +77,6 @@ a MongoDB Server. %prep %if 0%{?gh_date} %setup -q -n %{gh_project}-%{gh_commit} -%patch0 -p1 -b .pr265 autoreconf -fvi -I build/autotools %else %setup -q -n %{gh_project}-%{version}%{?prever:-%{prever}} @@ -162,6 +159,9 @@ exit $ret %changelog +* Sun Oct 4 2015 Remi Collet - 1.2.0-0.6.rc0 +- Update to 1.2.0-rc0 + * Fri Sep 11 2015 Remi Collet - 1.2.0-0.5.20150903git3eaf73e - add patch to export library verson in the API open https://github.com/mongodb/mongo-c-driver/pull/265 -- cgit