[packages_10.03.2] portsentry: merge r28964
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 15:55:08 +0000 (15:55 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 15:55:08 +0000 (15:55 +0000)
SVN-Revision: 30240

net/portsentry/Makefile
net/portsentry/files/portsentry.init

index 0c18ace5472d7fad29d50f81e5c7ec8d699376a4..ed0cf156002d60d7f77db7d57e4d9bbc1d1e8eac 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007 OpenWrt.org
+# Copyright (C) 2007-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=portsentry
 PKG_VERSION:=1.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-1.2.tar.gz
 PKG_SOURCE_URL:=@SF/sentrytools
@@ -32,14 +32,18 @@ define Package/portsentry/conffiles
 endef
 
 MAKE_FLAGS += \
+       CFLAGS="$(TARGET_CFLAGS) -DNODAEMON" \
        linux \
 
 define Package/portsentry/install      
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_NAME).conf $(1)/etc/
-       $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/portsentry $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/portsentry.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/portsentry.init $(1)/etc/init.d/portsentry
+       $(SED) 's|^\(.*_FILE\)="/usr/local/psionic/\(portsentry/.*\)"|\1="/var/run/\2"|g' \
+            $(1)/etc/portsentry.conf
 endef
 
 $(eval $(call BuildPackage,portsentry))
index dbaa362ddd8b7a6a782f18b6410069743ddd16b9..03e8835d6ce389db0d2661ff5d1b06fe3389d40c 100644 (file)
@@ -1,13 +1,22 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2007 OpenWrt.org
+# Copyright (C) 2007-2011 OpenWrt.org
+
 START=99
 
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+
 start() {
-       portsentry -atcp
-       portsentry -audp
+       mkdir -m 0755 -p /var/run/portsentry
+       SERVICE_PID_FILE="/var/run/portsentry-atcp.pid" \
+       service_start /usr/bin/portsentry -atcp
+       SERVICE_PID_FILE="/var/run/portsentry-audp.pid" \
+       service_start /usr/bin/portsentry -audp
 }
 
 stop() {
-       killall -9 portsentry
+       SERVICE_PID_FILE="/var/run/portsentry-atcp.pid" \
+       service_stop /usr/bin/portsentry
+       SERVICE_PID_FILE="/var/run/portsentry-audp.pid" \
+       service_stop /usr/bin/portsentry
 }
-