1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-13 19:03:52 +02:00
openwrt-packages/net/smartsnmpd/Makefile
Petr Štetiar c3bacb6631 iotivity,smartsnmpd,gpsd: use scons from feed
commit 0c090fde68b2 ("scons: move host build tool to a proper place")
has moved scons into the packages feeds, so switch to that package
include and adjust build dependency to a new scons home.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-09-13 07:14:08 +02:00

81 lines
2.2 KiB
Makefile

#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=smartsnmpd
PKG_VERSION:=2015-02-22
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/credosemi/smartsnmp
PKG_SOURCE_VERSION:=ca1d455fd06748caa629fe7ad16a47cec8877b93
PKG_MIRROR_HASH:=fda89ec37944b4f800eb3c0147678745b57f08c87f10d246d3c9d165a43418b4
PKG_MAINTAINER:=Xiongfei Guo <xfguo@credosemi.com>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=scons/host
include $(INCLUDE_DIR)/package.mk
include ../../devel/scons/scons.mk
define Package/smartsnmpd
SECTION:=net
CATEGORY:=Network
DEPENDS+=+lua +liblua +libubox +libuci-lua +libubus-lua
TITLE:=Smart-SNMP (Agent)
URL:=https://github.com/credosemi/smartsnmp
endef
define Package/smartsnmpd/description
smartsnmpd is an implementation of SNMP Agent. Its goal is "Easily
writing boring SNMP MIB with Lua". This package add native support
for OpenWrt. Include using ubus and uci to get system info/status.
And, it use libubox/uloop as low level event-driven library.
endef
ifeq ($(CONFIG_BIG_ENDIAN),y)
TARGET_CFLAGS += -DBIG_ENDIAN
else
TARGET_CFLAGS += -DLITTLE_ENDIAN
endif
SCONS_OPTIONS += --transport=uloop
define Build/Configure
(cd $(PKG_BUILD_DIR); \
$(SCONS_VARS) \
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
scons \
prefix=/usr \
$(SCONS_OPTIONS) \
)
endef
define Package/smartsnmpd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/smartsnmpd $(1)/usr/sbin/smartsnmpd
$(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/smartsnmp/core.so $(1)/usr/lib/lua/smartsnmp/core.so
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lualib/smartsnmp/*.lua $(1)/usr/lib/lua/smartsnmp/
$(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp/mibs
$(INSTALL_BIN) ./files/mibs/*.lua $(1)/usr/lib/lua/smartsnmp/mibs/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/smartsnmpd.conf $(1)/etc/config/smartsnmpd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/smartsnmpd.init $(1)/etc/init.d/smartsnmpd
endef
$(eval $(call BuildPackage,smartsnmpd))