From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XwZEg-00058y-R9 for ptxdist@pengutronix.de; Thu, 04 Dec 2014 17:26:34 +0100 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1XwZEg-0002uA-Pi for ptxdist@pengutronix.de; Thu, 04 Dec 2014 17:26:34 +0100 Date: Thu, 4 Dec 2014 17:26:34 +0100 From: Michael Olbrich Message-ID: <20141204162634.GD16181@pengutronix.de> References: <1417269886-30393-1-git-send-email-apr@cn-eng.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1417269886-30393-1-git-send-email-apr@cn-eng.de> Subject: Re: [ptxdist] [PATCH] triggerhappy: new package for triggerhappy (thd) version 0.3.4+git Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Sat, Nov 29, 2014 at 03:04:46PM +0100, Andreas Pretzsch wrote: > thd - triggerhappy global hotkey daemon > > Triggerhappy is a hotkey daemon developed with small and embedded > systems in mind, e.g. linux based routers. It attaches to the input > device files and interprets the event data received and executes > scripts configured in its configuration. > > Import release 0.3.4 + patches [release/0.3.4..master (cb3ed9b..aac9f35)] > and a fix for cross-compiling. > > Signed-off-by: Andreas Pretzsch > --- > generic/etc/init.d/triggerhappy | 74 +++++ > ...larify-licence-information-GPLv3-or-later.patch | 347 +++++++++++++++++++++ > ...ault-SIGCHLD-handler-for-spawned-processe.patch | 38 +++ > ...CE-environment-variable-so-that-triggers-.patch | 25 ++ > ...ve-leading-whitespaces-from-command-lines.patch | 27 ++ > ...-detect-linux-input.h-path-with-gcc-4.8.0.patch | 30 ++ > ...-detect-linux-input.h-path-with-cross-gcc.patch | 28 ++ > patches/triggerhappy-0.3.4/series | 9 + > rules/triggerhappy-bbinit.in | 7 + > rules/triggerhappy.in | 82 +++++ > rules/triggerhappy.make | 79 +++++ > 11 files changed, 746 insertions(+) > create mode 100644 generic/etc/init.d/triggerhappy > create mode 100644 patches/triggerhappy-0.3.4/0001-clarify-licence-information-GPLv3-or-later.patch > create mode 100644 patches/triggerhappy-0.3.4/0002-Restore-default-SIGCHLD-handler-for-spawned-processe.patch > create mode 100644 patches/triggerhappy-0.3.4/0003-Set-TH_DEVICE-environment-variable-so-that-triggers-.patch > create mode 100644 patches/triggerhappy-0.3.4/0004-remove-leading-whitespaces-from-command-lines.patch > create mode 100644 patches/triggerhappy-0.3.4/0005-fix-failure-to-detect-linux-input.h-path-with-gcc-4.8.0.patch > create mode 100644 patches/triggerhappy-0.3.4/0006-fix-failure-to-detect-linux-input.h-path-with-cross-gcc.patch > create mode 100644 patches/triggerhappy-0.3.4/series > create mode 100644 rules/triggerhappy-bbinit.in > create mode 100644 rules/triggerhappy.in > create mode 100644 rules/triggerhappy.make > > diff --git a/generic/etc/init.d/triggerhappy b/generic/etc/init.d/triggerhappy > new file mode 100644 > index 0000000..d475751 > --- /dev/null > +++ b/generic/etc/init.d/triggerhappy > @@ -0,0 +1,74 @@ > +#!/bin/sh > + > +PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin > +NAME=thd > +PNAME=triggerhappy > +DAEMON=/usr/sbin/thd > +PIDFILE=/var/run/$NAME.pid > +DAEMON_ARGS="--daemon --pidfile $PIDFILE --socket /var/run/thd.socket" > +DAEMON_ARGS="$DAEMON_ARGS --triggers @TRIGGERS@" > +DAEMON_ARGS="$DAEMON_ARGS --user @USER@" > +DAEMON_ARGS="$DAEMON_ARGS @INPUT_DEV@" > + > +[ -r /etc/default/$PNAME ] && . /etc/default/$PNAME > + > +case "$1" in > + start) > + echo -n "starting $PNAME..." > + start-stop-daemon -S -x "$DAEMON" -p "$PIDFILE" -- $DAEMON_ARGS > /dev/null 2>&1 > + if [ "$?" = "0" ]; then > + echo "done" > + else > + echo "failed" > + exit 1 > + fi > + ;; > + > + stop) > + echo -n "stopping $PNAME..." > + start-stop-daemon -K -p $PIDFILE > /dev/null 2>&1 > + if [ "$?" = "0" ]; then > + echo "done" > + else > + echo "failed" > + exit 1 > + fi > + ;; > + > + restart|force-reload) > + echo -n "restarting $PNAME..." > + start-stop-daemon -K -x "$DAEMON" -p $PIDFILE > /dev/null 2>&1 > + if [ "$?" = "0" ]; then > + echo "done" > + else > + echo "failed" > + exit 1 > + fi > + sleep 1 > + start-stop-daemon -S -x "$DAEMON" -p $PIDFILE > /dev/null 2>&1 > + if [ "$?" = "0" ]; then > + echo "done" > + else > + echo "failed" > + exit 1 > + fi > + ;; > + > + reload) > + echo -n "reloading $PNAME..." > + start-stop-daemon -K -x "$DAEMON" -p $PIDFILE -s 1 > /dev/null 2>&1 > + if [ "$?" = "0" ]; then > + echo "done" > + else > + echo "failed" > + exit 1 > + fi > + ;; > + > + *) > + echo "Usage: $0 {start|stop|restart|force-reload|reload}" >&2 > + exit 1 > + ;; > +esac > + > +exit 0 [...] > diff --git a/patches/triggerhappy-0.3.4/series b/patches/triggerhappy-0.3.4/series > new file mode 100644 > index 0000000..d4dde26 > --- /dev/null > +++ b/patches/triggerhappy-0.3.4/series > @@ -0,0 +1,9 @@ > +# release/0.3.4..master (cb3ed9b..aac9f35) > +0001-clarify-licence-information-GPLv3-or-later.patch > +0002-Restore-default-SIGCHLD-handler-for-spawned-processe.patch > +0003-Set-TH_DEVICE-environment-variable-so-that-triggers-.patch > +0004-remove-leading-whitespaces-from-command-lines.patch > +# https://github.com/wertarbyte/triggerhappy/issues/3 > +0005-fix-failure-to-detect-linux-input.h-path-with-gcc-4.8.0.patch > +# cross-compile fix > +0006-fix-failure-to-detect-linux-input.h-path-with-cross-gcc.patch > diff --git a/rules/triggerhappy-bbinit.in b/rules/triggerhappy-bbinit.in > new file mode 100644 > index 0000000..7bc1a57 > --- /dev/null > +++ b/rules/triggerhappy-bbinit.in > @@ -0,0 +1,7 @@ > +## SECTION=initmethod_bbinit > + > +config TRIGGERHAPPY_BBINIT_LINK > + string > + depends on TRIGGERHAPPY_STARTSCRIPT > + prompt "triggerhappy" > + default "S99triggerhappy" > diff --git a/rules/triggerhappy.in b/rules/triggerhappy.in > new file mode 100644 > index 0000000..017074a > --- /dev/null > +++ b/rules/triggerhappy.in > @@ -0,0 +1,82 @@ > +## SECTION=shell_and_console > + > +menuconfig TRIGGERHAPPY > + tristate > + prompt "triggerhappy " > + select BUSYBOX_START_STOP_DAEMON if TRIGGERHAPPY_STARTSCRIPT > + select BUSYBOX_FEATURE_START_STOP_DAEMON_FANCY if TRIGGERHAPPY_STARTSCRIPT > + help > + thd - triggerhappy global hotkey daemon > + > + Triggerhappy is a hotkey daemon developed with small and embedded > + systems in mind, e.g. linux based routers. It attaches to the input > + device files and interprets the event data received and executes > + scripts configured in its configuration. > + > +if TRIGGERHAPPY > + > +config TRIGGERHAPPY_STARTSCRIPT > + bool > + default y > + depends on TRIGGERHAPPY > + select TRIGGERHAPPY_INSTALL_CONFIG > + prompt "install /etc/init.d/triggerhappy" > + > +config TRIGGERHAPPY_INSTALL_CONFIG > + bool > + default y > + prompt "install trigger config" Is it usefull without config file? > + > + > +if TRIGGERHAPPY_INSTALL_CONFIG > + > +config TRIGGERHAPPY_TRIGGERS > + string > + prompt "trigger config file/directory" No prompt. Otherwise the default logic won't work. > + default "/etc/triggerhappy/triggers.d/" if TRIGGERHAPPY_TRIGGERS_DIR > + default "/etc/triggerhappy.conf" if TRIGGERHAPPY_TRIGGERS_FILE > + help > + Read trigger definitions from , which can either be a file or > + a directory. If a directory is specified, all its files matching the > + pattern *.conf are loaded. > + Create this file or directory with files in projectroot. > + default dir: "/etc/triggerhappy/triggers.d/" > + default file: "/etc/triggerhappy.conf" > + > +choice > + prompt "trigger definitions in" put the help here. > + default TRIGGERHAPPY_TRIGGERS_DIR > + config TRIGGERHAPPY_TRIGGERS_DIR > + bool > + prompt "dir" dont indent, and: prompt "/etc/triggerhappy/triggers.d/" > + config TRIGGERHAPPY_TRIGGERS_FILE > + bool > + prompt "file" same here. > +endchoice > + > +endif > + > + > +if TRIGGERHAPPY_STARTSCRIPT > + > +config TRIGGERHAPPY_USER > + string > + prompt "Change to user id after opening files" > + default "root" > + help > + Change to user id after opening files. This usually prevents > + thd from opening additional input devices, unless they are opened > + by the th-cmd program and their file descriptor are passed to the > + daemon or unless running as root. > + > +config TRIGGERHAPPY_INPUT_DEV > + string > + prompt "input device(s) to watch" > + default "/dev/input/event*" > + help > + Name or pattern of input devices to watch. > + Default: "/dev/input/event*" to watch all. > + > +endif > + > +endif > diff --git a/rules/triggerhappy.make b/rules/triggerhappy.make > new file mode 100644 > index 0000000..5889b50 > --- /dev/null > +++ b/rules/triggerhappy.make > @@ -0,0 +1,79 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2014 by Andreas Pretzsch > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +PACKAGES-$(PTXCONF_TRIGGERHAPPY) += triggerhappy > + > +TRIGGERHAPPY_VERSION := 0.3.4 > +TRIGGERHAPPY_MD5 := fa390c206432fafe899840e4b14a050d > +TRIGGERHAPPY := triggerhappy-$(TRIGGERHAPPY_VERSION) > +TRIGGERHAPPY_SUFFIX := tar.gz > +TRIGGERHAPPY_URL := https://github.com/wertarbyte/triggerhappy.git;tag=release/$(TRIGGERHAPPY_VERSION) use https://github.com/wertarbyte/triggerhappy/archive/release/0.3.4.tar.gz please. It's basically the same and avoids the git download magic. > +TRIGGERHAPPY_SOURCE := $(SRCDIR)/$(TRIGGERHAPPY).$(TRIGGERHAPPY_SUFFIX) > +TRIGGERHAPPY_DIR := $(BUILDDIR)/$(TRIGGERHAPPY) > +TRIGGERHAPPY_LICENSE := GPLv3+ > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +TRIGGERHAPPY_CONF_TOOL := NO > + > +# ---------------------------------------------------------------------------- > +# Compile > +# ---------------------------------------------------------------------------- > + > +TRIGGERHAPPY_PATH := PATH=$(CROSS_PATH) > +TRIGGERHAPPY_MAKE_ENV := \ $(CROSS_ENV) \ EXTRAFLAGS="$(CROSS_CPPFLAGS) $(CROSS_LDFLAGS)" break. > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/triggerhappy.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, triggerhappy) > + @$(call install_fixup, triggerhappy,PRIORITY,optional) > + @$(call install_fixup, triggerhappy,SECTION,base) > + @$(call install_fixup, triggerhappy,AUTHOR,"Andreas Pretzsch ") > + @$(call install_fixup, triggerhappy,DESCRIPTION,"thd - triggerhappy global hotkey daemon") > + > + @$(call install_copy, triggerhappy, 0, 0, 0755, -, /usr/sbin/thd) > + @$(call install_copy, triggerhappy, 0, 0, 0755, -, /usr/sbin/th-cmd) > + > +ifdef PTXCONF_INITMETHOD_BBINIT > +ifdef PTXCONF_TRIGGERHAPPY_STARTSCRIPT > + @$(call install_alternative, triggerhappy, 0, 0, 0755, /etc/init.d/triggerhappy) > + @$(call install_replace, triggerhappy, /etc/init.d/triggerhappy, \ > + @TRIGGERS@, "$(PTXCONF_TRIGGERHAPPY_TRIGGERS)") > + @$(call install_replace, triggerhappy, /etc/init.d/triggerhappy, \ > + @USER@, "$(PTXCONF_TRIGGERHAPPY_USER)") > + @$(call install_replace, triggerhappy, /etc/init.d/triggerhappy, \ > + @INPUT_DEV@, "$(PTXCONF_TRIGGERHAPPY_INPUT_DEV)") > +ifneq ($(call remove_quotes,$(PTXCONF_TRIGGERHAPPY_BBINIT_LINK)),) > + @$(call install_link, triggerhappy, \ > + ../init.d/triggerhappy, \ > + /etc/rc.d/$(PTXCONF_TRIGGERHAPPY_BBINIT_LINK)) > +endif > +endif > +endif > + > +ifdef PTXCONF_TRIGGERHAPPY_TRIGGERS_FILE > + @$(call install_alternative, triggerhappy, 0, 0, 0644, \ $(PTXCONF_TRIGGERHAPPY_TRIGGERS)) break > +endif > +ifdef PTXCONF_TRIGGERHAPPY_TRIGGERS_DIR > + @$(call install_alternative_tree, triggerhappy, 0, 0, $(PTXCONF_TRIGGERHAPPY_TRIGGERS)) same here. Michael > +endif > + > + @$(call install_finish, triggerhappy) > + > + @$(call touch) > + > +# vim: syntax=make > -- > 2.1.3 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de