diff --git a/.gitignore b/.gitignore
index c6672af..f0907c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
-SOURCES/ldb-2.2.0.tar.gz
+SOURCES/fixed-guidindexpackv1.ldb
+SOURCES/ldb-2.3.0.tar.gz
 SOURCES/ldb.keyring
diff --git a/.libldb.metadata b/.libldb.metadata
index b564ab1..6d4848d 100644
--- a/.libldb.metadata
+++ b/.libldb.metadata
@@ -1,2 +1,3 @@
-7c6d0827a20195636fcd84d713eea278d39064d4 SOURCES/ldb-2.2.0.tar.gz
+c3b43fb6d944c7fb78dbfd2d696cbe18d2cb418a SOURCES/fixed-guidindexpackv1.ldb
+71c12e1c5914172c450c992dae3b90c1f01b2419 SOURCES/ldb-2.3.0.tar.gz
 8ac6d09878c4218fb8e365fcf5a877a621dd40f9 SOURCES/ldb.keyring
diff --git a/SOURCES/1420.patch b/SOURCES/1420.patch
deleted file mode 100644
index c2199ef..0000000
--- a/SOURCES/1420.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 0e4fd77c1e03fe6351d129f2161b0b3313f5fa3d Mon Sep 17 00:00:00 2001
-From: Mathieu Parent <math.parent@gmail.com>
-Date: Thu, 25 Jun 2020 09:48:04 +0200
-Subject: [PATCH] Fix FTBFS / Increase the over-estimation for sparse files
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=14418
-Signed-off-by: Mathieu Parent <math.parent@gmail.com>
----
- tests/ldb_kv_ops_test.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/lib/ldb/tests/ldb_kv_ops_test.c b/lib/ldb/tests/ldb_kv_ops_test.c
-index 30adebf1952..9db2212895f 100644
---- a/tests/ldb_kv_ops_test.c
-+++ b/tests/ldb_kv_ops_test.c
-@@ -1717,8 +1717,11 @@ static void test_get_size(void **state)
- 	/*
- 	 * The tdb implementation of get_size over estimates for sparse files
- 	 * which is perfectly acceptable for it's intended use.
-+	 * mipsel, ia64: 9994
-+	 * ppc64el, powerpc, ppc64: 13369
-+	 * sparc64: 5046
- 	 */
--	assert_in_range(size, 2500, 5000);
-+	assert_in_range(size, 2500, 15000);
- #endif
- 
- 	/*
-@@ -1746,8 +1749,11 @@ static void test_get_size(void **state)
- 	/*
- 	 * The tdb implementation of get_size over estimates for sparse files
- 	 * which is perfectly acceptable for it's intended use.
-+	 * mipsel, ia64: 9994
-+	 * ppc64el, powerpc, ppc64: 13369
-+	 * sparc64: 5046
- 	 */
--	assert_in_range(size, 2500, 5000);
-+	assert_in_range(size, 2500, 15000);
- #endif
- 	talloc_free(tmp_ctx);
- }
--- 
-GitLab
-
diff --git a/SOURCES/CVE-2021-20277.patch b/SOURCES/CVE-2021-20277.patch
deleted file mode 100644
index cecf546..0000000
--- a/SOURCES/CVE-2021-20277.patch
+++ /dev/null
@@ -1,303 +0,0 @@
-From 3895ccd4de3fd5d900b7c1122d912f0a06c2b069 Mon Sep 17 00:00:00 2001
-From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-Date: Fri, 5 Mar 2021 15:47:56 +1300
-Subject: [PATCH 1/4] ldb: add tests for ldb_wildcard_compare
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=14044
-
-Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-Reviewed-by: Björn Jacke <bjacke@samba.org>
-Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-
-(cherry-picked from commit 33a95a1e75b85e9795c4490b78ead2162e2a1f47)
----
- lib/ldb/tests/ldb_match_test.c | 134 ++++++++++++++++++++++++++++++---
- 1 file changed, 124 insertions(+), 10 deletions(-)
-
-diff --git a/tests/ldb_match_test.c b/tests/ldb_match_test.c
-index e09f50c86ba..3028aed072c 100644
---- a/tests/ldb_match_test.c
-+++ b/tests/ldb_match_test.c
-@@ -91,6 +91,33 @@ static int teardown(void **state)
- 	return 0;
- }
- 
-+static void escape_string(uint8_t *buf, size_t buflen,
-+			  const uint8_t *s, size_t len)
-+{
-+	size_t i;
-+	size_t j = 0;
-+	for (i = 0; i < len; i++) {
-+		if (j == buflen - 1) {
-+			goto fin;
-+		}
-+		if (s[i] >= 0x20) {
-+			buf[j] = s[i];
-+			j++;
-+		} else {
-+			if (j >= buflen - 4) {
-+				goto fin;
-+			}
-+			/* utf-8 control char representation */
-+			buf[j] = 0xE2;
-+			buf[j + 1] = 0x90;
-+			buf[j + 2] = 0x80 + s[i];
-+			j+= 3;
-+		}
-+	}
-+fin:
-+	buf[j] = 0;
-+}
-+
- 
- /*
-  * The wild card pattern "attribute=*" is parsed as an LDB_OP_PRESENT operation
-@@ -122,23 +149,110 @@ static void test_wildcard_match_star(void **state)
-  * Test basic wild card matching
-  *
-  */
-+struct wildcard_test {
-+	uint8_t *val;
-+	size_t val_size;
-+	const char *search;
-+	bool should_match;
-+	bool fold;
-+};
-+
-+/*
-+ * Q: Why this macro rather than plain struct values?
-+ * A: So we can get the size of the const char[] value while it is still a
-+ * true array, not a pointer.
-+ *
-+ * Q: but why not just use strlen?
-+ * A: so values can contain '\0', which we supposedly allow.
-+ */
-+
-+#define TEST_ENTRY(val, search, should_match, fold)	\
-+	{						\
-+		(uint8_t*)discard_const(val),		\
-+		sizeof(val) - 1,			\
-+		search,					\
-+		should_match,				\
-+		fold					\
-+	 }
-+
- static void test_wildcard_match(void **state)
- {
- 	struct ldbtest_ctx *ctx = *state;
--	bool matched = false;
--
--	uint8_t value[] = "The value.......end";
--	struct ldb_val val = {
--		.data   = value,
--		.length = (sizeof(value))
-+	size_t failed = 0;
-+	size_t i;
-+	struct wildcard_test tests[] = {
-+		TEST_ENTRY("The value.......end", "*end", true, true),
-+		TEST_ENTRY("The value.......end", "*fend", false, true),
-+		TEST_ENTRY("The value.......end", "*eel", false, true),
-+		TEST_ENTRY("The value.......end", "*d", true, true),
-+		TEST_ENTRY("The value.......end", "*D*", true, true),
-+		TEST_ENTRY("The value.......end", "*e*d*", true, true),
-+		TEST_ENTRY("end", "*e*d*", true, true),
-+		TEST_ENTRY("end", "  *e*d*", true, true),
-+		TEST_ENTRY("1.0.0.0.0.0.0.0aaaaaaaaaaaa", "*aaaaa", true, true),
-+		TEST_ENTRY("1.0..0.0.0.0.0.0.0aAaaaAAAAAAA", "*a", true,  true),
-+		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0.0aaaa", "*aaaaa", false, true),
-+		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0.0", "*0.0", true, true),
-+		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0.0", "*0.0.0", true, true),
-+		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0", "1*0*0*0*0*0*0*0*0*0", true,
-+			   true),
-+		TEST_ENTRY("1.0.0.0.0.0.0.0.0", "1*0*0*0*0*0*0*0*0*0", false,
-+			   true),
-+		TEST_ENTRY("1.0.0.0.000.0.0.0.0", "1*0*0*0*0*0*0*0*0*0", true,
-+			   true),
-+		TEST_ENTRY("1\n0\r0\t000.0.0.0.0", "1*0*0*0*0*0*0*0*0", true,
-+			   true),
-+		/*
-+		 *  We allow NUL bytes in non-casefolding syntaxes.
-+		 */
-+		TEST_ENTRY("1\x00 x", "1*x", true, false),
-+		TEST_ENTRY("1\x00 x", "*x", true, false),
-+		TEST_ENTRY("1\x00 x", "*x*", true, false),
-+		TEST_ENTRY("1\x00 x", "* *", true, false),
-+		TEST_ENTRY("1\x00 x", "1*", true, false),
-+		TEST_ENTRY("1\x00 b* x", "1*b*", true, false),
-+		TEST_ENTRY("1.0..0.0.0.0.0.0.0aAaaaAAAAAAA", "*a", false,  false),
- 	};
--	struct ldb_parse_tree *tree = ldb_parse_tree(ctx, "objectClass=*end");
--	assert_non_null(tree);
- 
--	ldb_wildcard_compare(ctx->ldb, tree, val, &matched);
--	assert_true(matched);
-+	for (i = 0; i < ARRAY_SIZE(tests); i++) {
-+		bool matched;
-+		int ret;
-+		struct ldb_val val = {
-+			.data   = (uint8_t *)tests[i].val,
-+			.length = tests[i].val_size
-+		};
-+		const char *attr = tests[i].fold ? "objectclass" : "birthLocation";
-+		const char *s = talloc_asprintf(ctx, "%s=%s",
-+						attr, tests[i].search);
-+		struct ldb_parse_tree *tree = ldb_parse_tree(ctx, s);
-+		assert_non_null(tree);
-+		ret = ldb_wildcard_compare(ctx->ldb, tree, val, &matched);
-+		if (ret != LDB_SUCCESS) {
-+			uint8_t buf[100];
-+			escape_string(buf, sizeof(buf),
-+				      tests[i].val, tests[i].val_size);
-+			print_error("%zu val: «%s», search «%s» FAILED with %d\n",
-+				    i, buf, tests[i].search, ret);
-+			failed++;
-+		}
-+		if (matched != tests[i].should_match) {
-+			uint8_t buf[100];
-+			escape_string(buf, sizeof(buf),
-+				      tests[i].val, tests[i].val_size);
-+			print_error("%zu val: «%s», search «%s» should %s\n",
-+				    i, buf, tests[i].search,
-+				    matched ? "not match" : "match");
-+			failed++;
-+		}
-+	}
-+	if (failed != 0) {
-+		fail_msg("wrong results for %zu/%zu wildcard searches\n",
-+			 failed, ARRAY_SIZE(tests));
-+	}
- }
- 
-+#undef TEST_ENTRY
-+
- 
- /*
-  * ldb_handler_copy and ldb_val_dup over allocate by one and add a trailing '\0'
--- 
-2.25.1
-
-
-From 984842f9881e7e72b1bcd032ad0245d08f79888d Mon Sep 17 00:00:00 2001
-From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-Date: Fri, 5 Mar 2021 20:13:01 +1300
-Subject: [PATCH 2/4] CVE-2021-20277 ldb tests: ldb_match tests with extra
- spaces
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=14655
-
-Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-(cherry-picked from commit for master)
----
- lib/ldb/tests/ldb_match_test.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/tests/ldb_match_test.c b/tests/ldb_match_test.c
-index 3028aed072c..ba6ea56be15 100644
---- a/tests/ldb_match_test.c
-+++ b/tests/ldb_match_test.c
-@@ -181,6 +181,8 @@ static void test_wildcard_match(void **state)
- 	size_t failed = 0;
- 	size_t i;
- 	struct wildcard_test tests[] = {
-+		TEST_ENTRY("                     1  0", "1*0*", true, true),
-+		TEST_ENTRY("                     1  0", "1 *0", true, true),
- 		TEST_ENTRY("The value.......end", "*end", true, true),
- 		TEST_ENTRY("The value.......end", "*fend", false, true),
- 		TEST_ENTRY("The value.......end", "*eel", false, true),
-@@ -203,8 +205,12 @@ static void test_wildcard_match(void **state)
- 		TEST_ENTRY("1\n0\r0\t000.0.0.0.0", "1*0*0*0*0*0*0*0*0", true,
- 			   true),
- 		/*
--		 *  We allow NUL bytes in non-casefolding syntaxes.
-+		 *  We allow NUL bytes and redundant spaces in non-casefolding
-+		 *  syntaxes.
- 		 */
-+		TEST_ENTRY("                  1  0", "*1  0", true, false),
-+		TEST_ENTRY("                  1  0", "*1  0", true, false),
-+		TEST_ENTRY("1    0", "*1 0", false, false),
- 		TEST_ENTRY("1\x00 x", "1*x", true, false),
- 		TEST_ENTRY("1\x00 x", "*x", true, false),
- 		TEST_ENTRY("1\x00 x", "*x*", true, false),
--- 
-2.25.1
-
-
-From a3ea9b5cfd98e9c62d99b42e7ebd4af1549a0d26 Mon Sep 17 00:00:00 2001
-From: Andrew Bartlett <abartlet@samba.org>
-Date: Fri, 12 Mar 2021 11:51:56 +1300
-Subject: [PATCH 3/4] CVE-2021-20277 ldb: Remove tests from ldb_match_test that
- do not pass
-
-This reverts some of the backport of 33a95a1e75b85e9795c4490b78ead2162e2a1f47
-
-This is done here rather than squashed in the cherry-pick of the expanded testsuite
-because it allows this commit to be simply reverted for the backport of bug 14044
-if this lands first, or to be dropped if bug 14044 lands first.
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=14655
-
-Signed-off-by: Andrew Bartlett <abartlet@samba.org>
-Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
----
- lib/ldb/tests/ldb_match_test.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/tests/ldb_match_test.c b/tests/ldb_match_test.c
-index ba6ea56be15..fbf4106fa78 100644
---- a/tests/ldb_match_test.c
-+++ b/tests/ldb_match_test.c
-@@ -191,11 +191,9 @@ static void test_wildcard_match(void **state)
- 		TEST_ENTRY("The value.......end", "*e*d*", true, true),
- 		TEST_ENTRY("end", "*e*d*", true, true),
- 		TEST_ENTRY("end", "  *e*d*", true, true),
--		TEST_ENTRY("1.0.0.0.0.0.0.0aaaaaaaaaaaa", "*aaaaa", true, true),
- 		TEST_ENTRY("1.0..0.0.0.0.0.0.0aAaaaAAAAAAA", "*a", true,  true),
- 		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0.0aaaa", "*aaaaa", false, true),
- 		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0.0", "*0.0", true, true),
--		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0.0", "*0.0.0", true, true),
- 		TEST_ENTRY("1.0.0.0.0.0.0.0.0.0", "1*0*0*0*0*0*0*0*0*0", true,
- 			   true),
- 		TEST_ENTRY("1.0.0.0.0.0.0.0.0", "1*0*0*0*0*0*0*0*0*0", false,
--- 
-2.25.1
-
-
-From 8fc0753ae7e2a2101c52574886e975ec8e90aee1 Mon Sep 17 00:00:00 2001
-From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-Date: Tue, 8 Dec 2020 21:32:09 +1300
-Subject: [PATCH 4/4] CVE-2021-20277 ldb/attrib_handlers casefold: stay in
- bounds
-
-For a string that had N spaces at the beginning, we would
-try to move N bytes beyond the end of the string.
-
-BUG: https://bugzilla.samba.org/show_bug.cgi?id=14655
-
-Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-
-(cherry-picked from commit for master)
----
- lib/ldb/common/attrib_handlers.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/common/attrib_handlers.c b/common/attrib_handlers.c
-index b5212b73159..c6ef5ad477b 100644
---- a/common/attrib_handlers.c
-+++ b/common/attrib_handlers.c
-@@ -76,7 +76,7 @@ int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx,
- 	
- 	/* remove leading spaces if any */
- 	if (*s == ' ') {
--		for (t = s; *s == ' '; s++) ;
-+		for (t = s; *s == ' '; s++, l--) ;
- 
- 		/* remove leading spaces by moving down the string */
- 		memmove(t, s, l);
--- 
-2.25.1
-
diff --git a/SOURCES/ldb-2.2.0.tar.asc b/SOURCES/ldb-2.2.0.tar.asc
deleted file mode 100644
index d8ff672..0000000
--- a/SOURCES/ldb-2.2.0.tar.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQFJBAABCgAzFiEEkUejOXGVGO6QEby1R5ORYRMIQCUFAl8HCQwVHHNhbWJhLWJ1
-Z3NAc2FtYmEub3JnAAoJEEeTkWETCEAlrwkH/A/MJM5E0Pyz6HNdctHSrA97FB6Q
-JI1MnsyXerZXfDulcUFmyrNPp66gLGeNGG2X9eoxvWrZk3hPnYe9YPE6UiwCKxZu
-1CSp2JuwaVB6EoUxUIuh63DFlF9Th/ZEhPsBrP3tQHvZyGpTDOQq3qhV7FLsrIwO
-RstK5CJIqmgwy84oJmKanWLWfTqdp/HBvVsZw0/kZ0Kr+3DUcM9MaY7hifMpcSOV
-8HTMgIpEoPbKkNOMj2lkDiYcx3tLWtdMYQdN31Cng3X9n5XmLX0GQlfCjfediSkT
-vK2RGlIp/hlEXOSyIG2mJync+u4NCOv7r8EEcVhjHDYOflIvfOiwbITtWMg=
-=/f7o
------END PGP SIGNATURE-----
diff --git a/SOURCES/ldb-2.3.0-fix-tests-on-aarch64.patch b/SOURCES/ldb-2.3.0-fix-tests-on-aarch64.patch
new file mode 100644
index 0000000..06b7497
--- /dev/null
+++ b/SOURCES/ldb-2.3.0-fix-tests-on-aarch64.patch
@@ -0,0 +1,39 @@
+From e90817629f1f7049cc0fe48f1003f5fb1103acc3 Mon Sep 17 00:00:00 2001
+From: Gary Lockyer <gary@catalyst.net.nz>
+Date: Thu, 22 Apr 2021 10:03:53 +0200
+Subject: [PATCH 1/2] lib:ldb: Use a 1MiB lmdb so the test also passes on
+ aarch64 CentOS stream
+
+Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
+Reviewed-by: Andreas Schneider <asn@samba.org>
+---
+ lib/ldb/tests/ldb_lmdb_free_list_test.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/ldb/tests/ldb_lmdb_free_list_test.c b/lib/ldb/tests/ldb_lmdb_free_list_test.c
+index 9b295460730..c87620e7a87 100644
+--- a/tests/ldb_lmdb_free_list_test.c
++++ b/tests/ldb_lmdb_free_list_test.c
+@@ -77,7 +77,7 @@
+ #endif /* TEST_BE */
+ 
+ const int RECORD_SIZE = 6144;
+-const int ITERATIONS = 3;
++const int ITERATIONS = 192;
+ 
+ struct test_ctx {
+ 	struct tevent_context *ev;
+@@ -155,9 +155,9 @@ static int setup(void **state)
+ 				 "@IDX_DN_GUID: GUID\n"
+ 				 "\n";
+ 	/*
+-	 * Use a 64KiB DB for this test
++	 * Use a 1MiB DB for this test
+ 	 */
+-	const char *options[] = {"lmdb_env_size:65536", NULL};
++	const char *options[] = {"lmdb_env_size:1048576", NULL};
+ 
+ 	noconn_setup((void **)&test_ctx);
+ 
+-- 
+2.31.1
diff --git a/SOURCES/ldb-2.3.0.tar.asc b/SOURCES/ldb-2.3.0.tar.asc
new file mode 100644
index 0000000..c224ce5
--- /dev/null
+++ b/SOURCES/ldb-2.3.0.tar.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEkUejOXGVGO6QEby1R5ORYRMIQCUFAmBbDpgACgkQR5ORYRMI
+QCVgZQf/WyIcMhD9EAzJzMOGjantl0hXloCjnyT/vBpchWYwviU73cu65H/po+AO
+PgYMEvZfw8mLrMjSS+Dyr/76E+4MLjmnU02yISL4dJ+9EZ268xpMVELxHTYb9W+P
+aql8R0fcODqyHmEr3xPV0br+rcqkM6Wqekp2OcwRDgmtl7EN9/nJOThZ4Un4mEL9
+0oJKPllWLfPEBfk5j+UXinPGARBKj3txl1IkNinoXh7LiQ4y7GrEg2BSpsQV8YLe
+EDEBzK4fxPWLwbWWwAUSXgQNJ1GXwxZo6P2Fl9vKNDfxz8+2Xp24zyQBraWX7IqV
+6+aRuYQSmrH6tKX9OZCmCKJtT2qcdQ==
+=qIvP
+-----END PGP SIGNATURE-----
diff --git a/SPECS/libldb.spec b/SPECS/libldb.spec
index a5b91ca..2a25d08 100644
--- a/SPECS/libldb.spec
+++ b/SPECS/libldb.spec
@@ -1,8 +1,7 @@
 %if ((0%{?fedora} || 0%{?rhel} > 7 || 0%{?epel} > 6))
 
 # lmdb is not supported on 32 bit architectures
-# also disabled on aarch64 for now, due to #1897082
-%ifarch s390x x86_64
+%ifarch aarch64 s390x x86_64
 %bcond_without lmdb
 %else
 %bcond_with lmdb
@@ -25,8 +24,8 @@
 %global tevent_version 0.10.2
 
 Name: libldb
-Version: 2.2.0
-Release: 2%{?dist}
+Version: 2.3.0
+Release: 1%{?dist}
 Summary: A schema-less, ldap like, API and database
 Requires: libtalloc%{?_isa} >= %{talloc_version}
 Requires: libtdb%{?_isa} >= %{tdb_version}
@@ -37,12 +36,13 @@ Source0: https://www.samba.org/ftp/ldb/ldb-%{version}.tar.gz
 Source1: https://www.samba.org/ftp/ldb/ldb-%{version}.tar.asc
 # gpg2 --no-default-keyring --keyring ./ldb.keyring --recv-keys 9147A339719518EE9011BCB54793916113084025
 Source2: ldb.keyring
+# binary diffs are not supported
+# https://gitlab.com/samba-team/samba/-/merge_requests/1920
+Source3: fixed-guidindexpackv1.ldb
 
 # Patches
 Patch0001: 0001-PATCH-wafsamba-Fix-few-SyntaxWarnings-caused-by-regu.patch
-# Fix FTBFS / Increase the over-estimation for sparse files
-Patch0002: 1420.patch
-Patch0003: CVE-2021-20277.patch
+Patch0002: ldb-2.3.0-fix-tests-on-aarch64.patch
 
 BuildRequires: gcc
 BuildRequires: libtalloc-devel >= %{talloc_version}
@@ -65,12 +65,13 @@ BuildRequires: doxygen
 BuildRequires: openldap-devel
 BuildRequires: libcmocka-devel
 BuildRequires: gnupg2
+BuildRequires: make
 
 Provides: bundled(libreplace)
+Obsoletes: python2-ldb < 2.0.5-1
+Obsoletes: python2-ldb-devel < 2.0.5-1
+Obsoletes: pyldb < 1.1.26-2
 
-Obsoletes: python2-ldb < %{version}-%{release}
-Obsoletes: python2-ldb-devel < %{version}-%{release}
-Obsoletes: python2-ldb-debuginfo < %{version}-%{release}
 
 %description
 An extensible library that implements an LDAP like API to access remote LDAP
@@ -89,11 +90,20 @@ Requires: libldb%{?_isa} = %{version}-%{release}
 Requires: libtdb-devel%{?_isa} >= %{tdb_version}
 Requires: libtalloc-devel%{?_isa} >= %{talloc_version}
 Requires: libtevent-devel%{?_isa} >= %{tevent_version}
-Requires: pkgconfig
 
 %description devel
 Header files needed to develop programs that link against the LDB library.
 
+%package -n python-ldb-devel-common
+Summary: Common development files for the Python bindings for the LDB library
+
+Provides: pyldb-devel%{?_isa} = %{version}-%{release}
+%{?python_provide:%python_provide python2-ldb-devel}
+
+%description -n python-ldb-devel-common
+Development files for the Python bindings for the LDB library.
+This package includes files that aren't specific to a Python version.
+
 %if %{with python3}
 %package -n python3-ldb
 Summary: Python bindings for the LDB library
@@ -108,7 +118,7 @@ Python bindings for the LDB library
 %package -n python3-ldb-devel
 Summary: Development files for the Python bindings for the LDB library
 Requires: python3-ldb%{?_isa} = %{version}-%{release}
-Obsoletes: python-ldb-devel-common < %{version}-%{release}
+Requires: python-ldb-devel-common%{?_isa} = %{version}-%{release}
 
 %{?python_provide:%python_provide python3-ldb-devel}
 
@@ -118,11 +128,13 @@ Development files for the Python bindings for the LDB library
 %endif
 
 %prep
+zcat %{SOURCE0} | gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} -
 %autosetup -n ldb-%{version} -p1
 
-%build
-zcat %{SOURCE0} | gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} -
+# binary diffs are not supported
+cp -f %{SOURCE3} tests/guidindexpackv1.ldb
 
+%build
 # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1217376
 export python_LDFLAGS=""
 
@@ -197,6 +209,10 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_*
 %{_mandir}/man3/ldb*.gz
 %{_mandir}/man3/ldif*.gz
 
+%files -n python-ldb-devel-common
+%{_includedir}/pyldb.h
+%{_mandir}/man*/Py*.gz
+
 %if %{with python3}
 %files -n python3-ldb
 %{python3_sitearch}/ldb.cpython-*.so
@@ -207,16 +223,18 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_*
 %files -n python3-ldb-devel
 %{_libdir}/libpyldb-util.cpython-*.so
 %{_libdir}/pkgconfig/pyldb-util.cpython-*.pc
-%{_includedir}/pyldb.h
-%{_mandir}/man*/Py*.gz
 
 %ldconfig_scriptlets -n python3-ldb
 #endif with python
 %endif
 
 %changelog
+* Tue May 11 2021 Andreas Schneider <asn@redhat.com> - 2.3.0-1
+- resolves: rhbz#1945021 - Update to version 2.3.0
+- resolves: rhbz#1897082 - Fix libldb tests on aarch64
+
 * Wed Mar 24 2021 Andreas Schneider <asn@redhat.com> - 2.2.0-2
-* resolves: rhbz#1941515 - Fixed CVE-2021-20277
+* resolves: rhbz#1941516 - Fixed CVE-2021-20277
 
 * Mon Nov 9 2020 Isaac Boukris <iboukris@redhat.com> - 2.2.0-1
 - Resolves: rhbz#1878114 - Rebase libldb to the version required by Samba