packages/portsentry: pass optimization flags, disable daemon support, use new service functions

git-svn-id: svn://svn.openwrt.org/openwrt/packages@28964 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2011-11-12 01:30:18 +00:00
parent 5d5098542d
commit 480a8d9dc1
2 changed files with 24 additions and 11 deletions

View 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. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=portsentry PKG_NAME:=portsentry
PKG_VERSION:=1.2 PKG_VERSION:=1.2
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-1.2.tar.gz PKG_SOURCE:=$(PKG_NAME)-1.2.tar.gz
PKG_SOURCE_URL:=@SF/sentrytools PKG_SOURCE_URL:=@SF/sentrytools
@ -32,14 +32,18 @@ define Package/portsentry/conffiles
endef endef
MAKE_FLAGS += \ MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -DNODAEMON" \
linux \ linux \
define Package/portsentry/install 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_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 endef
$(eval $(call BuildPackage,portsentry)) $(eval $(call BuildPackage,portsentry))

View File

@ -1,13 +1,22 @@
#!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org # Copyright (C) 2007-2011 OpenWrt.org
START=99 START=99
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
start() { start() {
portsentry -atcp mkdir -m 0755 -p /var/run/portsentry
portsentry -audp 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() { 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
} }