[pkg-fso-commits] [SCM] Automatic Display Manager branch, master, updated. debian/0.1-52-g76526e2

Enrico Zini enrico at enricozini.org
Mon Feb 23 18:02:46 UTC 2009


The following commit has been merged in the master branch:
commit 1429a73a6a8cd30128ce353ada93391d148311de
Author: Enrico Zini <enrico at enricozini.org>
Date:   Fri Feb 13 15:04:32 2009 +0000

    More work on debconf

diff --git a/debian/control b/debian/control
index 46b568f..1b9bcbf 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: nodm
 Section: misc
 Priority: extra
 Maintainer: Joachim Breitner <nomeata at debian.org>
-Build-Depends: debhelper (>= 7)
+Build-Depends: debhelper (>= 7), po-debconf
 Standards-Version: 3.8.0
 Vcs-Git: http://git.debian.org/git/pkg-fso/nodm.git
 Vcs-Browser: http://git.debian.org/?p=pkg-fso/nodm.git;a=summary
diff --git a/debian/default/nodm b/debian/default/nodm
index cf599ef..b904e54 100644
--- a/debian/default/nodm
+++ b/debian/default/nodm
@@ -1,7 +1,7 @@
 # nodm configuration
 
-# Set NODM_ENABLED to something different than 'no' to enable nodm
-NODM_ENABLED=no
+# Set NODM_ENABLED to something different than 'false' to enable nodm
+NODM_ENABLED=false
 
 # User to autologin for
 NODM_USER=root
diff --git a/debian/nodm.config b/debian/nodm.config
new file mode 100644
index 0000000..cb746a8
--- /dev/null
+++ b/debian/nodm.config
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -s /etc/default/nodm ] ; then
+	. /etc/default/nodm
+
+	if [ -n "$NODM_ENABLED" ] ; then
+		db_set nodm/enabled "$NODM_ENABLED"
+	fi
+	if [ -n "$NODM_USER" ] ; then
+		db_set nodm/user "$NODM_USER"
+	fi
+	if [ -n "$NODM_X_OPTIONS" ] ; then
+		db_set nodm/x_options "$NODM_X_OPTIONS"
+	fi
+	if [ -n "$NODM_MIN_SESSION_TIME" ]; then
+		db_set nodm/min_session_time "$NODM_MIN_SESSION_TIME"
+	fi
+	if [ -n "$NODM_XINIT" ]; then
+		db_set nodm/xinit "$NODM_XINIT"
+	fi
+	if [ -n "$NODM_XSESSION" ]; then
+		db_set nodm/xsession "$NODM_XSESSION"
+	fi
+fi
+
+db_input medium nodm/enabled || true
+db_go
+
+db_get nodm/enabled
+START="$RET"
+
+if [ "x$START" = "xtrue" ] ; then
+	db_input medium nodm/user || true
+	db_go
+
+        db_input low nodm/x_options || true
+        db_go
+
+	db_input low nodm/min_session_time || true
+	db_go
+
+	db_input low nodm/xinit || true
+	db_go
+
+	db_input low nodm/xsession || true
+	db_go
+fi
+
diff --git a/debian/nodm.init b/debian/nodm.init
index c09e73f..e2017b8 100644
--- a/debian/nodm.init
+++ b/debian/nodm.init
@@ -25,9 +25,9 @@ NODM_X_OPTIONS="vt7 -nolisten tcp"
 NODM_USER=root
 NODM_MIN_SESSION_TIME=60
 
-if [ -f /etc/defaults/$NAME ]
+if [ -f /etc/default/$NAME ]
 then
-	. /etc/defaults/$NAME
+	. /etc/default/$NAME
 fi
 
 export NODM_XINIT NODM_XSESSION NODM_X_OPTIONS NODM_USER NODM_MIN_SESSION_TIME
