From 4b5ff22223500182b7b30cac6f9637af7645a802 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 11 Sep 2015 18:07:51 +0200 Subject: [PATCH] mbtools: add new package Modbus tools based on libmodbus Signed-off-by: Daniel Golle --- utils/mbtools/Makefile | 53 +++++++++++++++++++ ...00-fix-unit-test-server-return-value.patch | 10 ++++ 2 files changed, 63 insertions(+) create mode 100644 utils/mbtools/Makefile create mode 100644 utils/mbtools/patches/100-fix-unit-test-server-return-value.patch diff --git a/utils/mbtools/Makefile b/utils/mbtools/Makefile new file mode 100644 index 000000000..4b1705e1c --- /dev/null +++ b/utils/mbtools/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2015 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:=mbtools + +PKG_VERSION:=2014-10-29 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/webstack/mbtools +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=149e9c69cec180f18cf8781cf5285b97352bf719 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +PKG_MAINTAINER:=Daniel Golle +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/mbtools + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Modbus tools + DEPENDS:=+glib2 +libmodbus +endef + +define Package/mbtools/description + Modbus tools based on libmodbus to log data fetched by a master/client or + received by a slave/server (writing of registers). mbcollect is able to act + as client or server (in TCP or RTU) +endef + + +define Package/mbtools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbrecorder $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbcollect $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/mbcollect.ini $(1)/etc +endef + +$(eval $(call BuildPackage,mbtools)) diff --git a/utils/mbtools/patches/100-fix-unit-test-server-return-value.patch b/utils/mbtools/patches/100-fix-unit-test-server-return-value.patch new file mode 100644 index 000000000..1ad7c123a --- /dev/null +++ b/utils/mbtools/patches/100-fix-unit-test-server-return-value.patch @@ -0,0 +1,10 @@ +Index: mbtools-2014-10-29/tests/unit-test-server.c +=================================================================== +--- mbtools-2014-10-29.orig/tests/unit-test-server.c ++++ mbtools-2014-10-29/tests/unit-test-server.c +@@ -117,4 +117,5 @@ int main(int argc, char *argv[]) + } + printf("Quit the loop: %s\n", modbus_strerror(errno)); + signal_handler(0); ++ return 0; + }