[PATCH] More packaging/debian/ fixes (descriptions, debconf setup, init script)

Steinar H. Gunderson sgunderson at bigfoot.com
Tue Dec 13 15:28:47 GMT 2005


Hi,

The included patch makes the following fixes to the Debian packaging:

 - The SWAT package no longer duplicates files from the -common package
   (sorry, introduced that bug the last time). It's still untested, though.
 - All packages now have proper short and long descriptions (based on the
   Samba 3 descriptions).
 - The postinst now uses debconf to automatically provision the server based
   on the user's choices (instead of just shipping an empty smb.conf, which
   made provisioning fail).
 - There's a proper init script, in /etc/init.d/samba4 (based on the Samba 3
   init script).

/* Steinar */
-- 
Homepage: http://www.sesse.net/
-------------- next part --------------
Index: packaging/debian/samba4-server.config
===================================================================
--- packaging/debian/samba4-server.config	(revision 0)
+++ packaging/debian/samba4-server.config	(revision 0)
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_title "Samba Server"
+
+db_input medium samba4-server/setup-pdc || true
+db_go || true
+
+db_get samba4-server/setup-pdc
+
+if [ "$RET" = "true" ]; then
+	db_input medium samba4-server/realm || true
+	db_go || true
+
+	db_input medium samba4-server/domain || true
+	db_go || true
+
+	db_input medium samba4-server/password || true
+	db_go || true
+	
+	db_input medium samba4-server/done || true
+	db_go || true
+fi
+
Index: packaging/debian/control
===================================================================
--- packaging/debian/control	(revision 12205)
+++ packaging/debian/control	(working copy)
@@ -3,39 +3,93 @@
 Priority: optional
 Maintainer: Jelmer Vernooij <jelmer at samba.org>
 Standards-Version: 3.6.2
-Build-Depends: libgtk2.0-dev, libgconf2-dev, libldap-dev, debhelper (>> 4.0.0), libparse-yapp-perl, perl, docbook-xsl, xsltproc
+Build-Depends: libgtk2.0-dev, libgconf2-dev, libldap-dev, debhelper (>> 4.0.0), libparse-yapp-perl, perl, docbook-xsl, xsltproc, po-debconf
 
 Package: samba4-common
 Architecture: all
-Description: Common samba files
- Files common for all programs in Samba
+Description: Samba 4 common files used by both the server and the client
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients. This protocol
+ is sometimes also referred to as the LanManager or NetBIOS protocol.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains the common files that are used by both the server
+ (provided in the samba4-server package) and the client (provided in the
+ samba4-client package).
 
 Package: samba4-client
 Architecture: any
 Depends: ${shlibs:Depends}
-Description: Client utilities from Samba4
- Client utilities for NetBIOS, SMB and RPC.
+Description: client utilities from Samba 4
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients. This protocol
+ is sometimes also referred to as the LanManager or NetBIOS protocol.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains some client components of the Samba suite. In
+ particular it includes the command line utilities smbclient, net,
+ and some ACL tools.
 
 Package: samba4-testsuite
 Architecture: any
 Depends: ${shlibs:Depends}, samba4-common
-Description: Testsuite from Samba4
+Description: test suite from Samba 4
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
  This package contains programs for testing the reliability and speed 
  of SMB servers, Samba in particular.
  
 Package: samba4-server
 Architecture: any
 Recommends: samba4-swat
-Depends: ${shlibs:Depends}, samba4-common
-Description: SMB Server
- Contains smbd, the Samba server. 
+Depends: ${shlibs:Depends}, samba4-common, debconf
+Description: LanManager-like file and printer server for Unix (version 4)
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains smbd, the Samba file, print and domain server.
 
 Package: samba4-gtk-frontends
 Architecture: any
 Depends: ${shlibs:Depends}
-Description: Graphical Samba client utilities
- Contains GTK+ programs for maintaining:
+Description: graphical Samba client utilities
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
  .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains GTK+ programs for maintaining:
+ .
    * Remote SAM databases
    * Local and remote registries
    * DCE/RPC endpoints
@@ -43,29 +97,89 @@
 Package: winregistry-tools
 Architecture: any
 Depends: ${shlibs:Depends}
-Description: Tools for viewing and manipulating 
- FIXME
+Description: tools for viewing and manipulating the Windows registry 
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains tools for viewing and manipulating the binary
+ "registry" found on Windows machines, both locally and remote.
 
 Package: libparse-pidl-perl
 Architecture: any
 Depends: ${perl:Depends}
 Description: IDL compiler written in Perl
- FIXME
- 
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains the IDL (Interface Description Language) compiler pidl,
+ which takes in IDL files and can output C code for various uses. It is
+ primarily of interest to developers.
+
 Package: samba4-dev
 Architecture: any
 Depends: libparse-pidl-perl, libc6-dev, pkg-config (>= 0.14.0)
