From patchwork Mon Dec 8 22:55:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 418902 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 41F031400D5 for ; Tue, 9 Dec 2014 09:55:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8184D90FBD; Mon, 8 Dec 2014 22:55:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rLDyHOBU0Cvt; Mon, 8 Dec 2014 22:55:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8137190FC9; Mon, 8 Dec 2014 22:55:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8BFE61C2432 for ; Mon, 8 Dec 2014 22:55:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 86FBCA12DC for ; Mon, 8 Dec 2014 22:55:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5gyUwTrkUsZG for ; Mon, 8 Dec 2014 22:55:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 97018A11C9 for ; Mon, 8 Dec 2014 22:55:35 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id h11so6148537wiw.7 for ; Mon, 08 Dec 2014 14:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=VavaynaSOo8QhD54rgmsxQtv1+rY04zV/24iqjkQTPA=; b=zcKKWEuXZZCYVinH2+T8w54K4xnGlpZdz+CwqANTCsFAnA+HBe7BDCPPZR7ebekP30 Etpb+Bh/cCfasCNuIPtwLuClVRaqHAyTlg9QBXMmcMQolSxw72v0iXhHsO8/nNhGdb/+ Dop5u0kvxqy7Gz0lGhBBZR029b5OPfR+1DqNgWZUPrC3B6eQxpyTZOlK5ZGusk4jtPAd gDr1iZgwXeiEijoJZ7J4T0LnImnxt2KWqEfws07M4QGlsonXkSABo1KFdIQU8HS6at6v xL+VVZQHZ4XVoKS/N4AFJelOpoBwChsnn47r33afMpcS+TfGN+ID/CvUkuLlQneMHOl7 rv2A== X-Received: by 10.180.72.199 with SMTP id f7mr27836249wiv.53.1418079334185; Mon, 08 Dec 2014 14:55:34 -0800 (PST) Received: from dell.be.48ers.dk ([2001:6f8:1434:0:6267:20ff:fe4e:21b6]) by mx.google.com with ESMTPSA id kv6sm58299813wjb.9.2014.12.08.14.55.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Dec 2014 14:55:33 -0800 (PST) Received: from peko by dell.be.48ers.dk with local (Exim 4.84) (envelope-from ) id 1Xy7DI-00043S-4R; Mon, 08 Dec 2014 23:55:32 +0100 From: Peter Korsgaard To: buildroot@uclibc.org Date: Mon, 8 Dec 2014 23:55:28 +0100 Message-Id: <1418079328-15550-1-git-send-email-peter@korsgaard.com> X-Mailer: git-send-email 2.1.3 Subject: [Buildroot] [PATCH] triggerhappy: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Peter Korsgaard --- package/Config.in | 1 + package/triggerhappy/Config.in | 10 +++++++++ package/triggerhappy/S10triggerhappy | 40 ++++++++++++++++++++++++++++++++++++ package/triggerhappy/triggerhappy.mk | 37 +++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 package/triggerhappy/Config.in create mode 100755 package/triggerhappy/S10triggerhappy create mode 100644 package/triggerhappy/triggerhappy.mk diff --git a/package/Config.in b/package/Config.in index 600a68d..bb6587f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -378,6 +378,7 @@ endif source "package/ti-gfx/Config.in" source "package/ti-uim/Config.in" source "package/ti-utils/Config.in" + source "package/triggerhappy/Config.in" source "package/uboot-tools/Config.in" source "package/udev/Config.in" source "package/udisks/Config.in" diff --git a/package/triggerhappy/Config.in b/package/triggerhappy/Config.in new file mode 100644 index 0000000..3cd1ada --- /dev/null +++ b/package/triggerhappy/Config.in @@ -0,0 +1,10 @@ +config BR2_PACKAGE_TRIGGERHAPPY + bool "triggerhappy" + help + 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. + + https://github.com/wertarbyte/triggerhappy diff --git a/package/triggerhappy/S10triggerhappy b/package/triggerhappy/S10triggerhappy new file mode 100755 index 0000000..dd975ab --- /dev/null +++ b/package/triggerhappy/S10triggerhappy @@ -0,0 +1,40 @@ +#!/bin/sh + +NAME=thd +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid +DAEMON_ARGS="--daemon --triggers /etc/triggerhappy/triggers.d --socket /var/run/thd.socket --pidfile $PIDFILE --user nobody /dev/input/event*" + +# Sanity checks +test -x $DAEMON || exit 0 + +[ -r /etc/default/triggerhappy ] && . /etc/default/triggerhappy + +do_start() { + echo -n "Starting $NAME: " + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \ + && echo "OK" || echo "FAIL" +} + +do_stop() { + echo -n "Stopping $NAME: " + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + && echo "OK" || echo "FAIL" +} + +case "$1" in + start) + do_start + ;; + stop) + do_stop + ;; + restart) + do_stop + sleep 1 + do_start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac diff --git a/package/triggerhappy/triggerhappy.mk b/package/triggerhappy/triggerhappy.mk new file mode 100644 index 0000000..d3dfc6a --- /dev/null +++ b/package/triggerhappy/triggerhappy.mk @@ -0,0 +1,37 @@ +################################################################################ +# +# triggerhappy +# +################################################################################ + +TRIGGERHAPPY_VERSION = aac9f353a28c0f414b27ac54bbbb2292c152eedc +TRIGGERHAPPY_SITE = $(call github,wertarbyte,triggerhappy,$(TRIGGERHAPPY_VERSION)) +TRIGGERHAPPY_LICENSE = GPLv3+ +TRIGGERHAPPY_LICENSE_FILES = COPYING + +define TRIGGERHAPPY_BUILD_CMDS + $(MAKE) $(TARGET_CONFIGURE_OPTS) \ + LINUX_INPUT_H=$(STAGING_DIR)/usr/include/linux/input.h \ + -C $(@D) thd th-cmd +endef + +ifeq ($(BR2_PACKAGE_HAS_UDEV),y) +define TRIGGERHAPPY_INSTALL_UDEV_RULE + $(INSTALL) -D -m 0644 $(@D)/udev/triggerhappy-udev.rules \ + $(TARGET_DIR)/lib/udev/rules.d/triggerhappy.rules +endef +endif + +define TRIGGERHAPPY_INSTALL_TARGET_CMDS + $(INSTALL) -d $(TARGET_DIR)/etc/triggerhappy/triggers.d + $(INSTALL) -D -m 0755 $(@D)/thd $(TARGET_DIR)/usr/sbin/thd + $(INSTALL) -D -m 0755 $(@D)/th-cmd $(TARGET_DIR)/usr/sbin/th-cmd + $(TRIGGERHAPPY_INSTALL_UDEV_RULE) +endef + +define TRIGGERHAPPY_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D package/triggerhappy/S10triggerhappy \ + $(TARGET_DIR)/etc/init.d/S10triggerhappy +endef + +$(eval $(generic-package))