You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.2 KiB

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