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