Subject: [alpine-aports] [PATCH] community/mongodb-tools: upgrade to 4.0.0

From: Marc Vertes <[email-masked]>
Date: Thu, 19 Jul 2018 04:19:11 +0200

---
 community/mongodb-tools/APKBUILD           |  8 ++--
 community/mongodb-tools/fix-libressl.patch | 43 ++++++++++++++++++++++
 community/mongodb-tools/libressl.patch     | 32 ----------------
 3 files changed, 47 insertions(+), 36 deletions(-)
 create mode 100644 community/mongodb-tools/fix-libressl.patch
 delete mode 100644 community/mongodb-tools/libressl.patch

diff --git a/community/mongodb-tools/APKBUILD b/community/mongodb-tools/APKBUILD
index 46f21cf96f..280bf3e95d 100644
--- a/community/mongodb-tools/APKBUILD
+++ b/community/mongodb-tools/APKBUILD
@@ -1,7 +1,7 @@
 # Contributor: Marc Vertes <[email-masked]>
 # Maintainer: Marc Vertes <[email-masked]>
 pkgname=mongodb-tools
-pkgver=3.6.4
+pkgver=4.0.0
 pkgrel=0
 pkgdesc="The MongoDB tools provide import, export, and diagnostic capabilities."
 url="https://github.com/mongodb/mongo-tools"
@@ -11,7 +11,7 @@ makedepends="$depends_dev go cyrus-sasl-dev libressl-dev libpcap-dev"
 options="!check"
 source="$pkgname-$pkgver.tar.gz::https://github.com/mongodb/mongo-tools/archive/r$pkgver.tar.gz
 	fix-build.patch
-	libressl.patch
+	fix-libressl.patch
 	"
 builddir="$srcdir"/mongo-tools-r$pkgver
 
@@ -29,6 +29,6 @@ package() {
 		"$bindir"
 }
 
-sha512sums="53d06fa4a1b58de8001d6bf6e85f7edc97ce2cfbbb69c1ab05219deaa05ad9dd77d93f98c5526b4f58644a766e1b0f123686358095f059c71a4277634603f23f  mongodb-tools-3.6.4.tar.gz
+sha512sums="d67c4aca9b41266109adc39bb1a642206738fda393e1f9f05570c02a00a02e29ec71c71e67ad232c72d66543ae7e7bfe07fbcf26958d48ed0e631da452c1904d  mongodb-tools-4.0.0.tar.gz
 74e432b354fd75209b87461e54f79a173ba0d647a2e45a48d520ee9342236b6a50ef1c634312f4804402578b8534d59ebf10973ce90cae2bbe76407102f2b404  fix-build.patch
-ddc4a5a93717dbaa6b6b816bdaaecaa6990c6b8fdf390f37e98d358cdffb9561a8ffb34a2af2c170fee7d181d343f2090b3b1a36ac4989bcc67ca493faeb946e  libressl.patch"
+8f91429dc451bd0c13738415c28c853d979cc59417f8b44a2d8e3bbea588c6c0a051019f4b7db09a6dd23e1e8fa4624c6ce7737d0eff99332e37453fa4c616b8  fix-libressl.patch"
diff --git a/community/mongodb-tools/fix-libressl.patch b/community/mongodb-tools/fix-libressl.patch
new file mode 100644
index 0000000000..18ad5c7ac7
--- /dev/null
+++ b/community/mongodb-tools/fix-libressl.patch
@@ -0,0 +1,43 @@
+--- mongo-tools-r4.0.0/vendor/src/github.com/10gen/openssl/cert.go.orig
++++ mongo-tools-r4.0.0/vendor/src/github.com/10gen/openssl/cert.go
+@@ -277,8 +277,8 @@
+ 		md = C.X_EVP_md_null()
+ 	case EVP_MD5:
+ 		md = C.X_EVP_md5()
+-	case EVP_SHA:
+-		md = C.X_EVP_sha()
++	//case EVP_SHA:
++	//	md = C.X_EVP_sha()
+ 	case EVP_SHA1:
+ 		md = C.X_EVP_sha1()
+ 	case EVP_DSS:
+--- mongo-tools-r4.0.0/vendor/src/github.com/10gen/openssl/shim.c.orig
++++ mongo-tools-r4.0.0/vendor/src/github.com/10gen/openssl/shim.c
+@@ -47,7 +47,7 @@
+  * v1.1.X and later implementation
+  ************************************************
+  */
+-#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
+ 
+ void X_BIO_set_data(BIO* bio, void* data) {
+ 	BIO_set_data(bio, data);
+@@ -174,7 +174,7 @@
+  * v1.0.X implementation
+  ************************************************
+  */
+-#if OPENSSL_VERSION_NUMBER < 0x1010000fL
++#if OPENSSL_VERSION_NUMBER < 0x1010000fL || defined(LIBRESSL_VERSION_NUMBER)
+ 
+ static int x_bio_create(BIO *b) {
+ 	b->shutdown = 1;
+@@ -260,7 +260,8 @@
+ }
+ 
+ const EVP_MD *X_EVP_sha() {
+-	return EVP_sha();
++	//return EVP_sha();
++	return NULL;
+ }
+ 
+ int X_EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) {
diff --git a/community/mongodb-tools/libressl.patch b/community/mongodb-tools/libressl.patch
deleted file mode 100644
index 0663627567..0000000000
--- a/community/mongodb-tools/libressl.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- mongo-tools-r3.4.3.orig/vendor/src/github.com/spacemonkeygo/openssl/cert.go
-+++ mongo-tools-r3.4.3/vendor/src/github.com/spacemonkeygo/openssl/cert.go
-@@ -277,8 +277,8 @@
- 		md = C.EVP_md_null()
- 	case EVP_MD5:
- 		md = C.EVP_md5()
--	case EVP_SHA:
--		md = C.EVP_sha()
-+	//case EVP_SHA:
-+	//	md = C.EVP_sha()
- 	case EVP_SHA1:
- 		md = C.EVP_sha1()
- 	case EVP_DSS:
---- mongo-tools-r3.4.3.orig/vendor/src/github.com/spacemonkeygo/openssl/version.go
-+++ mongo-tools-r3.4.3/vendor/src/github.com/spacemonkeygo/openssl/version.go
-@@ -19,4 +19,4 @@
- // #include <openssl/opensslv.h>
- import "C"
- 
--const Version string = C.OPENSSL_VERSION_TEXT
-+const Version string = "LibreSSL 2.5.5"
---- mongo-tools-r3.4.7/vendor/src/github.com/spacemonkeygo/openssl/init_posix.go.orig
-+++ mongo-tools-r3.4.7/vendor/src/github.com/spacemonkeygo/openssl/init_posix.go
-@@ -52,7 +52,7 @@
- 	return rc;
- }
- 
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- void Goopenssl_thread_locking_callback(int mode, int n, const char *file,
- 	int line) {
- 	if (mode & CRYPTO_LOCK) {
-- 
2.18.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---