diff --git a/.gitignore b/.gitignore
index f533859..2c3914a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-SOURCES/ldb-1.1.29.tar.gz
+SOURCES/ldb-1.2.2.tar.gz
diff --git a/.libldb.metadata b/.libldb.metadata
index 6c4c91c..ea62044 100644
--- a/.libldb.metadata
+++ b/.libldb.metadata
@@ -1 +1 @@
-f30cc2d5ff966542b2a8850e5374bb9098431c09 SOURCES/ldb-1.1.29.tar.gz
+1b2467bdad228313d86c6d93f2b2b1a03f093cab SOURCES/ldb-1.2.2.tar.gz
diff --git a/SPECS/libldb.spec b/SPECS/libldb.spec
index c257525..76ee46b 100644
--- a/SPECS/libldb.spec
+++ b/SPECS/libldb.spec
@@ -8,7 +8,7 @@
 %define tevent_version 0.9.24
 
 Name: libldb
-Version: 1.1.29
+Version: 1.2.2
 Release: 1%{?dist}
 Group: Development/Libraries
 Summary: A schema-less, ldap like, API and database
@@ -91,7 +91,7 @@ Development files for the Python bindings for the LDB library
 
 %configure --disable-rpath \
            --disable-rpath-install \
-           --bundled-libraries=NONE \
+           --bundled-libraries=cmocka \
            --builtin-libraries=replace \
            --with-modulesdir=%{_libdir}/ldb/modules \
            --with-privatelibdir=%{_libdir}/ldb
@@ -105,6 +105,7 @@ doxygen Doxyfile
 make install DESTDIR=%{buildroot}
 
 rm -f %{buildroot}%{_libdir}/libldb.a
+rm -f %{buildroot}%{_libdir}/ldb/libcmocka-ldb.so
 
 # Shared libraries need to be marked executable for
 # rpmbuild to strip them and include them in debuginfo
@@ -178,6 +179,10 @@ rm -rf %{buildroot}
 %postun -n pyldb -p /sbin/ldconfig
 
 %changelog
+* Sun Oct 15 2017 Jakub Hrozek <jhrozek@redhat.com> - 1.2.2-1
+- Resolves: rhbz#1470056 - Rebase libldb to enable samba rebase to
+                           version 4.7.x
+
 * Tue Feb 14 2017 Jakub Hrozek <jhrozek@redhat.com> - 1.1.29-1
 - Resolves: rhbz#1393810 - Rebase libldb to enable samba rebase to
                            version 4.6.x