From ff16ab852f389e0af0a1930d91c6698f323527eb Mon Sep 17 00:00:00 2001 From: tangce Date: Wed, 10 Sep 2025 09:13:01 +0000 Subject: [PATCH] use /usr/share/iproute2 for config files (cherry picked from commit c2ffc6b0eff46764bdaec716d4337457e9cebf6d) --- ...-makefile-use-share-for-config-files.patch | 54 +++++++++++++++++++ iproute.spec | 11 +++- 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 backport-change-makefile-use-share-for-config-files.patch diff --git a/backport-change-makefile-use-share-for-config-files.patch b/backport-change-makefile-use-share-for-config-files.patch new file mode 100644 index 0000000..0138c0f --- /dev/null +++ b/backport-change-makefile-use-share-for-config-files.patch @@ -0,0 +1,54 @@ +From 962692356a1cc41932e43575f3c50927e455ab53 Mon Sep 17 00:00:00 2001 +From: Andrea Claudi +Date: Wed, 15 Nov 2023 18:25:35 +0100 +Subject: [PATCH] Makefile: use /usr/share/iproute2 for config files + +According to FHS: + +"/usr/lib includes object files and libraries. On some systems, it may +also include internal binaries that are not intended to be executed +directly by users or shell scripts." + +A better directory to store config files is /usr/share: + +"The /usr/share hierarchy is for all read-only architecture independent +data files. + +This hierarchy is intended to be shareable among all architecture +platforms of a given OS; thus, for example, a site with i386, Alpha, and +PPC platforms might maintain a single /usr/share directory that is +centrally-mounted." + +Accordingly, move configuration files to $(DATADIR)/iproute2. + +Fixes: 946753a4459b ("Makefile: ensure CONF_USR_DIR honours the libdir +config") +Reported-by: Luca Boccassi +Signed-off-by: Andrea Claudi +Acked-by: Luca Boccassi +Reviewed-by: Simon Horman +Signed-off-by: Stephen Hemminger + +Conflict:Makefile was modified in pre-patch and need context adaptation +Reference:https://github.com/iproute2/iproute2/commit/962692356a1cc41932e43575f3c50927e455ab53.patch + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 709dc30..f15ee5b 100644 +--- a/Makefile ++++ b/Makefile +@@ -17,7 +17,7 @@ endif + PREFIX?=/usr + SBINDIR?=/sbin + CONF_ETC_DIR?=/etc/iproute2 +-CONF_USR_DIR?=$(LIBDIR)/iproute2 ++CONF_USR_DIR?=$(DATADIR)/iproute2 + NETNS_RUN_DIR?=/var/run/netns + NETNS_ETC_DIR?=/etc/netns + DATADIR?=$(PREFIX)/share +-- +2.33.0 + diff --git a/iproute.spec b/iproute.spec index c123e47..b10d4a2 100644 --- a/iproute.spec +++ b/iproute.spec @@ -2,7 +2,7 @@ Name: iproute Version: 6.6.0 Epoch: 1 -Release: 8 +Release: 9 Summary: Linux network configuration utilities License: GPLv2+ and Public Domain URL: https://kernel.org/pub/linux/utils/net/iproute2/ @@ -26,6 +26,7 @@ Patch9000: feature-iproute-add-support-for-ipvlan-l2e-mode.patch Patch9001: bugfix-iproute2-cancel-some-test-cases.patch Patch9002: revert-ip-vrf-make-ipvrf_exec-SELinux-aware.patch Patch9003: backport-iproute2-bond-fix-stack-smash-in-xstats.patch +Patch9004: backport-change-makefile-use-share-for-config-files.patch BuildRequires: gcc bison elfutils-libelf-devel flex iptables-devel BuildRequires: libmnl-devel libselinux-devel pkgconfig libbpf-devel sudo make @@ -83,7 +84,7 @@ install -m 0644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a %defattr(-,root,root) %license COPYING %doc README -%attr(644,root,root) %config(noreplace) %{_libdir}/iproute2/* +%attr(644,root,root) %config(noreplace) %{_datadir}/iproute2/* %{_sbindir}/* %{_libdir}/tc/* %{_datadir}/bash-completion/completions/* @@ -100,6 +101,12 @@ install -m 0644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a %{_mandir}/* %changelog +* Wed Sep 10 2025 tangce - 1:6.6.0-9 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:use /usr/share/iproute2 for config files + * Wed Sep 10 2025 tangce - 1:6.6.0-8 - Type:bugfix - ID:NA -- Gitee