@@ -48,9 +48,9 @@ export NODM_XINIT NODM_XSESSION NODM_X_OPTIONS NODM_USER NODM_MIN_SESSION_TIME
 case "$1" in
     start)
         [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-    	if [ "$NODM_ENABLED" == "no" ]
+    	if [ "$NODM_ENABLED" == "no" ] || [ "$NODM_ENABLED" == "false" ]
 	then
-		log_warning_msg "Not starting $NAME because NODM_ENABLED is 'no' in /etc/defaults/$NAME"
+		log_warning_msg "Not starting $NAME because NODM_ENABLED is 'no' in /etc/default/$NAME"
 	else
 		start-stop-daemon --start --oknodo --pidfile ${PIDFILE} --make-pidfile --background --exec /usr/sbin/nodm
 	fi
diff --git a/debian/nodm.postinst b/debian/nodm.postinst
new file mode 100644
index 0000000..f564ee7
--- /dev/null
+++ b/debian/nodm.postinst
@@ -0,0 +1,37 @@
+#! /bin/sh
+# postinst script for nodm
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ "$1" = "configure" ] ; then
+    # Update /etc/default/nodm
+    db_get nodm/enabled
+    NODM_ENABLED="$RET"
+    db_get nodm/user
+    NODM_USER="$RET"
+    db_get nodm/x_options
+    NODM_X_OPTIONS="$RET"
+    db_get nodm/min_session_time
+    NODM_MIN_SESSION_TIME="$RET"
+    db_get nodm/xinit
+    NODM_XINIT="$RET"
+    db_get nodm/xsession
+    NODM_XSESSION="$RET"
+
+    sed -i -r -e "s,^NODM_ENABLED=.+,NODM_ENABLED=$NODM_ENABLED," \
+              -e "s,^NODM_USER=.+,NODM_USER=$NODM_USER," \
+	      -e "s,^NODM_X_OPTIONS=.+,NODM_X_OPTIONS='$NODM_X_OPTIONS'," \
+	      -e "s,^NODM_MIN_SESSION_TIME=.+,NODM_MIN_SESSION_TIME=$NODM_MIN_SESSION_TIME," \
+	      -e "s,^NODM_XINIT=.+,NODM_XINIT=$NODM_XINIT," \
+	      -e "s,^NODM_XSESSION=.+,NODM_XSESSION=$NODM_XSESSION," \
+	      /etc/default/nodm
+fi
+	
+#DEBHELPER#
+
+# tell debconf we are done. otherwise, it hangs waiting for the daemon.
+db_stop;
+
+exit 0
diff --git a/debian/nodm.templates b/debian/nodm.templates
new file mode 100644
index 0000000..68a0f10
--- /dev/null
+++ b/debian/nodm.templates
@@ -0,0 +1,49 @@
+Template: nodm/enabled
+Type: boolean
+Default: false
+_Description: Start nodm on boot?
+ nodm starts an X session for a user without asking for authentication.  While
+ this is welcome for embedded or kiosks systems, it is a security problem in
+ most other machines, so by default nodm is configured not to start.
+ .
+ If you need autologin on this machine, enable nodm.
+
+Template: nodm/user
+Type: string
+Default: root
+_Description: User to start a session for:
+ nodm starts an X session for a user without asking for authentication.  What
+ user should be used for the session?
+
+Template: nodm/x_options
+Type: string
+Default: vt7 -nolisten tcp
+_Description: Options for the X server:
+ Options to pass to the X server when starting the session.
+
+Template: nodm/min_session_time
+Type: string
+Default: 60
+_Description: Minimum time (in seconds) for a session to be considered ok
+ If an X session will run for less than this time in seconds, nodm will wait an
+ amount of time before restarting the session.  The waiting time will grow
+ until a session lasts longer than this amount.
+
+Template: nodm/xinit
+Type: string
+Default: /usr/bin/xinit
+_Description: xinit program to use
+ You can change this to use a different xinit program.
+ .
+ nodm will start the X session with the command:
+ $NODM_XINIT $NODM_XSESSION -- $NODM_X_OPTIONS
+
+Template: nodm/xsession
+Type: string
+Default: /etc/X11/Xsession
+_Description: X session to use
+ You can change this to use a different X session script.
+ .
+ nodm will start the X session with the command:
+ $NODM_XINIT $NODM_XSESSION -- $NODM_X_OPTIONS
+
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 0000000..ca67fd6
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] nodm.templates
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 0000000..9a14c20
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,114 @@
+# 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.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: nodm at packages.debian.org\n"
+"POT-Creation-Date: 2009-02-13 14:52+0000\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
+#: ../nodm.templates:1001
+msgid "Start nodm on boot?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../nodm.templates:1001
+msgid ""
+"nodm starts an X session for a user without asking for authentication.  "
+"While this is welcome for embedded or kiosks systems, it is a security "
+"problem in most other machines, so by default nodm is configured not to "
+"start."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../nodm.templates:1001
+msgid "If you need autologin on this machine, enable nodm."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:2001
+msgid "User to start a session for:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:2001
+msgid ""
+"nodm starts an X session for a user without asking for authentication.  What "
+"user should be used for the session?"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:3001
+msgid "Options for the X server:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:3001
+msgid "Options to pass to the X server when starting the session."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:4001
+msgid "Minimum time (in seconds) for a session to be considered ok"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:4001
+msgid ""
+"If an X session will run for less than this time in seconds, nodm will wait "
+"an amount of time before restarting the session.  The waiting time will grow "
+"until a session lasts longer than this amount."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:5001
+msgid "xinit program to use"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:5001
+msgid "You can change this to use a different xinit program."
+msgstr ""
+
+#. Type: string
+#. Description
+#. Type: string
+#. Description
+#: ../nodm.templates:5001 ../nodm.templates:6001
+msgid ""
+"nodm will start the X session with the command: $NODM_XINIT $NODM_XSESSION "
+"-- $NODM_X_OPTIONS"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:6001
+msgid "X session to use"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../nodm.templates:6001
+msgid "You can change this to use a different X session script."
+msgstr ""

-- 
Automatic Display Manager



More information about the pkg-fso-commits mailing list