[Pkg-samba-maint] [samba] 07/11: Enable systemd (sd_notify) on Linux, and install systemd files

Mathieu Parent sathieu at moszumanska.debian.org
Wed May 11 21:26:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

sathieu pushed a commit to branch experimental
in repository samba.

commit e27303736cc0d2883a3428a114cbfcbb7e389fed
Author: Mathieu Parent <math.parent at gmail.com>
Date:   Sat May 7 22:35:43 2016 +0200

    Enable systemd (sd_notify) on Linux, and install systemd files
---
 debian/control         |  1 +
 debian/rules           | 29 +++++++++++++++++++++++------
 debian/samba.install   |  3 +++
 debian/winbind.install |  1 +
 4 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/debian/control b/debian/control
index cb754ef..9897a16 100644
--- a/debian/control
+++ b/debian/control
@@ -34,6 +34,7 @@ Build-Depends: bison,
                libpcap-dev [hurd-i386 kfreebsd-any],
                libpopt-dev,
                libreadline-dev,
+               libsystemd-dev [linux-any],
                libtalloc-dev (>= 2.1.6~),
                libtdb-dev (>= 1.3.8~),
                libtevent-dev (>= 0.9.25~),
diff --git a/debian/rules b/debian/rules
index ad0270d..0786f27 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,9 +8,11 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
 PYVERS=$(shell pyversions -vr)
 
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 LDB_VERSION = $(shell pkg-config --modversion ldb)
 LDB_EPOCH = $(shell dpkg-query -f '$${Version}' -W libldb-dev | sed 's/:.*//')
 LDB_NEXT_VERSION = $(shell python -c "x = '$(LDB_VERSION)'.split('.'); x[-1] = str(int(x[-1])+1); print '.'.join(x)")
@@ -71,6 +73,14 @@ conf_args = \
 		--with-logdir=/var/log/ctdb \
 		--enable-selftest
 
+ifeq ($(DEB_HOST_ARCH_OS), linux)
+	conf_args += \
+		--with-systemd
+else
+	conf_args += \
+		--without-systemd
+endif
+
 %:
 	dh $* --with python2 --with systemd
 
@@ -106,10 +116,10 @@ override_dh_installdocs-arch:
 	cp ctdb/config/events.d/README ctdb/README.eventscripts
 	cp ctdb/config/notify.d.README ctdb/README.notify.d
 	dh_installdocs
-ifeq ($(DEB_BUILD_ARCH_OS), hurd)
+ifeq ($(DEB_HOST_ARCH_OS), hurd)
 	dh_installdocs -pctdb debian/ctdb.README.hurd
 endif
-ifeq ($(DEB_BUILD_ARCH_OS), kfreebsd)
+ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
 	dh_installdocs -pctdb debian/ctdb.README.kfreebsd
 endif
 	#patch doc
@@ -141,8 +151,6 @@ override_dh_install:
 	   $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/plugin/krb5
 	install -m 0755 debian/setoption.py $(DESTDIR)/usr/share/samba
 	install -m 0755 debian/addshare.py $(DESTDIR)/usr/share/samba
-	mkdir -p $(DESTDIR)/usr/lib/tmpfiles.d
-	echo "d /run/samba 0755 root root -" > $(DESTDIR)/usr/lib/tmpfiles.d/samba.conf
 	# Install samba-common's conffiles - they'll get moved later to their
 	# correct place by dh_install
 	cp debian/smb.conf* $(DESTDIR)/usr/share/samba/
@@ -168,9 +176,18 @@ override_dh_install:
 	rm $(DESTDIR)/usr/bin/ctdb_run_cluster_tests
 	rm -rf $(DESTDIR)/usr/lib/*/ctdb-tests
 	rm -rf $(DESTDIR)/usr/share/ctdb-tests
-	# Install ctdb conffiles
+	# Install systemd configs
 	mkdir -p $(DESTDIR)/lib/systemd/system/
 	install -m 0644 ctdb/config/ctdb.service $(DESTDIR)/lib/systemd/system/
+	install -m 0644 packaging/systemd/*.service $(DESTDIR)/lib/systemd/system/
+	mv $(DESTDIR)/lib/systemd/system/nmb.service $(DESTDIR)/lib/systemd/system/nmbd.service
+	mv $(DESTDIR)/lib/systemd/system/smb.service $(DESTDIR)/lib/systemd/system/smbd.service
+	mv $(DESTDIR)/lib/systemd/system/samba.service $(DESTDIR)/lib/systemd/system/samba-ad-dc.service
+	sed -i 's|/etc/sysconfig/|/etc/default/|' $(DESTDIR)/lib/systemd/system/*.service
+	mkdir -p $(DESTDIR)/usr/lib/tmpfiles.d
+	echo "d /run/samba 0755 root root -" > $(DESTDIR)/usr/lib/tmpfiles.d/samba.conf
+	#install -m 0644 packaging/systemd/samba.sysconfig $(DESTDIR)/etc/default/samba
+	#
 	dh_install --sourcedir=$(DESTDIR) --list-missing --fail-missing
 
 override_dh_python2:
diff --git a/debian/samba.install b/debian/samba.install
index bb6831d..a2f370d 100644
--- a/debian/samba.install
+++ b/debian/samba.install
@@ -14,6 +14,9 @@ usr/lib/*/samba/libkdc-samba4.so.2
 usr/lib/*/samba/libkdc-samba4.so.2.0.0
 usr/lib/*/samba/libpac.so.*
 usr/lib/*/samba/service/*.so
+lib/systemd/system/nmb.service
+lib/systemd/system/samba-ad-dc.service
+lib/systemd/system/smb.service
 usr/sbin/mksmbpasswd
 usr/sbin/nmbd
 usr/sbin/samba
diff --git a/debian/winbind.install b/debian/winbind.install
index c058253..2c81660 100644
--- a/debian/winbind.install
+++ b/debian/winbind.install
@@ -7,6 +7,7 @@ usr/lib/*/samba/nss_info/hash.so
 usr/lib/*/samba/nss_info/rfc2307.so
 usr/lib/*/samba/nss_info/sfu.so
 usr/lib/*/samba/nss_info/sfu20.so
+lib/systemd/system/winbind.service
 usr/sbin/winbindd
 usr/share/man/man1/ntlm_auth.1
 usr/share/man/man1/wbinfo.1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list