lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

Makefile (2099B)


      1 #
      2 # Copyright (C) 2014 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:=smartsnmpd
     11 PKG_VERSION:=2014-08-13
     12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
     13 
     14 PKG_SOURCE_PROTO:=git
     15 PKG_SOURCE_URL:=https://github.com/credosemi/smartsnmp.git
     16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
     17 PKG_SOURCE_VERSION:=fb93473d895f058b2d8975d3cfa280ae2a8ae98d
     18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
     19 PKG_MIRROR_MD5SUM:=
     20 
     21 
     22 PKG_MAINTAINER:=Xiongfei Guo <xfguo@credosemi.com>
     23 PKG_LICENSE:=GPL-2.0
     24 PKG_LICENSE_FILES:=LICENSE
     25 
     26 
     27 include $(INCLUDE_DIR)/package.mk
     28 include $(INCLUDE_DIR)/scons.mk
     29 
     30 define Package/smartsnmpd
     31   SECTION:=net
     32   CATEGORY:=Network
     33   DEPENDS+=+lua +liblua +libubox +libuci-lua +libubus-lua
     34   TITLE:=Smart-SNMP (Agent)
     35   URL:=https://github.com/credosemi/smartsnmp
     36 endef
     37 
     38 define Package/smartsnmpd/description
     39 smartsnmpd is an implementation of SNMP Agent. Its goal is "Easily
     40 writing boring SNMP MIB with Lua". This package add native support
     41 for OpenWrt. Include using ubus and uci to get system info/status. 
     42 And, it use libubox/uloop as low level event-driven library.
     43 endef
     44 
     45 SCONS_OPTIONS += --transport=uloop
     46 
     47 define Build/Configure
     48 	(cd $(PKG_BUILD_DIR); \
     49 		$(SCONS_VARS) \
     50 		scons \
     51 			prefix=/usr \
     52 			$(SCONS_OPTIONS) \
     53 	)
     54 endef
     55 
     56 define Package/smartsnmpd/install
     57 	$(INSTALL_DIR) $(1)/usr/sbin
     58 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/smartsnmpd $(1)/usr/sbin/smartsnmpd
     59 
     60 	$(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp
     61 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/smartsnmp/core.so $(1)/usr/lib/lua/smartsnmp/core.so
     62 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/lualib/smartsnmp/*.lua $(1)/usr/lib/lua/smartsnmp/
     63 
     64 	$(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp/mibs
     65 	$(INSTALL_BIN) ./files/mibs/*.lua $(1)/usr/lib/lua/smartsnmp/mibs/
     66 	
     67 	$(INSTALL_DIR) $(1)/etc/config
     68 	$(INSTALL_DATA) ./files/smartsnmpd.conf $(1)/etc/config/smartsnmpd
     69 
     70 	$(INSTALL_DIR) $(1)/etc/init.d
     71 	$(INSTALL_BIN) ./files/smartsnmpd.init $(1)/etc/init.d/smartsnmpd
     72 endef
     73 
     74 $(eval $(call BuildPackage,smartsnmpd))
     75