packages: add listener (thanks to Raphaël Huck)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@28592 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2011-10-25 22:05:06 +00:00
parent a33e7031b1
commit 2b992b88be
2 changed files with 72 additions and 0 deletions

41
sound/listener/Makefile Normal file
View File

@ -0,0 +1,41 @@
#
# Copyright (C) 2011 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:=listener
PKG_VERSION:=1.7.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://www.vanheusden.com/listener/
PKG_MD5SUM:=8ad9c24c45c7d28aed606304a2bf80bf
include $(INCLUDE_DIR)/package.mk
define Package/listener
SECTION:=sound
CATEGORY:=Sound
DEPENDS:=+libncurses +libsndfile
TITLE:=Listener automatically records when sound is detected
URL:=http://www.vanheusden.com/listener/
endef
define Package/listener/description
This program listens for sound. If it detects any, it starts recording
automatically and also automatically stops when things become silent
again.
endef
define Package/listener/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/{listener,listenersoundpipe,setlistener} $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) $(PKG_BUILD_DIR)/listener.conf $(1)/etc/
endef
$(eval $(call BuildPackage,listener))

View File

@ -0,0 +1,31 @@
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,10 @@ VERSION=1.7.2
INSTALL_PREFIX=/usr/local
-CFLAGS+=-g -O2 -Wall -DVERSION=\"$(VERSION)\"
+ifeq ($(CFLAGS),)
+ CFLAGS:=-g -O2
+endif
+CFLAGS+=-Wall -DVERSION=\"$(VERSION)\"
OBJSsl=sl.o snd_dev.o error.o utils.o
OBJSli=listener.o snd_dev.o error.o utils.o lib.o
@@ -11,13 +14,13 @@ OBJSsp=snd_dev.o lsp.o error.o utils.o
all: setlistener listener listenersoundpipe
setlistener: $(OBJSsl)
- $(CC) -g -Wall -W $(OBJSsl) -ldl -lncurses -o setlistener
+ $(CC) $(CFLAGS) $(OBJSsl) $(LDFLAGS) -ldl -lncurses -o setlistener
listener: $(OBJSli)
- $(CC) -g -Wall -W $(OBJSli) -ldl -lm -lsndfile -o listener -DCONFIGFILE=$(INSTALL_PREFIX)/etc/listener.conf
+ $(CC) $(CFLAGS) $(OBJSli) $(LDFLAGS) -ldl -lm -lsndfile -o listener -DCONFIGFILE=$(INSTALL_PREFIX)/etc/listener.conf
listenersoundpipe: $(OBJSsp)
- $(CC) -g -Wall -W $(OBJSsp) -o listenersoundpipe
+ $(CC) $(CFLAGS) $(OBJSsp) -o listenersoundpipe
install: setlistener listener listenersoundpipe
cp setlistener $(INSTALL_PREFIX)/bin