2 # Copyright (C) 2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
11 PKG_VERSION
:=2014-08-13
12 PKG_RELEASE
=$(PKG_SOURCE_VERSION
)
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_HASH
:=fc7f3eef8341163e21aecf6abf2492fa90362877093baef9987af3c703baa6ea
22 PKG_MAINTAINER
:=Xiongfei Guo
<xfguo@credosemi.com
>
24 PKG_LICENSE_FILES
:=LICENSE
27 include $(INCLUDE_DIR
)/package.mk
28 include $(INCLUDE_DIR
)/scons.mk
30 define Package
/smartsnmpd
33 DEPENDS
+=+lua
+liblua
+libubox
+libuci-lua
+libubus-lua
34 TITLE
:=Smart-SNMP
(Agent
)
35 URL
:=https
://github.com
/credosemi
/smartsnmp
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.
45 SCONS_OPTIONS
+= --transport
=uloop
47 define Build
/Configure
48 (cd
$(PKG_BUILD_DIR
); \
50 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
57 define Package
/smartsnmpd
/install
58 $(INSTALL_DIR
) $(1)/usr
/sbin
59 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bin
/smartsnmpd
$(1)/usr
/sbin
/smartsnmpd
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
/
65 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/smartsnmp
/mibs
66 $(INSTALL_BIN
) .
/files
/mibs
/*.lua
$(1)/usr
/lib
/lua
/smartsnmp
/mibs
/
68 $(INSTALL_DIR
) $(1)/etc
/config
69 $(INSTALL_DATA
) .
/files
/smartsnmpd.conf
$(1)/etc
/config
/smartsnmpd
71 $(INSTALL_DIR
) $(1)/etc
/init.d
72 $(INSTALL_BIN
) .
/files
/smartsnmpd.init
$(1)/etc
/init.d
/smartsnmpd
75 $(eval
$(call BuildPackage
,smartsnmpd
))