diff mbox series

[iproute2] Makefile: use /usr/share/iproute2 for config files

Message ID c26af87143b645cc19ce93e4624923ef3f25204d.1699707062.git.aclaudi@redhat.com (mailing list archive)
State Superseded
Delegated to: Stephen Hemminger
Headers show
Series [iproute2] Makefile: use /usr/share/iproute2 for config files | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Andrea Claudi Nov. 11, 2023, 12:55 p.m. UTC
CONF_USR_DIR was initially set to $(PREFIX)/lib/iproute2, then moved to
$(LIBDIR)/iproute2 to honour the libdir user config. However, as
reported by Luca, most distros use an arch-dependent LIBDIR, which is
the wrong directory to place architecture-independent configuration
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 <luca.boccassi@gmail.com>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Luca Boccassi Nov. 11, 2023, 4:56 p.m. UTC | #1
On Sat, 11 Nov 2023 at 12:55, Andrea Claudi <aclaudi@redhat.com> wrote:
>
> CONF_USR_DIR was initially set to $(PREFIX)/lib/iproute2, then moved to
> $(LIBDIR)/iproute2 to honour the libdir user config. However, as
> reported by Luca, most distros use an arch-dependent LIBDIR, which is
> the wrong directory to place architecture-independent configuration
> 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 <luca.boccassi@gmail.com>
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>

Acked-by: Luca Boccassi <bluca@debian.org>
Stephen Hemminger Nov. 15, 2023, 3:37 a.m. UTC | #2
On Sat, 11 Nov 2023 13:55:41 +0100
Andrea Claudi <aclaudi@redhat.com> wrote:

> CONF_USR_DIR was initially set to $(PREFIX)/lib/iproute2, then moved to
> $(LIBDIR)/iproute2 to honour the libdir user config. However, as
> reported by Luca, most distros use an arch-dependent LIBDIR, which is
> the wrong directory to place architecture-independent configuration
> 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 <luca.boccassi@gmail.com>
> Signed-off-by: Andrea Claudi <aclaudi@redhat.com>

Since revert patch from Luca is merged already, please rebase and resubmit this.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 5c559c8d..8024d45e 100644
--- a/Makefile
+++ b/Makefile
@@ -16,12 +16,12 @@  endif
 
 PREFIX?=/usr
 SBINDIR?=/sbin
-CONF_ETC_DIR?=/etc/iproute2
-CONF_USR_DIR?=$(LIBDIR)/iproute2
 NETNS_RUN_DIR?=/var/run/netns
 NETNS_ETC_DIR?=/etc/netns
 DATADIR?=$(PREFIX)/share
 HDRDIR?=$(PREFIX)/include/iproute2
+CONF_ETC_DIR?=/etc/iproute2
+CONF_USR_DIR?=$(DATADIR)/iproute2
 DOCDIR?=$(DATADIR)/doc/iproute2
 MANDIR?=$(DATADIR)/man
 ARPDDIR?=/var/lib/arpd