summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:20:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 17:20:00 +0000
commit8daa83a594a2e98f39d764422bfbdbc62c9efd44 (patch)
tree4099e8021376c7d8c05bdf8503093d80e9c7bad0 /packaging
parentInitial commit. (diff)
downloadsamba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.tar.xz
samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.zip
Adding upstream version 2:4.20.0+dfsg.upstream/2%4.20.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/Debian/README16
-rw-r--r--packaging/Example/Instructions41
-rw-r--r--packaging/Example/PackageDate1
-rw-r--r--packaging/Example/Packager1
-rw-r--r--packaging/Example/Packaging-instructions16
-rwxr-xr-xpackaging/Example/package-prep53
-rwxr-xr-xpackaging/Example/samba.init34
-rw-r--r--packaging/Example/skeleton.tarbin0 -> 30720 bytes
-rwxr-xr-xpackaging/NetworkManager/30-winbind-systemd20
-rw-r--r--packaging/NetworkManager/README6
-rw-r--r--packaging/README32
-rw-r--r--packaging/SuSE/README9
-rwxr-xr-xpackaging/bin/fill-templates47
-rwxr-xr-xpackaging/bin/update-pkginfo31
-rw-r--r--packaging/printing/README3
-rw-r--r--packaging/printing/smbprint84
-rw-r--r--packaging/systemd/README14
-rw-r--r--packaging/systemd/ctdb.service.in19
-rw-r--r--packaging/systemd/nmb.service.in17
-rw-r--r--packaging/systemd/samba.conf.tmp1
-rw-r--r--packaging/systemd/samba.service.in17
-rw-r--r--packaging/systemd/samba.sysconfig18
-rw-r--r--packaging/systemd/smb.service.in18
-rw-r--r--packaging/systemd/winbind.service.in16
-rwxr-xr-xpackaging/sysv/samba.init37
-rw-r--r--packaging/wscript57
-rw-r--r--packaging/wscript_build22
27 files changed, 630 insertions, 0 deletions
diff --git a/packaging/Debian/README b/packaging/Debian/README
new file mode 100644
index 0000000..48069f9
--- /dev/null
+++ b/packaging/Debian/README
@@ -0,0 +1,16 @@
+Debian.org packages
+-------------------
+
+Samba is packaged for Debian and Debian-derived distributions by the Debian
+Samba packaging team.
+
+The current sources for the packages in unstable can be found in Subversion
+at:
+
+ svn://svn.debian.org/pkg-samba/trunk/samba
+
+The current sources for particular Debian releases as well as the
+"experimental" branch can be found at:
+
+ svn://svn.debian.org/pkg-samba/branches/<name>/samba
+
diff --git a/packaging/Example/Instructions b/packaging/Example/Instructions
new file mode 100644
index 0000000..02ffa7b
--- /dev/null
+++ b/packaging/Example/Instructions
@@ -0,0 +1,41 @@
+Copyright (C) 1997-1998 Samba-Team
+E-mail: samba-binaries@samba.org
+
+Subject: Installation Instructions for SuperNewOS X.X
+--------------------------------------------------------
+
+1) cd /
+2) tar xvf [path-to-samba-package]/install.tar
+3) cd /usr/local/samba/lib
+4) vi smb.conf
+
+Now modify smb.conf to reflect your site needs.
+
+5) samba start
+
+To stop samba:
+
+ samba stop
+
+You could install samba to run from the system start-up scripts
+(recommended) by running ./setup.sh
+
+Start / Stop Samba as follows:-
+
+ samba [start | stop]
+
+
+Subject: New Users Must Read This
+-----------------------------------
+Above ALL else, read the smb.conf man pages _AND_ all text documentation.
+
+To enable SMB encrypted password support do the following:
+
+1) Put /usr/local/samba/bin in your PATH
+2) Edit /usr/local/samba/lib/smb.conf and uncomment the
+ line "encrypt passwd = yes"
+3) Execute: smbpasswd -a "username" "password"
+
+The above will create your /usr/local/samba/private/smbpasswd file
+in which will be the NT and LanMAN hashed passwords.
+
diff --git a/packaging/Example/PackageDate b/packaging/Example/PackageDate
new file mode 100644
index 0000000..95cbb09
--- /dev/null
+++ b/packaging/Example/PackageDate
@@ -0,0 +1 @@
+# Month, WeekDay, Date, Year, PreparerCity, Country
diff --git a/packaging/Example/Packager b/packaging/Example/Packager
new file mode 100644
index 0000000..f5db3f8
--- /dev/null
+++ b/packaging/Example/Packager
@@ -0,0 +1 @@
+Packager: John Doe <doej@somewhere.org>
diff --git a/packaging/Example/Packaging-instructions b/packaging/Example/Packaging-instructions
new file mode 100644
index 0000000..b598fd6
--- /dev/null
+++ b/packaging/Example/Packaging-instructions
@@ -0,0 +1,16 @@
+The package building files should be located in a
+directory called: samba-X.X.X
+
+Where X.X.X is the version ID.
+
+Step Directions
+==== ============================================
+1. Copy the samba distribution tarball into the packaging directory
+2. Make sure you have a installed on your system the GNU gzip/gunzip files
+3. Edit "package-prep" script as required
+4. Run "package-prep"
+
+If all goes well, you should now have a usable distribution package.
+
+Note: Update the Instructions file as required.
+
diff --git a/packaging/Example/package-prep b/packaging/Example/package-prep
new file mode 100755
index 0000000..ae09638
--- /dev/null
+++ b/packaging/Example/package-prep
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Extract the skeleton directory structure into which samba will be installed.
+tar xvf skeleton.tar
+
+# Now link the skeleton directory structure into the final install tree.
+(
+ cd /usr/local
+ mv man man.orig
+ mv samba samba.orig
+ NOWDIR=$(pwd)
+ ln -sf $NOWDIR/usr/local/man man
+ ln -sf $NOWDIR/usr/local/samba samba
+)
+
+# Unpack the master source tarball
+gunzip samba-X.X.X.tar.gz
+tar xvf samba-X.X.X.tar
+
+# Now build the binary files
+cd samba-X.X.X/source
+./configure
+make
+make install
+
+# Install into the packaging tree that full reflects the final install tree
+cd $NOWDIR/usr/local/samba
+cp -pr man ../
+rm -rf man
+cd $NOWDIR
+
+# Create the package tarball
+tar cvf install.tar usr var
+
+# Clean up original sources preserving all configured files
+# Note: This will allow installers to check build options
+cd samba-X.X.X/source
+rm -f ../source/bin/*
+make clean
+cd ../..
+tar cvf samba-X.X.X.tar samba-X.X.X
+rm -rf samba-X.X.X
+rm -rf usr var
+cd ..
+tar cvf samba-X.X.X-OS-Version-CPU.tar samba-X.X.X
+gzip samba-X.X.X-OS-Version-CPU.tar
+
+# We now have the distribution package, now restore our runtime system
+cd samba-X.X.X
+tar xcf install.tar
+
+# Please test operation before shipping the binary distribution package
+# to the samba-team.
diff --git a/packaging/Example/samba.init b/packaging/Example/samba.init
new file mode 100755
index 0000000..c1d605c
--- /dev/null
+++ b/packaging/Example/samba.init
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+if [ ! -d /usr/bin ]; then
+ echo "The /usr file system is not mounted."
+ exit 1
+fi
+
+killproc() {
+ pid=`/bin/ps ax | grep -w $1 | sed -e 's/^ *//' -e 's/ .*//'`
+ echo "Stopping $1 now."
+ [ "$pid" != "" ] && kill -15 $pid
+ echo $pid
+}
+
+
+# Start/stop processes required for samba server
+
+case "$1" in
+
+ 'start')
+ echo "Starting Samba"
+ /usr/local/samba/sbin/smbd
+ /usr/local/samba/sbin/nmbd
+ echo "Done."
+ ;;
+ 'stop')
+ killproc smbd
+ killproc nmbd
+ ;;
+ *)
+ echo "Usage: /sbin/init.d/samba.init [ start | stop ]"
+ ;;
+esac
+exit 0
diff --git a/packaging/Example/skeleton.tar b/packaging/Example/skeleton.tar
new file mode 100644
index 0000000..92598d0
--- /dev/null
+++ b/packaging/Example/skeleton.tar
Binary files differ
diff --git a/packaging/NetworkManager/30-winbind-systemd b/packaging/NetworkManager/30-winbind-systemd
new file mode 100755
index 0000000..f740bb8
--- /dev/null
+++ b/packaging/NetworkManager/30-winbind-systemd
@@ -0,0 +1,20 @@
+#!/bin/sh
+SYSTEMCTL=/bin/systemctl
+winbind_is_active=$($SYSTEMCTL is-active winbind.service)
+test "${winbind_is_active}" = "active" || exit 0
+
+winbind_offline_logon=$(testparm -s --parameter-name "winbind offline logon" 2>/dev/null)
+test "${winbind_offline_logon}" = "Yes" || exit 0
+
+case "$2" in
+up | vpn-up)
+ nmb_is_active=$($SYSTEMCTL is-active nmb.service)
+ if test "${nmb_is_active}" = "active"; then
+ $SYSTEMCTL try-restart nmb.service || :
+ fi
+ /usr/bin/smbcontrol winbind online || :
+ ;;
+down)
+ /usr/bin/smbcontrol winbind offline
+ ;;
+esac
diff --git a/packaging/NetworkManager/README b/packaging/NetworkManager/README
new file mode 100644
index 0000000..0db8be6
--- /dev/null
+++ b/packaging/NetworkManager/README
@@ -0,0 +1,6 @@
+This directory includes files for the dispatcher of NetworkManager. The files
+need to be copied to /etc/NetworkManager/dispatcher.d/ and will be automatically
+called if a network interface goes up or down.
+
+30-winbind-systemd: This will set winbind into offline mode if you have winbind
+ offline logon turned on.
diff --git a/packaging/README b/packaging/README
new file mode 100644
index 0000000..7444550
--- /dev/null
+++ b/packaging/README
@@ -0,0 +1,32 @@
+Copyright (C) 1997-2003 Samba-Team
+Date: November 16, 1998
+Updates: First Release - 19970819
+ 19981116
+ 20030329
+ 20030905
+===============================================================================
+
+Note:
+=====
+This directory is a public repository for platform specific files including
+build files for binary package distributions for specific operating systems
+as well as for source file distribution packages for those systems.
+
+The Example directory should be used as a guide for preparation of binary
+packages for distribution via the official samba ftp sites.
+
+The files contained here are intended for use only by those wishing to build
+distribution packages and are NOT considered suitable material for anyone who
+wants to just install Samba from the pristine source files contained under
+the ../source directory.
+
+All contributions / modifications / additions / etc. to the packaging files
+should be logged in https://bugzilla.samba.org/.
+
+In the event that anyone wishes to contribute package build information please
+indicate in your response how we may access a suitable system to ensure our
+ability to keep the binary distribution itself current with the released source.
+
+The future of cooperatively developed software such as Samba depends on the
+willingness of all partners to share the fruit of their labours.
+
diff --git a/packaging/SuSE/README b/packaging/SuSE/README
new file mode 100644
index 0000000..4b56270
--- /dev/null
+++ b/packaging/SuSE/README
@@ -0,0 +1,9 @@
+Dear SuSE user,
+
+prebuilt Samba RPMs for all SuSE Linux versions are available at:
+ftp://ftp.SuSE.com/pub/projects/samba/
+
+The same package are also available at:
+http://download.Samba.org/samba/ftp/Binary_Packages/SuSE/
+
+Have a lot of fun...
diff --git a/packaging/bin/fill-templates b/packaging/bin/fill-templates
new file mode 100755
index 0000000..cd711bd
--- /dev/null
+++ b/packaging/bin/fill-templates
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Script to fill the packaging templates with the version
+# information that is created by mkversion in advance.
+#
+# This is a standalone wrapper for update-pkginfo, which
+# is usually called from release-scripts/create-tarball.
+# This allows for testing some aspects of packaging without
+# the need to go through all of create-tarball.
+#
+# Copyright (C) Michael Adam 2009
+#
+# License: GPL
+
+DIRNAME=$(dirname $0)
+TOPDIR=${DIRNAME}/../..
+SRCDIR=${TOPDIR}/source3
+VERSION_H=${SRCDIR}/include/version.h
+
+pushd ${SRCDIR} >/dev/null 2>&1
+./script/mkversion.sh
+popd >/dev/null 2>&1
+
+if [ ! -f ${VERSION_H} ]; then
+ echo "Error creating version.h"
+ exit 1
+fi
+
+VERSION=$(grep "define SAMBA_VERSION_OFFICIAL_STRING" ${VERSION_H} | awk '{print $3}')
+
+vendor_version=$(grep "define SAMBA_VERSION_VENDOR_SUFFIX" ${VERSION_H} | awk '{print $3}')
+if test "x${vendor_version}" != "x"; then
+ VERSION="${VERSION}-${vendor_version}"
+fi
+
+vendor_patch=$(grep "define SAMBA_VERSION_VENDOR_PATCH" ${VERSION_H} | awk '{print $3}')
+if test "x${vendor_patch}" != "x"; then
+ VERSION="${VERSION}-${vendor_patch}"
+fi
+
+VERSION=$(echo ${VERSION} | sed 's/\"//g')
+
+echo "VERSION: ${VERSION}"
+
+pushd ${TOPDIR}/packaging >/dev/null 2>&1
+./bin/update-pkginfo "${VERSION}" 1 ""
+popd >/dev/null 2>&1
diff --git a/packaging/bin/update-pkginfo b/packaging/bin/update-pkginfo
new file mode 100755
index 0000000..486c8c7
--- /dev/null
+++ b/packaging/bin/update-pkginfo
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+VERSION=$1
+RELEASE=$2
+REVISION=$3
+
+if [ "x${REVISION}" = "x" ]; then
+ RPMREVISION=""
+else
+ RPMREVISION=".${REVISION}"
+fi
+
+if [ $# -ne 3 ]; then
+ echo Usage: update-pkginfo VERSION RELEASE REVISION
+ exit 1
+fi
+
+DIRNAME=$(dirname $0)
+TOPDIR=${DIRNAME}/../../
+PACKAGINGDIR=${TOPDIR}/packaging
+
+pushd ${PACKAGINGDIR} >/dev/null 2>&1
+for f in $(find . -type f -name "*.tmpl"); do
+ f2=$(echo $f | sed s/.tmpl//g)
+ echo $f2
+ sed -e s/PVERSION/$VERSION/g \
+ -e s/PRELEASE/$RELEASE/g \
+ -e s/PREVISION/${REVISION}/g \
+ -e s/PRPMREV/${RPMREVISION}/g <$f >$f2
+done
+popd >/dev/null 2>&1
diff --git a/packaging/printing/README b/packaging/printing/README
new file mode 100644
index 0000000..0dfcc3c
--- /dev/null
+++ b/packaging/printing/README
@@ -0,0 +1,3 @@
+The smbprint script is an input filter for printcap printing on a unix machine.
+It uses the smbclient program to print the file to the specified smb-based
+server and service.
diff --git a/packaging/printing/smbprint b/packaging/printing/smbprint
new file mode 100644
index 0000000..a21385a
--- /dev/null
+++ b/packaging/printing/smbprint
@@ -0,0 +1,84 @@
+#!/bin/sh
+# This script is an input filter for printcap printing on a unix machine. It
+# uses the smbclient program to print the file to the specified smb-based
+# server and service.
+# For example you could have a printcap entry like this
+#
+# smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
+#
+# which would create a unix printer called "smb" that will print via this
+# script. You will need to create the spool directory /usr/spool/smb with
+# appropriate permissions and ownerships for your system.
+
+# Set these to the server and service you wish to print to
+# In this example I have a WfWg PC called "lapland" that has a printer
+# exported called "printer" with no password.
+
+#
+# Script further altered by hamiltom@ecnz.co.nz (Michael Hamilton)
+# so that the server, service, and password can be read from
+# a /usr/var/spool/lpd/PRINTNAME/.config file.
+#
+# In order for this to work the /etc/printcap entry must include an
+# accounting file (af=...):
+#
+# cdcolour:\
+# :cm=CD IBM Colorjet on 6th:\
+# :sd=/var/spool/lpd/cdcolour:\
+# :af=/var/spool/lpd/cdcolour/acct:\
+# :if=/usr/local/etc/smbprint:\
+# :mx=0:\
+# :lp=/dev/null:
+#
+# The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
+# share=PC_SERVER
+# user="user"
+# password="password"
+#
+# Please, do not modify the order in the file.
+# Example:
+# share=\\server\deskjet
+# user="fred"
+# password=""
+
+#
+# The last parameter to the filter is the accounting file name.
+# Extract the directory name from the file name.
+# Concat this with /.config to get the config file.
+#
+eval acct_file=\${$#}
+spool_dir=$(dirname $acct_file)
+config_file=$spool_dir/.config
+
+# Should read the following variables set in the config file:
+# share
+# hostip
+# user
+# password
+
+eval $(cat $config_file)
+
+share=$(echo $share | sed "s/[\]/\//g")
+
+if [ "$user" != "" ]; then
+ usercmd="-U"
+else
+ usercmd=""
+fi
+
+if [ "$workgroup" != "" ]; then
+ workgroupcmd="-W"
+else
+ workgroupcmd=""
+fi
+
+if [ "$translate" = "yes" ]; then
+ command="translate ; print -"
+else
+ command="print -"
+fi
+#echo $share $password $translate $x_command > /tmp/smbprint.log
+
+cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I} \
+ $hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \
+ -c "$command" 2>/dev/null
diff --git a/packaging/systemd/README b/packaging/systemd/README
new file mode 100644
index 0000000..5d1d746
--- /dev/null
+++ b/packaging/systemd/README
@@ -0,0 +1,14 @@
+With systemd the /run or /var/run are tmpfs filesystems. This means
+the directories required by samba need to be created during startup.
+This can be done with a config file for tmpfiles, see samba.conf.tmp.
+You need to copy this file to the directory systemd-tmpfiles is looking
+for its config files e.g.:
+
+install -d -m 0755 /etc/tmpfiles.d/
+install -m644 samba.conf.tmp /etc/tmpfiles.d/samba.conf
+
+If you're a packager don't forget to run the systemd-tmpfiles binary
+in the script after samba has been installed. This makes sure the
+directory exists and you can start samba directly after the installation.
+
+/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/samba.conf
diff --git a/packaging/systemd/ctdb.service.in b/packaging/systemd/ctdb.service.in
new file mode 100644
index 0000000..7905a93
--- /dev/null
+++ b/packaging/systemd/ctdb.service.in
@@ -0,0 +1,19 @@
+[Unit]
+Description=CTDB
+Documentation=man:ctdbd(1) man:ctdb(7)
+After=network-online.target time-sync.target
+ConditionFileNotEmpty=@CTDB_ETCDIR@/nodes
+
+[Service]
+Type=forking
+LimitCORE=infinity
+LimitNOFILE=1048576
+TasksMax=4096
+PIDFile=@CTDB_RUNDIR@/ctdbd.pid
+ExecStart=@SBINDIR@/ctdbd
+ExecStop=@BINDIR@/ctdb shutdown
+KillMode=control-group
+Restart=no
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/nmb.service.in b/packaging/systemd/nmb.service.in
new file mode 100644
index 0000000..ceeeea4
--- /dev/null
+++ b/packaging/systemd/nmb.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=Samba NMB Daemon
+Documentation=man:nmbd(8) man:samba(7) man:smb.conf(5)
+Wants=network-online.target
+After=network.target network-online.target
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/nmbd.pid
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/nmbd --foreground --no-process-group $NMBDOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+LimitCORE=infinity
+@systemd_nmb_extra@
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/samba.conf.tmp b/packaging/systemd/samba.conf.tmp
new file mode 100644
index 0000000..8a29577
--- /dev/null
+++ b/packaging/systemd/samba.conf.tmp
@@ -0,0 +1 @@
+d /var/run/samba 755 root root
diff --git a/packaging/systemd/samba.service.in b/packaging/systemd/samba.service.in
new file mode 100644
index 0000000..e4baee1
--- /dev/null
+++ b/packaging/systemd/samba.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=Samba AD Daemon
+Documentation=man:samba(8) man:samba(7) man:smb.conf(5)
+Wants=network-online.target
+After=network.target network-online.target
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/samba.pid
+LimitNOFILE=16384
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/samba --foreground --no-process-group $SAMBAOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+@systemd_samba_extra@
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/samba.sysconfig b/packaging/systemd/samba.sysconfig
new file mode 100644
index 0000000..7607426
--- /dev/null
+++ b/packaging/systemd/samba.sysconfig
@@ -0,0 +1,18 @@
+## Path: Network/Samba
+## Description: Samba process options
+## Type: string
+## Default: ""
+## ServiceRestart: samba
+SAMBAOPTIONS=""
+## Type: string
+## Default: ""
+## ServiceRestart: smb
+SMBDOPTIONS=""
+## Type: string
+## Default: ""
+## ServiceRestart: nmb
+NMBDOPTIONS=""
+## Type: string
+## Default: ""
+## ServiceRestart: winbind
+WINBINDOPTIONS=""
diff --git a/packaging/systemd/smb.service.in b/packaging/systemd/smb.service.in
new file mode 100644
index 0000000..64c77c0
--- /dev/null
+++ b/packaging/systemd/smb.service.in
@@ -0,0 +1,18 @@
+[Unit]
+Description=Samba SMB Daemon
+Documentation=man:smbd(8) man:samba(7) man:smb.conf(5)
+Wants=network-online.target
+After=network.target network-online.target nmb.service winbind.service
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/smbd.pid
+LimitNOFILE=16384
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/smbd --foreground --no-process-group $SMBDOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+LimitCORE=infinity
+@systemd_smb_extra@
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/winbind.service.in b/packaging/systemd/winbind.service.in
new file mode 100644
index 0000000..d28a0e9
--- /dev/null
+++ b/packaging/systemd/winbind.service.in
@@ -0,0 +1,16 @@
+[Unit]
+Description=Samba Winbind Daemon
+Documentation=man:winbindd(8) man:samba(7) man:smb.conf(5)
+After=network.target nmb.service
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/winbindd.pid
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/winbindd --foreground --no-process-group $WINBINDOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+LimitCORE=infinity
+@systemd_winbind_extra@
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/sysv/samba.init b/packaging/sysv/samba.init
new file mode 100755
index 0000000..e021e91
--- /dev/null
+++ b/packaging/sysv/samba.init
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# Copyright (c) Timo Knuutila <knuutila@cs.utu.fi> 1996.
+#
+# This file should have uid root, gid sys and chmod 744
+#
+if [ ! -d /usr/bin ]
+then # /usr not mounted
+ exit
+fi
+
+killproc() { # kill the named process(es)
+ pid=`/usr/bin/ps -e |
+ /usr/bin/grep -w $1 |
+ /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
+ [ "$pid" != "" ] && kill $pid
+}
+
+# Start/stop processes required for samba server
+
+case "$1" in
+
+'start')
+#
+# Edit these lines to suit your installation (paths, workgroup, host)
+#
+ /opt/samba/bin/smbd -D -s/opt/samba/smb.conf
+ /opt/samba/bin/nmbd -D -l/opt/samba/log -s/opt/samba/smb.conf
+ ;;
+'stop')
+ killproc nmbd
+ killproc smbd
+ ;;
+*)
+ echo "Usage: /etc/init.d/samba.server { start | stop }"
+ ;;
+esac
diff --git a/packaging/wscript b/packaging/wscript
new file mode 100644
index 0000000..ab8e16f
--- /dev/null
+++ b/packaging/wscript
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+from waflib import Options
+
+def options(opt):
+ gr = opt.option_group('systemd installation options')
+
+ gr.add_option('--systemd-install-services',
+ help=("install systemd service files to manage daemons (default=no)"),
+ action="store_true", dest="systemd_install_services", default=False)
+
+ gr.add_option('--with-systemddir',
+ help=("systemd service directory [PREFIX/lib/systemd/system]"),
+ action="store", dest="SYSTEMDDIR",
+ default="${PREFIX}/lib/systemd/system")
+ #
+ # extra service directives
+ #
+
+ gr.add_option('--systemd-smb-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the smb service file."
+ +" Can be given multiple times."),
+ action="append", dest="systemd_smb_extra", default=[])
+
+ gr.add_option('--systemd-nmb-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the nmb service file."
+ +" Can be used multiple times."),
+ action="append", dest="systemd_nmb_extra", default=[])
+
+ gr.add_option('--systemd-winbind-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the winbind service file."
+ +" Can be used multiple times."),
+ action="append", dest="systemd_winbind_extra", default=[])
+
+ gr.add_option('--systemd-samba-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the samba service file."
+ +" Can be used multiple times."),
+ action="append", dest="systemd_samba_extra", default=[])
+
+ gr.add_option('--systemd-ctdb-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the ctdb service file."
+ +" Can be given multiple times."),
+ action="append", dest="systemd_ctdb_extra", default=[])
+
+def configure(conf):
+ conf.env.systemd_install_services = Options.options.systemd_install_services
+ conf.env.systemd_smb_extra = '\n'.join(Options.options.systemd_smb_extra)
+ conf.env.systemd_nmb_extra = '\n'.join(Options.options.systemd_nmb_extra)
+ conf.env.systemd_winbind_extra = '\n'.join(Options.options.systemd_winbind_extra)
+ conf.env.systemd_samba_extra = '\n'.join(Options.options.systemd_samba_extra)
+ conf.env.systemd_ctdb_extra = '\n'.join(Options.options.systemd_ctdb_extra)
+ conf.env.SYSTEMDDIR = Options.options.SYSTEMDDIR
diff --git a/packaging/wscript_build b/packaging/wscript_build
new file mode 100644
index 0000000..217bd99
--- /dev/null
+++ b/packaging/wscript_build
@@ -0,0 +1,22 @@
+#!/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.with_ctdb:
+ srv = 'systemd/ctdb.service'
+ 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')