[pkg-fso-commits] [nodm] 48/50: upload to unstable (NMU: debian/0.12-1.1)
Mike Gabriel
sunweaver at debian.org
Mon Jan 23 15:19:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch master
in repository nodm.
commit ede6a3ff5249932963fdce5d337c3cfbdf0ef01a
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Jan 23 13:12:41 2017 +0100
upload to unstable (NMU: debian/0.12-1.1)
---
Makefile.am | 13 ++++++++++++-
debian/changelog | 8 ++++++++
debian/copyright | 15 +++++++++++++++
debian/nodm.config | 36 ++++++++++++++++++++++++++++++++++++
debian/nodm.init | 2 +-
debian/nodm.postinst | 41 ++++++++++++++++++++++++++++++++++++++++-
debian/nodm.templates | 20 ++++++++++++++++++++
debian/rules | 5 +++++
8 files changed, 137 insertions(+), 3 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 28709f9..299020f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,9 +64,12 @@ test_internals_SOURCES = $(testlibsources) \
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 @@ DISTCLEANFILES = Makefile.in \
config/* \
configure \
$(NULL)
+
+systemdsystemunitdir = $(prefix)/lib/systemd/system
+systemdsystemunit_DATA = nodm.service
+
+nodm.service: nodm.service.in
+ sed \
+ -e 's![@]sbindir[@]!${sbindir}!g' \
+ < $< > $@
diff --git a/debian/changelog b/debian/changelog
index 63e41e9..3594738 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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 <viiru at debian.org> Wed, 18 Jan 2017 17:29:22 +0200
+
nodm (0.12-1) unstable; urgency=low
[ Enrico Zini ]
diff --git a/debian/copyright b/debian/copyright
index c3be889..577d7d8 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -63,6 +63,17 @@ Copyright: 2008, Joachim Breitner <nomeata at debian.org>
2016, Mike Gabriel <sunweaver at debian.org>
License: GPL-2+
+Files:
+ debian/nodm.config
+ debian/nodm.postinst
+ debian/nodm.prerm
+Copyright:
+ 2000-2001, Branden Robinson
+ 2008, Joachim Breitner <nomeata at debian.org>
+ 2009-2011, Enrico Zini <enrico at debian.org>
+ 2016, Mike Gabriel <sunweaver at 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 @@ License: GPL-2+
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 --git a/debian/nodm.config b/debian/nodm.config
index 68fc680..40af76b 100644
--- a/debian/nodm.config
+++ b/debian/nodm.config
@@ -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 --git a/debian/nodm.init b/debian/nodm.init
index 48cc28a..6ab9738 100644
--- a/debian/nodm.init
+++ b/debian/nodm.init
@@ -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 --git a/debian/nodm.postinst b/debian/nodm.postinst
index 95243bf..2a6deb5 100644
--- a/debian/nodm.postinst
+++ b/debian/nodm.postinst
@@ -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 --git a/debian/nodm.templates b/debian/nodm.templates
index b8f9fc8..8579d1f 100644
--- a/debian/nodm.templates
+++ b/debian/nodm.templates
@@ -67,3 +67,23 @@ Default: /etc/X11/Xsession
_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 --git a/debian/rules b/debian/rules
index 01dbed9..62a74da 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,6 +12,11 @@ override_dh_auto_configure:
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
--
Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-fso/nodm.git
More information about the pkg-fso-commits
mailing list