packaging: add configure option to preprocess and install systemd files
[garming/samba-autobuild/.git] / packaging / wscript_build
diff --git a/packaging/wscript_build b/packaging/wscript_build
new file mode 100644 (file)
index 0000000..fbcd4e5
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+
+systemd_services = [
+    'systemd/smb.service',
+    'systemd/nmb.service',
+    'systemd/winbind.service',
+    'systemd/samba.service'
+]
+
+for srv in systemd_services:
+    bld.CONFIGURE_FILE(srv)
+    if bld.env.systemd_install_services:
+        bld.INSTALL_FILES(bld.env.SYSTEMDDIR, srv, flat=True)
+
+if bld.env.systemd_install_services:
+    bld.INSTALL_FILES('${SYSCONFDIR}/sysconfig', 'systemd/samba.sysconfig', destname='samba')