[packages_10.03.2] lsm: merge r29090, r29199
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 5 Feb 2012 15:23:51 +0000 (15:23 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 5 Feb 2012 15:23:51 +0000 (15:23 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/packages_10.03.2@30216 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/lsm/Makefile
net/lsm/files/lsm.init

index 8efbe4c..864327d 100644 (file)
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2010-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lsm
 PKG_VERSION:=0.60
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://lsm.foobar.fi/download
 PKG_MD5SUM:=f4748308c0a1caa98d7e756778954116
 
-include $(INCLUDE_DIR)/package.mk
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
-PKG_UNPACK += && rmdir $(PKG_BUILD_DIR) && mv $(BUILD_DIR)/lsm $(PKG_BUILD_DIR)
+include $(INCLUDE_DIR)/package.mk
 
 define Package/lsm
   SECTION:=net
@@ -37,7 +37,9 @@ define Package/lsm/conffiles
 endef
 
 define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) CC="$(TARGET_CC)"
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               CC="$(TARGET_CC)" \
+               CFLAGS="$(TARGET_CFLAGS)"
 endef
 
 define Package/lsm/install
@@ -51,4 +53,8 @@ define Package/lsm/install
        $(INSTALL_BIN) ./files/lsm.init $(1)/etc/init.d/lsm
 endef
 
+define Package/lsm/conffiles
+/etc/lsm/lsm.conf
+endef
+
 $(eval $(call BuildPackage,lsm))
index d1ca4ff..a018fa5 100644 (file)
@@ -1,44 +1,19 @@
 #!/bin/sh /etc/rc.common
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-NAME=lsm
-PROG=/usr/sbin/$NAME
-DESC="Link State Monitor"
-PIDFILE=/var/run/lsm.pid
+# Copyright (C) 2010-2011 OpenWrt.org
+
 START=45
 
-test -x $PROG || exit 0
-set -e
+SERVICE_USE_PID=1
+SERVICE_PID_FILE=/var/run/lsm.pid
 
 start() {
-       echo -n "Starting $DESC: $NAME"
-       start-stop-daemon -q -S -p $PIDFILE -x $PROG -- /etc/lsm/lsm.conf $PIDFILE
-
-       echo "."
+       service_start /usr/sbin/lsm /etc/lsm/lsm.conf $SERVICE_PID_FILE
 }
 
 stop() {
-       echo -n "Stopping $DESC: $NAME"
-       start-stop-daemon -q -K -p $PIDFILE -x $PROG -- /etc/lsm/lsm.conf $PIDFILE
-       echo "."
-}
-
-restart() {
-       echo -n "Restarting $DESC: $NAME... "
-       start-stop-daemon -q -K -p $PIDFILE -x $PROG -- /etc/lsm/lsm.conf $PIDFILE
-       sleep 1
-       start-stop-daemon -q -S -p $PIDFILE -x $PROG -- /etc/lsm/lsm.conf $PIDFILE
-       echo "done."
+       service_stop /usr/sbin/lsm
 }
 
 reload() {
-       #
-       #       If the daemon can reload its config files on the fly
-       #       for example by sending it SIGHUP, do it here.
-       #
-       #       If the daemon responds to changes in its config file
-       #       directly anyway, make this a do-nothing entry.
-       #
-       echo -n "Reloading $DESC configuration... "
-       start-stop-daemon -q -K -s HUP -p $PIDFILE -x $PROG -- /etc/lsm/lsm.conf $PIDFILE
-       echo "done."
+       service_reload /usr/sbin/lsm
 }