-Description: Tools for extending Samba
- Contains Samba includes and tools
+Description: tools for extending Samba
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains include files and libraries for interfacing to
+ and extending Samba. In particular, it contains development files for
+ the talloc and ldb libraries.
 
 Package: ldb-tools
 Architecture: any
 Depends: ${shlibs:Depends}
-Description: Tools for maintaining LDB database files
- FIXME
+Description: tools for maintaining LDB database files
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains tools for maintaining, creating and editing
+ LDB database files, which are central to Samba 4's operation. They
+ are primarily useful for debugging and developing Samba or other
+ applications using LDB.
 
 Package: samba4-swat
 Architecture: all
-Description: Swat data files
- Data files for SWAT.
+Description: data files for SWAT
+ The Samba software suite is a collection of programs that
+ implements the SMB protocol for unix systems, allowing you to serve
+ files and printers to Windows, NT, OS/2 and DOS clients, as well as
+ run as a domain controller for Active Directory.
+ .
+ These packages contain snapshot versions of Samba 4, the next-generation
+ version of Samba. These should be considered _experimental_, and should
+ not be used in production. In particular, no guarantees are made with
+ regard to upgrades between versions.
+ .
+ This package contains the data files for SWAT, the Samba Web Administration
+ Tool. These are used by the embedded Samba 4 web server to provide web-based
+ administration of shares and other settings.
 
Index: packaging/debian/samba4-server.samba4.init
===================================================================
--- packaging/debian/samba4-server.samba4.init	(revision 0)
+++ packaging/debian/samba4-server.samba4.init	(revision 0)
@@ -0,0 +1,63 @@
+#! /bin/sh
+
+#
+# Start/stops the Samba daemon (smbd).
+# Adapted from the Samba 3 packages.
+#
+
+SMBDPID=/var/run/samba4/smbd.pid
+
+# clear conflicting settings from the environment
+unset TMPDIR
+
+# See if the daemon and the config file are there
+test -x /usr/sbin/smbd -a -r /etc/samba4/smb.conf || exit 0
+
+. /lib/lsb/init-functions
+
+case "$1" in
+	start)
+		log_daemon_msg "Starting Samba 4 daemon" "smbd"
+		
+		if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then
+			log_end_msg 1
+			exit 1
+		fi
+
+		log_end_msg 0
+		;;
+	stop)
+		log_daemon_msg "Stopping Samba 4 daemon" "smbd"
+
+		start-stop-daemon --stop --quiet --pidfile $SMBDPID
+		# Wait a little and remove stale PID file
+		sleep 1
+		if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
+		then
+			# Stale PID file (smbd was succesfully stopped),
+			# remove it (should be removed by smbd itself IMHO.)
+			rm -f $SMBDPID
+		fi
+
+		log_end_msg 0
+
+		;;
+	reload)
+		log_daemon_msg "Reloading /etc/samba/smb.conf" "smbd only"
+
+		start-stop-daemon --stop --signal HUP --pidfile $SMBDPID
+
+		log_end_msg 0
+		;;
+	restart|force-reload)
+		$0 stop
+		sleep 1
+		$0 start
+		;;
+	*)
+		echo "Usage: /etc/init.d/samba4 {start|stop|reload|restart|force-reload}"
+		exit 1
+		;;
+esac
+
+exit 0
Index: packaging/debian/samba4-swat.install
===================================================================
--- packaging/debian/samba4-swat.install	(revision 12205)
+++ packaging/debian/samba4-swat.install	(working copy)
@@ -1,2 +1 @@
 usr/share/samba/swat
-usr/lib/samba/js
Index: packaging/debian/rules
===================================================================
--- packaging/debian/rules	(revision 12205)
+++ packaging/debian/rules	(working copy)
@@ -69,7 +69,6 @@
 	mkdir -p $(CURDIR)/debian/tmp/etc/samba4
 	$(MAKE) -C $(SOURCEPATH) install DESTDIR=$(CURDIR)/debian/tmp
 	$(MAKE) -C $(SOURCEPATH) manpages installman DESTDIR=$(CURDIR)/debian/tmp
-	cp $(CURDIR)/debian/smb.conf $(CURDIR)/debian/tmp/etc/samba4
 	cp $(SOURCEPATH)/setup/provision $(CURDIR)/debian/tmp/usr/lib/samba/setup
 	$(MAKE) -C $(SOURCEPATH)/pidl install DESTDIR=$(CURDIR)/debian/tmp
 
@@ -84,6 +83,8 @@
 	dh_compress -a
 	dh_fixperms -a
 	dh_makeshlibs -a
+	dh_installinit -a --name=samba4
+	dh_installdebconf -a
 	dh_installdeb -a
 	dh_shlibdeps -a
 	dh_gencontrol -a
