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
:=2015-02-22
15 PKG_SOURCE_URL
:=https
://github.com
/credosemi
/smartsnmp
16 PKG_SOURCE_VERSION
:=ca1d455fd06748caa629fe7ad16a47cec8877b93
17 PKG_MIRROR_HASH
:=fda89ec37944b4f800eb3c0147678745b57f08c87f10d246d3c9d165a43418b4
19 PKG_MAINTAINER
:=Xiongfei Guo
<xfguo@credosemi.com
>
20 PKG_LICENSE
:=GPL-2.0
-or-later
21 PKG_LICENSE_FILES
:=LICENSE
23 PKG_BUILD_DEPENDS
:=scons
/host
25 include $(INCLUDE_DIR
)/package.mk
26 include ..
/..
/devel
/scons
/scons.mk
28 define Package
/smartsnmpd
31 DEPENDS
+=+lua
+liblua
+libubox
+libuci-lua
+libubus-lua
32 TITLE
:=Smart-SNMP
(Agent
)
33 URL
:=https
://github.com
/credosemi
/smartsnmp
36 define Package
/smartsnmpd
/description
37 smartsnmpd is an implementation of SNMP Agent. Its goal is
"Easily
38 writing boring SNMP MIB with Lua". This package add native support
39 for OpenWrt. Include using ubus and uci to
get system
info/status.
40 And
, it use libubox
/uloop
as low level event-driven library.
43 ifeq ($(CONFIG_BIG_ENDIAN
),y
)
44 TARGET_CFLAGS
+= -DBIG_ENDIAN
46 TARGET_CFLAGS
+= -DLITTLE_ENDIAN
49 SCONS_OPTIONS
+= --transport
=uloop
51 define Build
/Configure
52 (cd
$(PKG_BUILD_DIR
); \
54 CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
61 define Package
/smartsnmpd
/install
62 $(INSTALL_DIR
) $(1)/usr
/sbin
63 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bin
/smartsnmpd
$(1)/usr
/sbin
/smartsnmpd
65 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/smartsnmp
66 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/build
/smartsnmp
/core.so
$(1)/usr
/lib
/lua
/smartsnmp
/core.so
67 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/lualib
/smartsnmp
/*.lua
$(1)/usr
/lib
/lua
/smartsnmp
/
69 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/smartsnmp
/mibs
70 $(INSTALL_BIN
) .
/files
/mibs
/*.lua
$(1)/usr
/lib
/lua
/smartsnmp
/mibs
/
72 $(INSTALL_DIR
) $(1)/etc
/config
73 $(INSTALL_DATA
) .
/files
/smartsnmpd.conf
$(1)/etc
/config
/smartsnmpd
75 $(INSTALL_DIR
) $(1)/etc
/init.d
76 $(INSTALL_BIN
) .
/files
/smartsnmpd.init
$(1)/etc
/init.d
/smartsnmpd
79 $(eval
$(call BuildPackage
,smartsnmpd
))