File adjust-installation-directories-for-SLE.patch of Package iproute2.7171
From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 15 Jan 2016 07:29:44 +0100
Subject: adjust installation directories for SLE
Patch-mainline: Never, SLE specific
Match SLE directory layout.
---
Makefile | 4 ++--
include/iptables.h | 2 +-
netem/Makefile | 6 ++++--
tc/q_netem.c | 2 +-
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 67176beff3f7..31e30f3b4ff8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
PREFIX?=/usr
LIBDIR?=$(PREFIX)/lib
-SBINDIR?=/sbin
+SBINDIR?=/usr/sbin
CONFDIR?=/etc/iproute2
DATADIR?=$(PREFIX)/share
DOCDIR?=$(DATADIR)/doc/iproute2
@@ -13,7 +13,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/include/iptables.h b/include/iptables.h
index f1e62e2337ec..e59de3959d6d 100644
--- a/include/iptables.h
+++ b/include/iptables.h
@@ -5,7 +5,7 @@
#include "libiptc/libiptc.h"
#ifndef IPT_LIB_DIR
-#define IPT_LIB_DIR "/usr/local/lib/iptables"
+#define IPT_LIB_DIR LIBDIR
#endif
#ifndef IPPROTO_SCTP
diff --git a/netem/Makefile b/netem/Makefile
index e52e125e3bef..6ccb379fa01f 100644
--- a/netem/Makefile
+++ b/netem/Makefile
@@ -5,6 +5,8 @@ HOSTCC ?= $(CC)
CCOPTS = $(CBUILD_CFLAGS)
LDLIBS += -lm
+LIBDIR = /usr/lib
+
all: $(DISTGEN) $(DISTDATA)
$(DISTGEN):
@@ -20,9 +22,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 7bc8c6a5825a..7391a955abfa 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.7.0