packages: add listener (thanks to Raphaƫl Huck)
authornico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 25 Oct 2011 22:05:06 +0000 (22:05 +0000)
committernico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 25 Oct 2011 22:05:06 +0000 (22:05 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28592 3c298f89-4303-0410-b956-a3cf2f4a3e73

sound/listener/Makefile [new file with mode: 0644]
sound/listener/patches/100-makefile.patch [new file with mode: 0644]

diff --git a/sound/listener/Makefile b/sound/listener/Makefile
new file mode 100644 (file)
index 0000000..76b6554
--- /dev/null
@@ -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))
diff --git a/sound/listener/patches/100-makefile.patch b/sound/listener/patches/100-makefile.patch
new file mode 100644 (file)
index 0000000..bd254b8
--- /dev/null
@@ -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