mirror of
https://github.com/openwrt/packages.git
synced 2025-12-10 12:41:22 +00:00
cmdpad: Remove from packages and move to packages-abondoned
Signed-off-by: Ted Hess <thess@kitschensync.net>
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
#
|
||||
# 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:=7
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
|
||||
PKG_SOURCE_URL:=@SF/cmdpad
|
||||
PKG_HASH:=19963f20f1af50fab0013fb373af294ea412da7241d1ea91fad90455291948b9
|
||||
|
||||
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=doc/COPYING
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/cmdpad
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=execute commands when key is pressed/released/held 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 daemon 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))
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/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
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/src/command.c
|
||||
+++ b/src/command.c
|
||||
@@ -160,7 +160,7 @@ int addCommand( char * command, unsigned
|
||||
struct CMD * tmp ;
|
||||
int count ;
|
||||
|
||||
- count = getNumberofEntry( cmd) ;
|
||||
+ count = getNumberofEntry() ;
|
||||
if( count >= 0) {
|
||||
cmd = (struct CMD *) realloc( cmd,
|
||||
(count+2)*sizeof( struct CMD)) ;
|
||||
@@ -1,35 +0,0 @@
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -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
|
||||
@@ -1,15 +0,0 @@
|
||||
--- a/src/parse.c
|
||||
+++ b/src/parse.c
|
||||
@@ -289,6 +289,12 @@ int ParseCommand( char * pchCommandLine)
|
||||
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 ;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
--- a/src/command.c
|
||||
+++ b/src/command.c
|
||||
@@ -68,6 +68,7 @@ struct CMD * cmd = NULL ;
|
||||
|
||||
void exec( char * command)
|
||||
{
|
||||
+ int status;
|
||||
if( fork() == 0) {
|
||||
char ** tmp ;
|
||||
int i ;
|
||||
@@ -88,6 +89,7 @@ void exec( char * command)
|
||||
perror( "ERROR: execv") ;
|
||||
exit( 1) ;
|
||||
} // end if( fork())
|
||||
+ wait(&status);
|
||||
}
|
||||
|
||||
int getNumberofEntry()
|
||||
@@ -1,11 +0,0 @@
|
||||
--- 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]) ;
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
--- a/src/command.c
|
||||
+++ b/src/command.c
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
#include <linux/input.h>
|
||||
#include <linux/ioctl.h>
|
||||
+#include <sys/wait.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
--- a/src/main.c
|
||||
+++ b/src/main.c
|
||||
@@ -54,6 +54,7 @@
|
||||
|
||||
#include "debug.h"
|
||||
#include "command.h"
|
||||
+#include "parse.h"
|
||||
|
||||
#define DEBUGNAME "MAIN: "
|
||||
|
||||
--- a/src/parse.c
|
||||
+++ b/src/parse.c
|
||||
@@ -58,7 +58,7 @@
|
||||
extern char * pchProgramName ;
|
||||
extern char * pchEventDevice ;
|
||||
|
||||
-inline void ltrim( char * pchText)
|
||||
+static void ltrim( char * pchText)
|
||||
{
|
||||
if( pchText) {
|
||||
char * pchTxt = pchText ;
|
||||
@@ -67,7 +67,7 @@ inline void ltrim( char * pchText)
|
||||
}
|
||||
}
|
||||
|
||||
-inline void rtrim( char * pchText)
|
||||
+static void rtrim( char * pchText)
|
||||
{
|
||||
if( pchText)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ inline void rtrim( char * pchText)
|
||||
}
|
||||
}
|
||||
|
||||
-inline void trim( char * pchText)
|
||||
+static void trim( char * pchText)
|
||||
{
|
||||
ltrim( pchText) ;
|
||||
rtrim( pchText) ;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/src/parse.c
|
||||
+++ b/src/parse.c
|
||||
@@ -257,7 +257,7 @@ int ParseCommand( char * pchCommandLine)
|
||||
|
||||
pchValue = strtok( pchValue, ",") ;
|
||||
d2printf( "Value is '%s'\n", pchValue) ;
|
||||
- if( (pchValue == NULL ) || ( sscanf( pchValue, "%d", &code) != 1) )
|
||||
+ if( (pchValue == NULL ) || ( sscanf( pchValue, "%hu", &code) != 1) )
|
||||
return -1 ;
|
||||
|
||||
pchValue = strtok( NULL, ",") ;
|
||||
Reference in New Issue
Block a user