Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_MD5SUM:=
  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. scons \
  40. prefix=/usr \
  41. $(SCONS_OPTIONS) \
  42. )
  43. endef
  44. define Package/smartsnmpd/install
  45. $(INSTALL_DIR) $(1)/usr/sbin
  46. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/smartsnmpd $(1)/usr/sbin/smartsnmpd
  47. $(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/smartsnmp/core.so $(1)/usr/lib/lua/smartsnmp/core.so
  49. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lualib/smartsnmp/*.lua $(1)/usr/lib/lua/smartsnmp/
  50. $(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp/mibs
  51. $(INSTALL_BIN) ./files/mibs/*.lua $(1)/usr/lib/lua/smartsnmp/mibs/
  52. $(INSTALL_DIR) $(1)/etc/config
  53. $(INSTALL_DATA) ./files/smartsnmpd.conf $(1)/etc/config/smartsnmpd
  54. $(INSTALL_DIR) $(1)/etc/init.d
  55. $(INSTALL_BIN) ./files/smartsnmpd.init $(1)/etc/init.d/smartsnmpd
  56. endef
  57. $(eval $(call BuildPackage,smartsnmpd))