SHA256
1
0
forked from pool/iproute2
iproute2/adjust-installation-directories-for-openSUSE-SLE.patch

76 lines
2.1 KiB
Diff

From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 15 Jan 2016 07:29:44 +0100
Subject: adjust installation directories for openSUSE/SLE
Patch-mainline: Never, SUSE specific
Match the directory layout of openSUSE and SLE.
---
Makefile | 4 ++--
netem/Makefile | 6 ++++--
tc/q_netem.c | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index dbb4a4afd608..3069ee91e159 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ endif
PREFIX?=/usr
LIBDIR?=$(PREFIX)/lib
-SBINDIR?=/sbin
+SBINDIR?=/usr/sbin
CONFDIR?=/etc/iproute2
DATADIR?=$(PREFIX)/share
HDRDIR?=$(PREFIX)/include/iproute2
@@ -21,7 +21,7 @@ DBM_INCLUDE:=$(DESTDIR)/usr/include
SHARED_LIBS = y
-DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\"
+DEFINES= -DRESOLVE_HOSTNAMES -DLIBDIR=\"$(LIBDIR)\" -DPKGDATADIR=\"$(DATADIR)/tc\"
ifneq ($(SHARED_LIBS),y)
DEFINES+= -DNO_SHARED_LIBS
endif
diff --git a/netem/Makefile b/netem/Makefile
index 2499f086f24d..9e36fe91fa41 100644
--- a/netem/Makefile
+++ b/netem/Makefile
@@ -7,6 +7,8 @@ HOSTCC ?= $(CC)
CCOPTS = $(CBUILD_CFLAGS)
LDLIBS += -lm
+LIBDIR = /usr/lib
+
ifeq ($(HAVE_MNL),y)
CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
@@ -27,9 +29,9 @@ stats: stats.c
$(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm
install: all
- mkdir -p $(DESTDIR)$(LIBDIR)/tc
+ mkdir -p $(DESTDIR)/usr/share/tc
for i in $(DISTDATA); \
- do install -m 644 $$i $(DESTDIR)$(LIBDIR)/tc; \
+ do install -m 644 $$i $(DESTDIR)/usr/share/tc; \
done
clean:
diff --git a/tc/q_netem.c b/tc/q_netem.c
index 5a9e747411e8..34c8f4315abd 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -113,7 +113,7 @@ static int get_distribution(const char *type, __s16 *data, int maxdata)
char *line = NULL;
char name[128];
- snprintf(name, sizeof(name), "%s/%s.dist", get_tc_lib(), type);
+ snprintf(name, sizeof(name), "%s/%s.dist", PKGDATADIR, type);
if ((f = fopen(name, "r")) == NULL) {
fprintf(stderr, "No distribution data for %s (%s: %s)\n",
type, name, strerror(errno));
--
2.14.1