Control: tags -1 + pending

Dear maintainer,

I've prepared an NMU for nodm (versioned as 0.12-1.1) and uploaded it to
DELAYED/2. Please feel free to tell me if I should delay it longer.

Regards.

-- 
Arto Jantunen

diff -Nru nodm-0.12/debian/changelog nodm-0.12/debian/changelog
--- nodm-0.12/debian/changelog	2016-03-23 17:13:51.000000000 +0200
+++ nodm-0.12/debian/changelog	2017-01-18 17:29:22.000000000 +0200
@@ -1,3 +1,11 @@
+nodm (0.12-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Apply patches from Simon McVittie to add a native systemd service
+    file (Closes: #796203).
+
+ -- Arto Jantunen <vi...@debian.org>  Wed, 18 Jan 2017 17:29:22 +0200
+
 nodm (0.12-1) unstable; urgency=low
 
   [ Enrico Zini ]
diff -Nru nodm-0.12/debian/copyright nodm-0.12/debian/copyright
--- nodm-0.12/debian/copyright	2016-03-23 16:54:40.000000000 +0200
+++ nodm-0.12/debian/copyright	2017-01-18 17:29:22.000000000 +0200
@@ -63,6 +63,17 @@
            2016, Mike Gabriel <sunwea...@debian.org>
 License: GPL-2+
 
+Files:
+ debian/nodm.config
+ debian/nodm.postinst
+ debian/nodm.prerm
+Copyright:
+ 2000-2001, Branden Robinson
+ 2008, Joachim Breitner <nome...@debian.org>
+ 2009-2011, Enrico Zini <enr...@debian.org>
+ 2016, Mike Gabriel <sunwea...@debian.org>
+License: GPL-2
+
 License: GPL-2+
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
@@ -81,3 +92,7 @@
  On Debian systems, the full text of the GNU General Public
  License version 2 can be found in the file
  `/usr/share/common-licenses/GPL-2'.
+
+License: GPL-2
+ Licensed under the GNU General Public License, version 2.  See the file
+ /usr/share/common-licenses/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.
diff -Nru nodm-0.12/debian/nodm.config nodm-0.12/debian/nodm.config
--- nodm-0.12/debian/nodm.config	2016-03-23 16:54:40.000000000 +0200
+++ nodm-0.12/debian/nodm.config	2017-01-18 17:29:22.000000000 +0200
@@ -1,9 +1,45 @@
 #!/bin/sh
 
+# Partially based on gdm3.config, © 2000-2001 Branden Robinson.
+# Licensed under the GNU General Public License, version 2.  See the file
+# /usr/share/common-licenses/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.
+
+
 set -e
 
 . /usr/share/debconf/confmodule
 
+THIS_PACKAGE=nodm
+DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
+
+# set default display manager
+
+db_get shared/default-x-display-manager
+OLD_DEFAULT="$RET"
+
+db_metaget shared/default-x-display-manager owners
+OWNERS="$RET"
+db_metaget shared/default-x-display-manager choices
+CHOICES="$RET"
+
+if [ "$OWNERS" != "$CHOICES" ]; then
+  db_subst shared/default-x-display-manager choices $OWNERS
+  db_fset shared/default-x-display-manager seen false
+fi
+
+db_input high shared/default-x-display-manager || true
+db_go
+
+# using this display manager?
+db_get shared/default-x-display-manager
+CURRENT_DEFAULT="$RET"
+# set a flag to indicate to postinst that we need to update from debconf
+if [ "$OLD_DEFAULT" != "$CURRENT_DEFAULT" ]; then
+  DEFAULT_DISPLAY_MANAGER_DIR=$(dirname $DEFAULT_DISPLAY_MANAGER_FILE)
+  test -e $DEFAULT_DISPLAY_MANAGER_DIR || mkdir -p $DEFAULT_DISPLAY_MANAGER_DIR
+  touch $DEFAULT_DISPLAY_MANAGER_FILE.debconf-update
+fi
+
 if [ -s /etc/default/nodm ] ; then
 	. /etc/default/nodm
 
diff -Nru nodm-0.12/debian/nodm.init nodm-0.12/debian/nodm.init
--- nodm-0.12/debian/nodm.init	2016-03-23 16:54:40.000000000 +0200
+++ nodm-0.12/debian/nodm.init	2017-01-18 17:29:22.000000000 +0200
@@ -1,7 +1,7 @@
 #!/bin/sh
 ### BEGIN INIT INFO
 # Provides:       nodm
-# Should-Start:   console-screen kbd hal bluetooth
+# Should-Start:   bluetooth
 # Required-Start: $remote_fs
 # Required-Stop:
 # Default-Start:  2 3 4 5
diff -Nru nodm-0.12/debian/nodm.postinst nodm-0.12/debian/nodm.postinst
--- nodm-0.12/debian/nodm.postinst	2016-03-23 16:54:40.000000000 +0200
+++ nodm-0.12/debian/nodm.postinst	2017-01-18 17:29:22.000000000 +0200
@@ -1,10 +1,49 @@
 #! /bin/sh
-# postinst script for nodm
+# postinst script for nodm, partially based on gdm3.postinst
 
 set -e
 
+THIS_PACKAGE=nodm
+DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
+
 . /usr/share/debconf/confmodule
 
+# debconf is not a registry, so we only fiddle with the default file if
+# the configure script requested an update
+if [ -e $DEFAULT_DISPLAY_MANAGER_FILE.debconf-update ]; then
+  rm -f $DEFAULT_DISPLAY_MANAGER_FILE.debconf-update
+  if db_get shared/default-x-display-manager; then
+    # workaround debconf passthru bug (#379198)
+    if [ -z "$RET" ]; then
+      RET="$THIS_PACKAGE"
+    fi
+    if [ "$THIS_PACKAGE" != "$RET" ]; then
+      echo "Please be sure to run \"dpkg --configure $RET\"."
+    fi
+    if db_get "$RET"/daemon_name; then
+      echo "$RET" > $DEFAULT_DISPLAY_MANAGER_FILE
+    fi
+  fi
+fi
+
+DEFAULT_SERVICE=/etc/systemd/system/display-manager.service
+# set default-display-manager systemd service link according to our config
+if [ "$1" = configure ] && [ -d /etc/systemd/system/ ]; then
+  if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
+    SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service
+    if [ -h "$DEFAULT_SERVICE" ] && [ $(readlink "$DEFAULT_SERVICE") = /dev/null ]; then
+      echo "Display manager service is masked" >&2
+    elif [ -e "$SERVICE" ]; then
+      ln -sf "$SERVICE" "$DEFAULT_SERVICE"
+    else
+      echo "WARNING: $SERVICE is the selected default display manager but does not exist" >&2
+      rm -f "$DEFAULT_SERVICE"
+    fi
+  else
+    rm -f "$DEFAULT_SERVICE"
+  fi
+fi
+
 if [ "$1" = "configure" ] ; then
 	if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.2"; then
 		# Before version 0.2, nodm was only used on the OpenMoko.  To
diff -Nru nodm-0.12/debian/nodm.prerm nodm-0.12/debian/nodm.prerm
--- nodm-0.12/debian/nodm.prerm	1970-01-01 02:00:00.000000000 +0200
+++ nodm-0.12/debian/nodm.prerm	2017-01-18 17:29:22.000000000 +0200
@@ -0,0 +1,83 @@
+#!/bin/bash
+# Debian nodm package pre-removal script
+#
+# Based on gdm3.prerm:
+# © 2001 Branden Robinson
+#
+# Licensed under the GNU General Public License, version 2.  See the file
+# /usr/share/common-licenses/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.
+# Acknowlegements to Stephen Early, Mark Eichin, and Manoj Srivastava.
+
+set -e
+
+THIS_PACKAGE=nodm
+DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
+
+if [ "$1" = "remove" -o "$1" = "deconfigure" ]; then
+  if [ -e /usr/share/debconf/confmodule ]; then
+    . /usr/share/debconf/confmodule
+    # disown this question
+    db_unregister shared/default-x-display-manager || true
+    # does the question still exist?
+    if db_get shared/default-x-display-manager; then
+      db_metaget shared/default-x-display-manager owners
+      db_subst shared/default-x-display-manager choices "$RET"
+      db_get shared/default-x-display-manager
+      # are we removing the currently selected display manager?
+      if [ "$THIS_PACKAGE" = "$RET" ]; then
+        if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
+          db_get "$RET"/daemon_name
+          if [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" = "$RET" ]; then
+            rm "$DEFAULT_DISPLAY_MANAGER_FILE"
+          fi
+        fi
+        # ask the user to choose a new default
+        db_fset shared/default-x-display-manager seen false
+        db_input critical shared/default-x-display-manager || true
+        db_go
+        # if the display manager file doesn't exist, write it with the path
+        # to the new default display manager
+        if [ ! -e $DEFAULT_DISPLAY_MANAGER_FILE ]; then
+          db_get shared/default-x-display-manager
+          echo "Please be sure to run \"dpkg-reconfigure $RET\"."
+          db_get "$RET"/daemon_name
+          echo "$RET" > "$DEFAULT_DISPLAY_MANAGER_FILE"
+        fi
+      fi
+    fi
+  fi
+
+  DEFAULT_SERVICE=/etc/systemd/system/display-manager.service
+  # set default-display-manager systemd service link according to our config
+  if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
+    SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service
+    if [ -h "$DEFAULT_SERVICE" ] && [ $(readlink "$DEFAULT_SERVICE") = /dev/null ]; then
+      echo "Display manager service is masked" >&2
+    elif [ -e "$SERVICE" ]; then
+      ln -sf "$SERVICE" "$DEFAULT_SERVICE"
+    else
+      echo "WARNING: $SERVICE is the selected default display manager but does not exist" >&2
+      rm -f "$DEFAULT_SERVICE"
+    fi
+  else
+    rm -f "$DEFAULT_SERVICE"
+  fi
+fi
+
+if [ "$1" = "remove" ]; then
+  if [ -x /etc/init.d/nodm ]; then
+    nostop=
+    for hostname in "" "localhost" "$(hostname)" "$(hostname -f)"; do
+      if echo $DISPLAY | grep -q "^$hostname:0.*"; then
+        nostop=yes
+      fi
+    done
+    if [ -z $nostop ]; then
+      invoke-rc.d nodm stop
+    fi
+  fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff -Nru nodm-0.12/debian/nodm.templates nodm-0.12/debian/nodm.templates
--- nodm-0.12/debian/nodm.templates	2016-03-23 16:54:40.000000000 +0200
+++ nodm-0.12/debian/nodm.templates	2017-01-18 17:29:22.000000000 +0200
@@ -67,3 +67,23 @@
 _Description: X session to use:
  Please choose the name of the X session script to use with nodm.
 
+Template: nodm/daemon_name
+Type: string
+Default: /usr/sbin/nodm
+Description: for internal use only
+
+Template: shared/default-x-display-manager
+Type: select
+Choices: ${choices}
+_Description: Default display manager:
+ A display manager is a program that provides graphical login capabilities for
+ the X Window System.
+ .
+ Only one display manager can manage a given X server, but multiple display
+ manager packages are installed. Please select which display manager should
+ run by default.
+ .
+ Multiple display managers can run simultaneously if they are configured to
+ manage different servers; to achieve this, configure the display managers
+ accordingly, edit each of their init scripts in /etc/init.d, and disable the
+ check for a default display manager.
diff -Nru nodm-0.12/debian/rules nodm-0.12/debian/rules
--- nodm-0.12/debian/rules	2016-03-23 16:54:40.000000000 +0200
+++ nodm-0.12/debian/rules	2017-01-18 17:29:22.000000000 +0200
@@ -12,6 +12,11 @@
 	NOCONFIGURE=1 ./autogen.sh
 	dh_auto_configure $(DHFLAGS)
 
+override_dh_auto_install:
+	dh_auto_install -- systemdsystemunitdir=/lib/systemd/system
+	echo "# Debian-specific change until all display managers participate in /etc/X11/default-display-manager" >> debian/nodm/lib/systemd/system/nodm.service
+	echo "ExecStartPre=/bin/sh -c '[ \"\$$(cat /etc/X11/default-display-manager 2>/dev/null)\" = \"/usr/sbin/nodm\" ]'" >> debian/nodm/lib/systemd/system/nodm.service
+
 override_dh_auto_test:
 	#make check
 
diff -Nru nodm-0.12/Makefile.am nodm-0.12/Makefile.am
--- nodm-0.12/Makefile.am	2016-03-23 16:54:40.000000000 +0200
+++ nodm-0.12/Makefile.am	2017-01-18 17:29:22.000000000 +0200
@@ -64,9 +64,12 @@
 EXTRA_DIST = test_nodm		\
              nodm-man-extras	\
              autogen.sh		\
+             nodm.service.in	\
              $(NULL)
 
-CLEANFILES = nodm.8
+CLEANFILES = $(man_MANS) \
+             $(systemdsystemunit_DATA) \
+             $(NULL)
 
 DISTCLEANFILES = Makefile.in   \
                  aclocal.m4    \
@@ -74,3 +77,11 @@
                  config/*      \
                  configure     \
                  $(NULL)
+
+systemdsystemunitdir = $(prefix)/lib/systemd/system
+systemdsystemunit_DATA = nodm.service
+
+nodm.service: nodm.service.in
+	sed \
+		-e 's![@]sbindir[@]!${sbindir}!g' \
+		< $< > $@
diff -Nru nodm-0.12/nodm.service.in nodm-0.12/nodm.service.in
--- nodm-0.12/nodm.service.in	1970-01-01 02:00:00.000000000 +0200
+++ nodm-0.12/nodm.service.in	2017-01-18 17:29:22.000000000 +0200
@@ -0,0 +1,10 @@
+[Unit]
+Description=Display manager for automatic session logins
+Documentation=man:nodm(8)
+After=systemd-user-sessions.service
+
+[Service]
+EnvironmentFile=-/etc/default/nodm
+ExecStartPre=/usr/bin/test ${NODM_ENABLED} != no -a ${NODM_ENABLED} != false
+ExecStart=@sbindir@/nodm $NODM_OPTIONS
+Restart=always
_______________________________________________
pkg-fso-maint mailing list
pkg-fso-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-fso-maint

Reply via email to