Fix `PREFIX` and other paths

This commit is contained in:
Tee KOBAYASHI 2021-11-24 20:51:25 +09:00 committed by Henrik Grimler
parent 6039baddcf
commit 1c03df8923
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,28 @@
--- a/Makefile
+++ b/Makefile
@@ -12,18 +12,18 @@
MAKEFLAGS += --no-print-directory
endif
-PREFIX?=/usr
+PREFIX?=@TERMUX_PREFIX@
LIBDIR?=$(PREFIX)/lib
-SBINDIR?=/sbin
-CONFDIR?=/etc/iproute2
-NETNS_RUN_DIR?=/var/run/netns
-NETNS_ETC_DIR?=/etc/netns
+SBINDIR?=$(PREFIX)/sbin
+CONFDIR?=$(PREFIX)/etc/iproute2
+NETNS_RUN_DIR?=$(PREFIX)/var/run/netns
+NETNS_ETC_DIR?=$(PREFIX)/etc/netns
DATADIR?=$(PREFIX)/share
HDRDIR?=$(PREFIX)/include/iproute2
DOCDIR?=$(DATADIR)/doc/iproute2
MANDIR?=$(DATADIR)/man
-ARPDDIR?=/var/lib/arpd
-KERNEL_INCLUDE?=/usr/include
+ARPDDIR?=$(PREFIX)/var/lib/arpd
+KERNEL_INCLUDE?=$(PREFIX)/include
BASH_COMPDIR?=$(DATADIR)/bash-completion/completions
# Path to db_185.h include

View File

@ -7,7 +7,6 @@ TERMUX_PKG_SRCURL=https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-$
TERMUX_PKG_SHA256=38e3e4a5f9a7f5575c015027a10df097c149111eeb739993128e5b2b35b291ff
TERMUX_PKG_DEPENDS="libandroid-glob, libandroid-support"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_MAKE_ARGS="DESTDIR=${TERMUX_PREFIX} PREFIX="
termux_step_pre_configure() {
CFLAGS+=" -fPIC"

View File

@ -0,0 +1,11 @@
--- a/misc/arpd.c
+++ b/misc/arpd.c
@@ -39,7 +39,7 @@
#include "rt_names.h"
DB *dbase;
-char *dbname = "/var/lib/arpd/arpd.db";
+char *dbname = "@TERMUX_PREFIX@/var/lib/arpd/arpd.db";
int ifnum;
int *ifvec;