git: 6479175b5c5c - main - net/libmodbus: [NEW PORT] Modbus TCP/RTU library for industrial communications

From: Älven <alven_at_FreeBSD.org>
Date: Mon, 12 Oct 2026 16:08:36 UTC
The branch main has been updated by alven:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6479175b5c5c80fd1b9912cc30d925ec16b76af7

commit 6479175b5c5c80fd1b9912cc30d925ec16b76af7
Author:     Luis Castellanos <ing.castellanosdz@gmail.com>
AuthorDate: 2026-10-12 14:57:27 +0000
Commit:     Älven <alven@FreeBSD.org>
CommitDate: 2026-10-12 16:07:45 +0000

    net/libmodbus: [NEW PORT] Modbus TCP/RTU library for industrial communications
    
    PR:             299193
    Reviewed by:    diizzy@
    Co-authored by: alven@
---
 net/Makefile            |  1 +
 net/libmodbus/Makefile  | 28 ++++++++++++++++++++++++++++
 net/libmodbus/distinfo  |  3 +++
 net/libmodbus/pkg-descr | 10 ++++++++++
 net/libmodbus/pkg-plist |  8 ++++++++
 5 files changed, 50 insertions(+)

diff --git a/net/Makefile b/net/Makefile
index ec7d7d0b9daa..fcdddcc18d4e 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -404,6 +404,7 @@
     SUBDIR += libmateweather
     SUBDIR += libmaxminddb
     SUBDIR += libmdf
+    SUBDIR += libmodbus
     SUBDIR += libnatpmp
     SUBDIR += libndp
     SUBDIR += libnet
diff --git a/net/libmodbus/Makefile b/net/libmodbus/Makefile
new file mode 100644
index 000000000000..c6b6003054fa
--- /dev/null
+++ b/net/libmodbus/Makefile
@@ -0,0 +1,28 @@
+PORTNAME=	libmodbus
+DISTVERSION=	3.2.0
+CATEGORIES=	net
+MASTER_SITES=	https://github.com/stephane/libmodbus/releases/download/v${DISTVERSION}/
+
+MAINTAINER=	ing.castellanosdz@gmail.com
+COMMENT=	Modbus library for GNU/Linux, Mac OS, FreeBSD and Windows
+WWW=		https://libmodbus.org/
+
+LICENSE=	LGPL21+
+LICENSE_FILE=	${WRKSRC}/COPYING.LESSER
+
+USES=		gmake libtool pathfix pkgconfig
+USE_LDCONFIG=	yes
+
+GNU_CONFIGURE=	yes
+
+INSTALL_TARGET=	install-strip
+TEST_TARGET=	check
+
+PORTDOCS=	AUTHORS NEWS.md README.md
+
+OPTIONS_DEFINE=	DOCS
+
+post-install-DOCS-off:
+	${RM} -r ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/net/libmodbus/distinfo b/net/libmodbus/distinfo
new file mode 100644
index 000000000000..613547e17027
--- /dev/null
+++ b/net/libmodbus/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1791327133
+SHA256 (libmodbus-3.2.0.tar.gz) = 72239f319b9b8483e3d393c5a60865d734fcff18a8abbb2486e389834a2f6ef1
+SIZE (libmodbus-3.2.0.tar.gz) = 491480
diff --git a/net/libmodbus/pkg-descr b/net/libmodbus/pkg-descr
new file mode 100644
index 000000000000..24217946be42
--- /dev/null
+++ b/net/libmodbus/pkg-descr
@@ -0,0 +1,10 @@
+libmodbus is a free software library to send/receive data according to the
+Modbus protocol. This library is written in C and supports RTU (serial) and
+TCP (Ethernet) communications. The functions included in the library have
+been designed with the following properties in mind: easy to use, portable
+(GNU/Linux, Mac OS, FreeBSD, QNX and Windows), high performance, and low
+memory footprint.
+
+The library provides functions to communicate with Modbus devices such as
+PLCs, HMIs, sensors, and other industrial equipment commonly found in
+SCADA and OT/ICS environments.
diff --git a/net/libmodbus/pkg-plist b/net/libmodbus/pkg-plist
new file mode 100644
index 000000000000..d3a8805137e7
--- /dev/null
+++ b/net/libmodbus/pkg-plist
@@ -0,0 +1,8 @@
+include/modbus/modbus-rtu.h
+include/modbus/modbus-tcp.h
+include/modbus/modbus-version.h
+include/modbus/modbus.h
+lib/libmodbus.so
+lib/libmodbus.so.5
+lib/libmodbus.so.5.1.0
+libdata/pkgconfig/libmodbus.pc