From 4978db60656a4cf399f54d5be04a4a6e620d5af0 Mon Sep 17 00:00:00 2001 From: Ted Hess Date: Fri, 18 Jul 2014 16:03:56 -0400 Subject: [PATCH 1/3] Import zile from oldpackages, update copyright, pkg info Signed-off-by: Ted Hess --- utils/zile/Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 utils/zile/Makefile diff --git a/utils/zile/Makefile b/utils/zile/Makefile new file mode 100644 index 000000000..72c7f271a --- /dev/null +++ b/utils/zile/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=zile +PKG_VERSION:=2.3.24 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/zile +PKG_MD5SUM:=fe77d801ba69e0fb9b4914a04b9ff506 +PKG_MAINTAINER:=Ted Hess + +PKG_LICENSE:=GPL-3.0+ +PKG_LICENSE_FILE:=COPYING + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/zile + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncursesw + TITLE:=very small emacs-like editor + URL:=http://www.gnu.org/software/zile/ + SUBMENU:=Editors +endef + +define Package/zile/description + Zile is a small Emacs clone. Zile is a customizable, self-documenting + real-time display editor. Zile was written to be as similar as possible + to Emacs; every Emacs user should feel at home with Zile. +endef + +CONFIGURE_VARS += \ + gl_cv_func_getopt_gnu=yes + +define Package/zile/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,zile)) From 9df311619c6d91fcc711b7a2fc50ea160c5513e3 Mon Sep 17 00:00:00 2001 From: Ted Hess Date: Fri, 18 Jul 2014 16:36:16 -0400 Subject: [PATCH 2/3] Import cmdpad from oldpackages, add copyright, pkg info Signed-off-by: Ted Hess --- utils/cmdpad/Makefile | 61 +++++++++++++++++++ utils/cmdpad/files/cmdpad.init | 14 +++++ utils/cmdpad/patches/100-Makefile.patch | 35 +++++++++++ .../cmdpad/patches/120-kernel26-compat.patch | 15 +++++ utils/cmdpad/patches/130-no_zombie.patch | 18 ++++++ utils/cmdpad/patches/140-compile_fix.patch | 11 ++++ 6 files changed, 154 insertions(+) create mode 100644 utils/cmdpad/Makefile create mode 100644 utils/cmdpad/files/cmdpad.init create mode 100644 utils/cmdpad/patches/100-Makefile.patch create mode 100644 utils/cmdpad/patches/120-kernel26-compat.patch create mode 100644 utils/cmdpad/patches/130-no_zombie.patch create mode 100644 utils/cmdpad/patches/140-compile_fix.patch diff --git a/utils/cmdpad/Makefile b/utils/cmdpad/Makefile new file mode 100644 index 000000000..a85c12417 --- /dev/null +++ b/utils/cmdpad/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cmdpad +PKG_VERSION:=0.0.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/cmdpad +PKG_MD5SUM:=6633b2354b7f23f9cd8e2bfb6e735965 + +PKG_MAINTAINER:=Ted Hess +PKG_LICENSE:=MIT +PKG_LICENSE_FILE:=doc/COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/cmdpad + SECTION:=utils + CATEGORY:=Utilities + TITLE:=execute commands when a key is pressed, released or hold down + URL:=http://cmdpad.sourceforge.net/index.php +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +define Package/cmdpad/description + cmdpad - execute commands when a key is pressed, released or hold down. + Should be started from /etc/rc or /etc/rc.local. To run it as deamon you + need to start it with '&'. All logs are printed to standard out and standard + error (to write the log to disk use cmdpad > /var/log/cmdpad). Cmdpad + searches for /etc/cmdpad.conf and load the key bindings. Then wait for + key event and check each command to see if it should be run. +endef + +MAKE_FLAGS += \ + $(TARGET_CONFIGURE_OPTS) \ + $(1) + +define Package/cmdpad/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cmdpad $(1)/usr/sbin/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/cmdpad.conf $(1)/etc/ + $(INSTALL_BIN) ./files/cmdpad.init $(1)/etc/init.d/cmdpad +endef + +define Package/cmdpad/conffiles +/etc/cmdpad.conf +endef + +$(eval $(call BuildPackage,cmdpad)) diff --git a/utils/cmdpad/files/cmdpad.init b/utils/cmdpad/files/cmdpad.init new file mode 100644 index 000000000..f6120335d --- /dev/null +++ b/utils/cmdpad/files/cmdpad.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=93 + +SSD_DAEMONIZE=1 + +start() { + service_start /usr/sbin/cmdpad --quiet +} + +stop() { + service_stop /usr/sbin/cmdpad +} diff --git a/utils/cmdpad/patches/100-Makefile.patch b/utils/cmdpad/patches/100-Makefile.patch new file mode 100644 index 000000000..61a6c8f4c --- /dev/null +++ b/utils/cmdpad/patches/100-Makefile.patch @@ -0,0 +1,35 @@ +--- cmdpad-0.0.3/src/Makefile.orig 2008-01-05 23:29:44.000000000 +0100 ++++ cmdpad-0.0.3/src/Makefile 2008-01-05 23:30:23.000000000 +0100 +@@ -5,25 +5,25 @@ + TOP=.. + include $(TOP)/Makefile.common + +-INCLUDE= -I/usr/include +-LIBS= -L/usr/lib -lc +-CFLAGS= -g3 +-LDFLAGS= -Xlinker -Map -Xlinker $(PROG).map #,--stack,16Mb ++#INCLUDE= -I/usr/include ++#LIBS= -L/usr/lib -lc ++#CFLAGS= -g3 ++#LDFLAGS= -Xlinker -Map -Xlinker $(PROG).map #,--stack,16Mb + OBJ= main.o command.o parse.o + SCRIPTS= *.sh + + build: $(PROG) + + $(PROG): $(OBJ) +- gcc -o $(PROG) $(OBJ) $(LIBS) $(LDFLAGS) ++ $(GCC) -o $(PROG) $(OBJ) $(LIBS) $(LDFLAGS) + @echo "===============================================" + @echo "edit $(PROG).conf file to set default preferences" + + %.o : %.c +- gcc $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< ++ $(GCC) $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< + + %.o : %.c %.h +- gcc $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< ++ $(GCC) $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< + + distclean clean: + rm $(PROG) *~ *.o -vf diff --git a/utils/cmdpad/patches/120-kernel26-compat.patch b/utils/cmdpad/patches/120-kernel26-compat.patch new file mode 100644 index 000000000..eb7beeb32 --- /dev/null +++ b/utils/cmdpad/patches/120-kernel26-compat.patch @@ -0,0 +1,15 @@ +--- cmdpad-0.0.3/src/parse.orig 2008-01-05 23:55:32.000000000 +0100 ++++ cmdpad-0.0.3/src/parse.c 2008-01-05 23:56:07.000000000 +0100 +@@ -289,6 +289,12 @@ + pchEventDevice = strdup( pchValue) ; + return 1 ; + } ++ if( (pchValue != NULL) && ++ (strncmp( pchValue, "/dev/event", 6) == 0) ) ++ { ++ pchEventDevice = strdup( pchValue) ; ++ return 1 ; ++ } + printf( "Option 'device' expects a /dev/input/eventX argument\n"); + return -1 ; + } diff --git a/utils/cmdpad/patches/130-no_zombie.patch b/utils/cmdpad/patches/130-no_zombie.patch new file mode 100644 index 000000000..aa4fc6a0a --- /dev/null +++ b/utils/cmdpad/patches/130-no_zombie.patch @@ -0,0 +1,18 @@ +--- cmdpad-0.0.3/src/command.c.orig 2003-03-29 17:54:12.000000000 +0100 ++++ cmdpad-0.0.3/src/command.c 2008-01-12 05:41:22.000000000 +0100 +@@ -68,6 +68,7 @@ + + void exec( char * command) + { ++ int status; + if( fork() == 0) { + char ** tmp ; + int i ; +@@ -88,6 +89,7 @@ + perror( "ERROR: execv") ; + exit( 1) ; + } // end if( fork()) ++ wait(&status); + } + + int getNumberofEntry() diff --git a/utils/cmdpad/patches/140-compile_fix.patch b/utils/cmdpad/patches/140-compile_fix.patch new file mode 100644 index 000000000..c7a9bb3de --- /dev/null +++ b/utils/cmdpad/patches/140-compile_fix.patch @@ -0,0 +1,11 @@ +--- a/src/parse.c ++++ b/src/parse.c +@@ -125,7 +125,7 @@ int readCommandLine( int argc, char *arg + + d2printf( "command line command %s found\n", pchCommandTranslations[ iCmd+1]) ; + +- vsnprintf( achCommand, sizeof( achCommand), ++ snprintf( achCommand, sizeof( achCommand), + pchCommandTranslations[ iCmd+1], + &argv[ i+1]) ; + From e217ab69310176ae75db28520742f40c14d3e5f1 Mon Sep 17 00:00:00 2001 From: Ted Hess Date: Fri, 18 Jul 2014 16:37:27 -0400 Subject: [PATCH 3/3] Import triggerhappy from oldpackages, update copyright, license and pkg info Signed-off-by: Ted Hess --- utils/triggerhappy/Makefile | 58 +++++++++++++++++++ .../files/triggerhappy-example.conf | 14 +++++ utils/triggerhappy/files/triggerhappy.hotplug | 15 +++++ utils/triggerhappy/files/triggerhappy.init | 10 ++++ .../patches/100-fix-LINUX_INPUT_H.patch | 11 ++++ 5 files changed, 108 insertions(+) create mode 100644 utils/triggerhappy/Makefile create mode 100644 utils/triggerhappy/files/triggerhappy-example.conf create mode 100644 utils/triggerhappy/files/triggerhappy.hotplug create mode 100644 utils/triggerhappy/files/triggerhappy.init create mode 100644 utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch diff --git a/utils/triggerhappy/Makefile b/utils/triggerhappy/Makefile new file mode 100644 index 000000000..68464f8ce --- /dev/null +++ b/utils/triggerhappy/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=triggerhappy +PKG_VERSION:=0.3.4 +PKG_REV:=649bf670a012558393d7c41f3660d0a017edd982 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://github.com/wertarbyte/triggerhappy +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_MAINTAINER:=Ted Hess +PKG_LICENSE:=GPL-3.0+ +PKG_LICENSE_FILE:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/triggerhappy + SECTION:=utils + CATEGORY:=Utilities + TITLE:=handle input events and run configured programs + URL:=http://github.com/wertarbyte/triggerhappy +endef + +define Package/triggerhappy/description + triggerhappy - handle input events and run configured programs + The daemon thd can handle hotplugged input devices and is configured through + simple configuration files in /etc/triggerhappy/triggers.d/. +endef + +MAKE_FLAGS += \ + $(TARGET_CONFIGURE_OPTS) \ + $(1) + +define Package/triggerhappy/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/triggerhappy + $(INSTALL_DIR) $(1)/etc/triggerhappy/triggers.d/ + $(INSTALL_DIR) $(1)/etc/hotplug.d/input/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/thd $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/th-cmd $(1)/usr/sbin + $(INSTALL_BIN) ./files/triggerhappy.init $(1)/etc/init.d/triggerhappy + $(INSTALL_BIN) ./files/triggerhappy.hotplug $(1)/etc/hotplug.d/input/10-triggerhappy + $(INSTALL_BIN) ./files/triggerhappy-example.conf $(1)/etc/triggerhappy/triggers.d/example.conf +endef + +$(eval $(call BuildPackage,triggerhappy)) diff --git a/utils/triggerhappy/files/triggerhappy-example.conf b/utils/triggerhappy/files/triggerhappy-example.conf new file mode 100644 index 000000000..3a8017a7a --- /dev/null +++ b/utils/triggerhappy/files/triggerhappy-example.conf @@ -0,0 +1,14 @@ +# This is an example configuration for the triggerhappy daemon (thd) +# please note that every file to be processed must end in ".conf" +# +# To view a list of supported event codes, use "thd --listevents" or +# "thd --dump /dev/input/event*" +# +# Format: +# +# +# values for key events are 1 (pressed), 0 (released) or 2 (held) +# +## control an mpd instance +# KEY_NEXTSONG 1 /usr/bin/mpc next +# KEY_PREVSONG 1 /usr/bin/mpc prev diff --git a/utils/triggerhappy/files/triggerhappy.hotplug b/utils/triggerhappy/files/triggerhappy.hotplug new file mode 100644 index 000000000..78ad3496f --- /dev/null +++ b/utils/triggerhappy/files/triggerhappy.hotplug @@ -0,0 +1,15 @@ +#!/bin/sh +THD_SOCKET=/tmp/triggerhappy.socket +[ -S "$THD_SOCKET" ] || exit + +case "$ACTION" in + add) + DEVICE="/dev/$DEVNAME" + [ -c "$DEVICE" ] || exit + # offer device to triggerhappy daemon + /usr/sbin/th-cmd --socket "$THD_SOCKET" --add "$DEVICE" + ;; + remove) + # nothing to do + ;; +esac diff --git a/utils/triggerhappy/files/triggerhappy.init b/utils/triggerhappy/files/triggerhappy.init new file mode 100644 index 000000000..e846d29a7 --- /dev/null +++ b/utils/triggerhappy/files/triggerhappy.init @@ -0,0 +1,10 @@ +#!/bin/sh /etc/rc.common +START=93 + +start() { + /usr/sbin/thd --socket /tmp/triggerhappy.socket --triggers /etc/triggerhappy/triggers.d/ --daemon /dev/input/event* +} + +stop() { + /usr/sbin/th-cmd --socket /tmp/triggerhappy.socket --quit +} diff --git a/utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch b/utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch new file mode 100644 index 000000000..13ecd8c48 --- /dev/null +++ b/utils/triggerhappy/patches/100-fix-LINUX_INPUT_H.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -10,7 +10,7 @@ THCMD_COMPS := th-cmd cmdsocket + + MAKEDEPEND = $(CC) -M -MG $(CPPFLAGS) -o $*.d $< + +-LINUX_INPUT_H := $(shell echo '\#include ' | $(CC) $(CPPFLAGS) -M -E - | awk 'NR==1 {print $$2}') ++LINUX_INPUT_H := $(shell for i in `echo | $(CC) $(CPPFLAGS) -M -E -include 'linux/input.h' -`; do test -f "$$i" && echo "$$i" && break; done) + + all: thd th-cmd man +