nodm: new package
authorEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tue, 28 Jun 2016 23:16:00 +0000 (20:16 -0300)
committerPeter Korsgaard <peter@korsgaard.com>
Wed, 29 Jun 2016 12:48:02 +0000 (14:48 +0200)
[Peter: propagate linux-pam dependencies/comment,
needs wordexp.h, not available on uClibc,
use /etc/default/nodm for config override,
correct github/site/source handling,
disable help2man]
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/Config.in
package/nodm/Config.in [new file with mode: 0644]
package/nodm/S90nodm [new file with mode: 0755]
package/nodm/nodm.hash [new file with mode: 0644]
package/nodm/nodm.mk [new file with mode: 0644]
package/nodm/nodm.pam [new file with mode: 0644]

index e5ddc3ea2425b02e96d7839310c1942c51c633f3..4c39b124e1ae3aaac99b6e814d7434338c3c7123 100644 (file)
@@ -307,6 +307,7 @@ comment "X applications"
        source "package/gtkperf/Config.in"
        source "package/leafpad/Config.in"
        source "package/midori/Config.in"
+       source "package/nodm/Config.in"
        source "package/pcmanfm/Config.in"
        source "package/qt-webkit-kiosk/Config.in"
        source "package/rdesktop/Config.in"
diff --git a/package/nodm/Config.in b/package/nodm/Config.in
new file mode 100644 (file)
index 0000000..b8629a2
--- /dev/null
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_NODM
+       bool "nodm"
+       depends on BR2_PACKAGE_XORG7
+       depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
+       depends on !BR2_STATIC_LIBS # linux-pam
+       depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
+       depends on !BR2_TOOLCHAIN_USES_UCLIBC # needs wordexp.h
+       select BR2_PACKAGE_XLIB_LIBX11
+       select BR2_PACKAGE_LINUX_PAM
+       help
+         nodm is a minimal display manager that simply logs in
+         as a given user and starts an X session, without asking
+         for username or password.
+
+         For those cases where automatic login is needed (and
+         does not imply a security issue), nodm is simple to setup,
+         lightweight, and it should do exactly the right thing.
+
+         https://github.com/spanezz/nodm/
+
+comment "nodm needs a glibc toolchain w/ wchar, locale, dynamic library"
+       depends on BR2_PACKAGE_XORG7
+       depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
+               || BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL \
+               || BR2_TOOLCHAIN_USES_UCLIBC
diff --git a/package/nodm/S90nodm b/package/nodm/S90nodm
new file mode 100755 (executable)
index 0000000..a966e83
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Starts nodm
+#
+
+NODM_FIRST_VT=7
+NODM_XSESSION=/etc/X11/Xsession
+NODM_OPTIONS=
+NODM_X_OPTIONS="-nolisten tcp"
+NODM_USER=root
+NODM_MIN_SESSION_TIME=60
+NODM_X_TIMEOUT=300
+
+[ -r /etc/default/nodm ] && . /etc/default/nodm
+
+export NODM_XSESSION NODM_X_OPTIONS NODM_USER NODM_MIN_SESSION_TIME NODM_FIRST_VT NODM_X_TIMEOUT
+
+start() {
+       printf "Starting nodm: "
+       start-stop-daemon -S -q -p /var/run/nodm.pid --exec /usr/sbin/nodm -b -m -S -- ${NODM_OPTIONS}
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+stop() {
+       printf "Stopping nodm: "
+       start-stop-daemon -K -q -p /var/run/nodm.pid
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+       stop
+       sleep 1
+       start
+}
+
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart|reload)
+       restart
+       ;;
+  *)
+       echo "Usage: $0 {start|stop|restart}"
+       exit 1
+esac
+
+exit $?
diff --git a/package/nodm/nodm.hash b/package/nodm/nodm.hash
new file mode 100644 (file)
index 0000000..e11e875
--- /dev/null
@@ -0,0 +1,2 @@
+# locally calculated
+sha256  840939d27d3d9b02ad09e1cffce24729bcdeee6cea6b3f0037d8ae76b49feecd  nodm-0.12-1.tar.gz
diff --git a/package/nodm/nodm.mk b/package/nodm/nodm.mk
new file mode 100644 (file)
index 0000000..da6bc85
--- /dev/null
@@ -0,0 +1,34 @@
+################################################################################
+#
+# nodm
+#
+################################################################################
+
+NODM_VERSION = 0.12-1
+NODM_SITE = $(call github,spanezz,nodm,debian/$(NODM_VERSION))
+NODM_LICENSE = GPLv2+
+NODM_LICENSE_FILES = COPYING
+NODM_AUTORECONF = YES
+
+NODM_DEPENDENCIES = xlib_libX11 linux-pam
+
+# help2man doesn't work when cross compiling
+define NODM_DISABLE_HELP2MAN
+       $(SED) 's/help2man/true/' $(@D)/Makefile.am
+endef
+
+NODM_POST_PATCH_HOOKS += NODM_DISABLE_HELP2MAN
+
+define NODM_INSTALL_PAM
+       $(INSTALL) -D -m 0644 package/nodm/nodm.pam \
+               $(TARGET_DIR)/etc/pam.d/nodm
+endef
+
+NODM_POST_INSTALL_TARGET_HOOKS += NODM_INSTALL_PAM
+
+define NODM_INSTALL_INIT_SYSV
+       $(INSTALL) -D -m 0755 package/nodm/S90nodm \
+               $(TARGET_DIR)/etc/init.d/S90nodm
+endef
+
+$(eval $(autotools-package))
diff --git a/package/nodm/nodm.pam b/package/nodm/nodm.pam
new file mode 100644 (file)
index 0000000..f2cf432
--- /dev/null
@@ -0,0 +1,14 @@
+# Log service and allow promiscuously
+#
+auth           required        pam_warn.so
+auth           required        pam_unix.so
+
+account                required        pam_warn.so
+account                required        pam_permit.so
+
+password       required        pam_warn.so
+password       required        pam_permit.so
+
+session                required        pam_warn.so
+session                required        pam_permit.so
+session                required        pam_env.so