Index: packaging/debian/samba4-server.postinst
===================================================================
--- packaging/debian/samba4-server.postinst	(revision 0)
+++ packaging/debian/samba4-server.postinst	(revision 0)
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_get samba4-server/setup-pdc || true
+
+if [ "$RET" = "true" ]; then
+	db_get samba4-server/realm
+	REALM="$RET"
+
+	db_get samba4-server/domain
+	DOMAIN="$RET"
+
+	db_get samba4-server/password
+	PASSWORD="$RET"
+
+	db_stop
+
+	/usr/lib/samba/setup/provision --realm="$REALM" --domain="$DOMAIN" --adminpass="$PASSWORD"
+else
+	db_stop
+fi
+
+#DEBHELPER#
+
+exit 0
Index: packaging/debian/samba4-common.install
===================================================================
--- packaging/debian/samba4-common.install	(revision 12205)
+++ packaging/debian/samba4-common.install	(working copy)
@@ -1,4 +1,3 @@
-etc/samba4/smb.conf
 usr/lib/samba/*.dat
 usr/lib/samba/setup
 usr/lib/samba/js
Index: packaging/debian/smb.conf
===================================================================
--- packaging/debian/smb.conf	(revision 12205)
+++ packaging/debian/smb.conf	(working copy)
@@ -1,2 +0,0 @@
-# Example configuration file
-[global]
Index: packaging/debian/samba4-server.templates
===================================================================
--- packaging/debian/samba4-server.templates	(revision 0)
+++ packaging/debian/samba4-server.templates	(revision 0)
@@ -0,0 +1,32 @@
+Template: samba4-server/setup-pdc
+Type: boolean
+Default: false
+_Description: Set up Samba 4 as a PDC?
+ Do you want to set up Samba 4 as an Active Directory PDC? If you answer
+ "no", Samba will be left unconfigured, and you will have to provision and
+ make configuration files by hand.
+ .
+ Note that even if you answer "yes", you will need to set up DNS such that
+ it serves the data from the zone file in that directory before you can use
+ your Active Directory domain.
+
+Template: samba4-server/realm
+Type: string
+_Description: Realm
+ What Kerberos realm will your server be in? In many cases, this will be
+ the same as your DNS domain name (ie. YOUR.REALM).
+
+Template: samba4-server/domain
+Type: string
+_Description: Domain
+ What will be the domain of your server? This is also known as the
+ "workgroup" of your server, and is typically a short name without any dots
+ (ie. DOMAIN).
+
+Template: samba4-server/password
+Type: password
+_Description: Administrator password
+ You will need a password for the "Administrator" account. Note that in the
+ current version of the packaging, this will be visible in "ps" for a short
+ time for everybody on the system, so you might not want to use a very
+ sensitive password here.
Index: packaging/debian/po/templates.pot
===================================================================
--- packaging/debian/po/templates.pot	(revision 0)
+++ packaging/debian/po/templates.pot	(revision 0)
@@ -0,0 +1,85 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: jelmer at samba.org\n"
+"POT-Creation-Date: 2005-12-13 16:10+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../samba4-server.templates:4
+msgid "Set up Samba 4 as a PDC?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../samba4-server.templates:4
+msgid ""
+"Do you want to set up Samba 4 as an Active Directory PDC? If you answer \"no"
+"\", Samba will be left unconfigured, and you will have to provision and make "
+"configuration files by hand."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../samba4-server.templates:4
+msgid ""
+"Note that even if you answer \"yes\", you will need to set up DNS such that "
+"it serves the data from the zone file in that directory before you can use "
+"your Active Directory domain."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../samba4-server.templates:15
+msgid "Realm"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../samba4-server.templates:15
+msgid ""
+"What Kerberos realm will your server be in? In many cases, this will be the "
+"same as your DNS domain name (ie. YOUR.REALM)."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../samba4-server.templates:21
+msgid "Domain"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../samba4-server.templates:21
+msgid ""
+"What will be the domain of your server? This is also known as the \"workgroup"
+"\" of your server, and is typically a short name without any dots (ie. "
+"DOMAIN)."
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../samba4-server.templates:28
+msgid "Administrator password"
+msgstr ""
+
+#. Type: password
+#. Description
+#: ../samba4-server.templates:28
+msgid ""
+"You will need a password for the \"Administrator\" account. Note that in the "
+"current version of the packaging, this will be visible in \"ps\" for a short "
+"time for everybody on the system, so you might not want to use a very "
+"sensitive password here."
+msgstr ""
Index: packaging/debian/po/POTFILES.in
===================================================================
--- packaging/debian/po/POTFILES.in	(revision 0)
+++ packaging/debian/po/POTFILES.in	(revision 0)
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] samba4-server.templates


More information about the samba-technical mailing list