subst.sh: add support for SBINDIR

This commit is contained in:
Pierre Pronchery 2022-04-30 03:20:45 +02:00
parent 46a72372e8
commit e3b9f5c2ce

View File

@ -35,6 +35,7 @@ LIBDIR=
LIBEXECDIR= LIBEXECDIR=
MANDIR= MANDIR=
PROGNAME="subst.sh" PROGNAME="subst.sh"
SBINDIR=
SYSCONFDIR= SYSCONFDIR=
#executables #executables
CHMOD="chmod" CHMOD="chmod"
@ -85,6 +86,7 @@ _subst()
SYSCONFDIR="$PREFIX/etc" SYSCONFDIR="$PREFIX/etc"
[ "$PREFIX" = "/usr" ] && SYSCONFDIR="/etc" [ "$PREFIX" = "/usr" ] && SYSCONFDIR="/etc"
fi fi
[ -z "$SBINDIR" ] && SBINDIR="$PREFIX/sbin"
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
target="$1" target="$1"
@ -127,6 +129,7 @@ _subst()
-e "s;@LIBEXECDIR@;$LIBEXECDIR;g" \ -e "s;@LIBEXECDIR@;$LIBEXECDIR;g" \
-e "s;@MANDIR@;$MANDIR;g" \ -e "s;@MANDIR@;$MANDIR;g" \
-e "s;@PWD@;$PWD;g" \ -e "s;@PWD@;$PWD;g" \
-e "s;@SBINDIR@;$SBINDIR;g" \
-e "s;@SYSCONFDIR@;$SYSCONFDIR;g" \ -e "s;@SYSCONFDIR@;$SYSCONFDIR;g" \
-- "$source" > "$target" -- "$source" > "$target"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then