$ git show --format=fuller --patch-with-stat --summary da1e14a6ad85d0898faab2fe9547e9ba392df279
commit da1e14a6ad85d0898faab2fe9547e9ba392df279
Author: mandian <mandian@users.noreply.github.com>
AuthorDate: Sun Apr 13 18:04:06 2025 +0100
Commit: mandian <mandian@users.noreply.github.com>
CommitDate: Sun Apr 13 18:21:16 2025 +0100
3.1.11
---
.abf.yml | 2 +-
libmodbus-3.1.11-dont_install_docs.patch | 11 ++++
libmodbus-3.1.11-honor-cflags-cxxflags.patch | 18 ++++++
libmodbus.spec | 91 +++++++++++++---------------
4 files changed, 73 insertions(+), 49 deletions(-)
create mode 100644 libmodbus-3.1.11-dont_install_docs.patch
create mode 100644 libmodbus-3.1.11-honor-cflags-cxxflags.patch
diff --git a/.abf.yml b/.abf.yml
index b09346b..889f55f 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -1,2 +1,2 @@
sources:
- libmodbus-3.1.1.tar.gz: 3878af4a93a01001dd3bb8db90d24d5180545b91
+ libmodbus-3.1.11.tar.gz: 3c82c60061c48fbb656ec5776768525970d638ae
diff --git a/libmodbus-3.1.11-dont_install_docs.patch b/libmodbus-3.1.11-dont_install_docs.patch
new file mode 100644
index 0000000..c12b101
--- /dev/null
+++ b/libmodbus-3.1.11-dont_install_docs.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -7,7 +7,7 @@ pkgconfig_DATA = libmodbus.pc
+ EXTRA_DIST = libmodbus.pc.in
+ CLEANFILES += libmodbus.pc
+
+-dist_doc_DATA = AUTHORS NEWS README.md
++#dist_doc_DATA = AUTHORS NEWS README.md
+
+ SUBDIRS = src
+
diff --git a/libmodbus-3.1.11-honor-cflags-cxxflags.patch b/libmodbus-3.1.11-honor-cflags-cxxflags.patch
new file mode 100644
index 0000000..1b2b7d9
--- /dev/null
+++ b/libmodbus-3.1.11-honor-cflags-cxxflags.patch
@@ -0,0 +1,18 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -179,11 +179,11 @@ AC_ARG_ENABLE([debug],
+ [enable_debug=no])
+
+ AS_IF([test "x$enable_debug" = "xyes"], [
+- CFLAGS="-g -O0"
+- CXXFLAGS="-g -O0"
++ CFLAGS+=" -g -O0"
++ CXXFLAGS+=" -g -O0"
+ ], [
+- CFLAGS="-O2"
+- CXXFLAGS="-O2"
++ CFLAGS+=" -O2"
++ CXXFLAGS+=" -O2"
+ ])
+
+ AC_OUTPUT
diff --git a/libmodbus.spec b/libmodbus.spec
index bbc2751..05c456f 100644
--- a/libmodbus.spec
+++ b/libmodbus.spec
@@ -1,39 +1,50 @@
%define major 5
-%define libname %mklibname modbus %major
-%define devellibname %mklibname -d modbus
+%define libname %mklibname modbus
+%define oldlibname %mklibname modbus 5
+%define devellibname %mklibname -d modbus
Name: libmodbus
-Version: 3.1.1
+Version: 3.1.11
Release: 1
Summary: A Modbus library
Group: System/Libraries
License: LGPLv2+
URL: https://www.libmodbus.org/
-Source0: http://libmodbus.org/releases/%{name}-%{version}.tar.gz
-BuildRequires: autoconf, automake, libtool, xmlto, asciidoc
+Source0: https://github.com/stephane/libmodbus/releases/download/v%{version}/%{name}-%{version}.tar.gz
+BuildRequires: asciidoc
+BuildRequires: slibtool
+BuildRequires: xmlto
+BuildSystem: autotools
+
+%patchlist
+libmodbus-3.1.11-dont_install_docs.patch
+libmodbus-3.1.11-honor-cflags-cxxflags.patch
%description
-libmodbus is a C library designed to provide
-a fast and robust implementation of
-the Modbus protocol.
-It runs on Linux, Mac OS X,
-FreeBSD, QNX and Windows.
-This package contains the
-libmodbus shared library.
+libmodbus is a C library designed to provide a fast and robust
+implementation of the Modbus protocol.
+
+It runs on Linux, Mac OS X, FreeBSD, QNX and Windows.
+
+#----------------------------------------------------------------------
%package -n %libname
Summary: A Modbus library
Group: System/Libraries
+%rename %{oldlibname}
%description -n %libname
-libmodbus is a C library designed to provide
-a fast and robust implementation of
-the Modbus protocol.
-It runs on Linux, Mac OS X, FreeBSD,
-QNX and Windows.
-This package contains the
-libmodbus shared library.
+libmodbus is a C library designed to provide a fast and robust
+implementation of the Modbus protocol.
+It runs on Linux, Mac OS X, FreeBSD, QNX and Windows.
+
+This package contains the libmodbus shared library.
+
+%files -n %{libname}
+%{_libdir}/libmodbus.so.%{major}*
+
+#----------------------------------------------------------------------
%package -n %devellibname
Summary: Development files for libmodbus
@@ -41,40 +52,24 @@ Group: Development/C
Requires: %{libname} = %{version}-%{release}
Provides: modbus-devel = %{version}-%{release}
-
%description -n %devellibname
+libmodbus is a C library designed to provide a fast and robust
+implementation of the Modbus protocol.
-libmodbus is a C library designed
-to provide a fast and robust implementation of
-the Modbus protocol.
-It runs on Linux, Mac OS X,
-FreeBSD, QNX and Windows.
-
-This package contains libraries,
-header files and developer documentation needed
-for developing software which
-uses the libmodbus library.
+It runs on Linux, Mac OS X, FreeBSD, QNX and Windows.
-%prep
-%setup -q
-
-%build
-autoreconf -fi
-%configure --disable-silent-rules
-%make
-
-%install
-%makeinstall_std
-rm -f %{buildroot}/%{_libdir}/*.la
-
-%files -n %{libname}
-%doc AUTHORS MIGRATION NEWS COPYING*
-%{_libdir}/libmodbus.so.*
+This package contains libraries, header files and developer documentation
+needed for developing software which uses the libmodbus library.
%files -n %{devellibname}
-%{_includedir}/libmodbus/
+%license COPYING*
+%doc AUTHORS NEWS README.md
%{_includedir}/modbus/
%{_libdir}/pkgconfig/libmodbus.pc
%{_libdir}/libmodbus.so
-%{_mandir}/man7/*.7.*
-%{_mandir}/man3/*.3.*
+
+#----------------------------------------------------------------------
+
+%prep
+%autosetup -p1
+