net/lsm: add link state monitor package. (thank you Brian J. Murrell)
[openwrt/svn-archive/archive.git] / net / lsm / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lsm
11 PKG_VERSION:=0.53
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://lsm.foobar.fi/download
16 PKG_MD5SUM:=983911b434a3c649fcefdc99e6ea2f37
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/lsm
21 SECTION:=net
22 CATEGORY:=Network
23 DEPENDS:=+ssmtp
24 TITLE:=A link state monitor
25 URL:=http://lsm.foobar.fi/
26 endef
27
28 define Package/lsm/description
29 lsm is a link state monitor for carrying out actions when a link
30 transistions from the up to down state or vice versa.
31 endef
32
33 define Package/lsm/conffiles
34 /etc/lsm/lsm.conf
35 endef
36
37 define Build/Prepare
38 $(call Build/Prepare/Default)
39 rmdir $(PKG_BUILD_DIR)
40 mv $(BUILD_DIR)/lsm $(PKG_BUILD_DIR)
41 endef
42
43 define Build/Compile
44 echo sed -ie 's/\$$$$(CC)/mipsel-openwrt-linux-uclibc-gcc/g' $(PKG_BUILD_DIR)/Makefile
45 $(MAKE) -C $(PKG_BUILD_DIR) CC=$(TARGET_CC)
46 endef
47
48 define Package/lsm/install
49 $(INSTALL_DIR) $(1)/usr/sbin
50 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsm $(1)/usr/sbin/
51 $(INSTALL_DIR) $(1)/etc/lsm
52 $(INSTALL_DIR) $(1)/etc/lsm/script.d
53 $(INSTALL_DIR) $(1)/etc/init.d
54 $(INSTALL_DATA) ./files/lsm.conf $(1)/etc/lsm/lsm.conf
55 $(INSTALL_BIN) ./files/lsm_script $(1)/etc/lsm/script
56 $(INSTALL_BIN) ./files/lsm.init $(1)/etc/init.d/lsm
57 endef
58
59 $(eval $(call BuildPackage,lsm))