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.

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