noddos: Noddos v0.5.0 with mDNS / DNS-SD support
[feed/packages.git] / net / smartsnmpd / Makefile
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 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
51 scons \
52 prefix=/usr \
53 $(SCONS_OPTIONS) \
54 )
55 endef
56
57 define Package/smartsnmpd/install
58 $(INSTALL_DIR) $(1)/usr/sbin
59 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/smartsnmpd $(1)/usr/sbin/smartsnmpd
60
61 $(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp
62 $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/smartsnmp/core.so $(1)/usr/lib/lua/smartsnmp/core.so
63 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lualib/smartsnmp/*.lua $(1)/usr/lib/lua/smartsnmp/
64
65 $(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp/mibs
66 $(INSTALL_BIN) ./files/mibs/*.lua $(1)/usr/lib/lua/smartsnmp/mibs/
67
68 $(INSTALL_DIR) $(1)/etc/config
69 $(INSTALL_DATA) ./files/smartsnmpd.conf $(1)/etc/config/smartsnmpd
70
71 $(INSTALL_DIR) $(1)/etc/init.d
72 $(INSTALL_BIN) ./files/smartsnmpd.init $(1)/etc/init.d/smartsnmpd
73 endef
74
75 $(eval $(call BuildPackage,smartsnmpd))
76