summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2014-12-04 21:03:56 +0100
committerJelmer Vernooij <jelmer@samba.org>2014-12-04 21:03:56 +0100
commitdd57db980d8009a4c20b1bc0589167a85848db1e (patch)
tree442600659a76d688825ee077ad60571729d8d1b4 /debian
parent80b7bade539afa27277e7f3550b19ad4c49bdb03 (diff)
downloadsamba-dd57db980d8009a4c20b1bc0589167a85848db1e.tar.gz
Update debian/rules to allow support for multiple upstream ldb versions, when verified.
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog7
-rwxr-xr-xdebian/ldb-compat.py47
-rw-r--r--debian/ldb-equiv-versions1
-rwxr-xr-xdebian/rules5
4 files changed, 58 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index cc7d776e72..2cdd465617 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+samba (2:4.1.13+dfsg-3) UNRELEASED; urgency=medium
+
+ * Update debian/rules to allow support for multiple upstream ldb
+ versions, when verified.
+
+ -- Jelmer Vernooij <jelmer@debian.org> Thu, 04 Dec 2014 21:03:54 +0100
+
samba (2:4.1.13+dfsg-2) unstable; urgency=medium
* Mask /etc/init.d/samba init script for systemd. This should make systemd
diff --git a/debian/ldb-compat.py b/debian/ldb-compat.py
new file mode 100755
index 0000000000..99fa28ac00
--- /dev/null
+++ b/debian/ldb-compat.py
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# LDB has an unstable ABI for plugins that can change at a whim.
+# By default, the Samba package is conservative and only allows use of
+# the version against which it was built.
+#
+# debian/ldb-equiv-versions can list ldb versions for which the ABI hasn't changed.
+
+import optparse
+parser = optparse.OptionParser("[options] ldb-version")
+parser.add_option("--equivfile", dest="equivfile", type=str,
+ default="debian/ldb-equiv-versions",
+ help="File with ldb versions considered to be equivalent.")
+(opts, args) = parser.parse_args()
+
+if len(args) != 1:
+ parser.error("No version specified.")
+
+def parse_version(version):
+ return map(int, version.split('.'))
+
+def format_version(version):
+ return '.'.join(map(str, version))
+
+ldb_version = parse_version(args[0])
+
+def next_version(version):
+ x = list(version)
+ x[-1] = x[-1]+1
+ return format_version(x)
+
+f = open(opts.equivfile, 'r')
+try:
+ for l in f.readlines():
+ if l[0] == '#':
+ continue
+ (begin, end) = l.strip().split('-')
+ if (ldb_version < parse_version(begin) or
+ ldb_version > parse_version(end)):
+ continue
+ print begin
+ print next_version(parse_version(end))
+ break
+ else:
+ print format_version(ldb_version)
+ print next_version(ldb_version)
+finally:
+ f.close()
diff --git a/debian/ldb-equiv-versions b/debian/ldb-equiv-versions
new file mode 100644
index 0000000000..0ae28a7f49
--- /dev/null
+++ b/debian/ldb-equiv-versions
@@ -0,0 +1 @@
+1.1.17-1.1.18
diff --git a/debian/rules b/debian/rules
index 383385c764..08f7bbb89b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,8 +8,9 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
PYVERS=$(shell pyversions -vr)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-LDB_VERSION = $(shell pkg-config --modversion ldb)
-LDB_NEXT_VERSION = $(shell python -c "x = '$(LDB_VERSION)'.split('.'); x[-1] = str(int(x[-1])+1); print '.'.join(x)")
+LDB_BUILD_VERSION = $(shell pkg-config --modversion ldb)
+LDB_VERSION = $(shell ./debian/ldb-compat.py $(LDB_BUILD_VERSION) | head -1)
+LDB_NEXT_VERSION = $(shell ./debian/ldb-compat.py $(LDB_BUILD_VERSION) | tail -1)
# samba ships ldb modules, which are specific to the ldb version, so we need a
# strict dependency on the upstream ldb version
# this also mean samba needs a rebuild when the upstream ldb version changes