Browse Source

mbtools: add new package

Modbus tools based on libmodbus

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle 9 years ago
parent
commit
4b5ff22223

+ 53
- 0
utils/mbtools/Makefile View File

@@ -0,0 +1,53 @@
1
+#
2
+# Copyright (C) 2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=mbtools
11
+
12
+PKG_VERSION:=2014-10-29
13
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
14
+
15
+PKG_SOURCE_PROTO:=git
16
+PKG_SOURCE_URL:=git://github.com/webstack/mbtools
17
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18
+PKG_SOURCE_VERSION:=149e9c69cec180f18cf8781cf5285b97352bf719
19
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
20
+
21
+PKG_FIXUP:=autoreconf
22
+PKG_BUILD_PARALLEL:=1
23
+PKG_INSTALL:=1
24
+
25
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
26
+PKG_LICENSE:=BSD-3-Clause
27
+PKG_LICENSE_FILES:=LICENSE
28
+
29
+include $(INCLUDE_DIR)/package.mk
30
+
31
+define Package/mbtools
32
+  SECTION:=utils
33
+  CATEGORY:=Utilities
34
+  TITLE:=Modbus tools
35
+  DEPENDS:=+glib2 +libmodbus
36
+endef
37
+
38
+define Package/mbtools/description
39
+  Modbus tools based on libmodbus to log data fetched by a master/client or
40
+  received by a slave/server (writing of registers). mbcollect is able to act
41
+  as client or server (in TCP or RTU)
42
+endef
43
+
44
+
45
+define Package/mbtools/install
46
+	$(INSTALL_DIR) $(1)/usr/bin
47
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbrecorder $(1)/usr/bin/
48
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbcollect $(1)/usr/bin/
49
+	$(INSTALL_DIR) $(1)/etc
50
+	$(INSTALL_CONF) $(PKG_BUILD_DIR)/src/mbcollect.ini $(1)/etc
51
+endef
52
+
53
+$(eval $(call BuildPackage,mbtools))

+ 10
- 0
utils/mbtools/patches/100-fix-unit-test-server-return-value.patch View File

@@ -0,0 +1,10 @@
1
+Index: mbtools-2014-10-29/tests/unit-test-server.c
2
+===================================================================
3
+--- mbtools-2014-10-29.orig/tests/unit-test-server.c
4
++++ mbtools-2014-10-29/tests/unit-test-server.c
5
+@@ -117,4 +117,5 @@ int main(int argc, char *argv[])
6
+     }
7
+     printf("Quit the loop: %s\n", modbus_strerror(errno));
8
+     signal_handler(0);
9
++    return 0;
10
+ }