Skip to content

Commit

Permalink
Make sbin install dir configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarco76 committed Jan 17, 2025
1 parent 98ee16d commit cda2642
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if [ "$HOSTTYPE" = "x86_64" ]; then
else
LIB_DIR="/usr/lib"
fi
SBIN_DIR="/usr/sbin"

SYSCONF_DIR="/etc"
SHARE_DIR="/usr/share"
Expand Down Expand Up @@ -57,6 +58,7 @@ usage() {
echo " --prefix-dir=<path> Prefix directory (default: $PREFIX_DIR)."
echo " --include-dir=<path> Include directory (default: $INCLUDE_DIR)."
echo " --lib-dir=<path> Library directory (default: $LIB_DIR)."
echo " --sbin-dir=<path> Superuser binary directory (default: $SBIN_DIR)"
echo " --sysconf-dir=<path> System configuration directory (default: $SYSCONF_DIR)."
echo " --share-dir=<path> Share directory (default: $SHARE_DIR)."
echo " --cmake=<path> Path to CMake executable"
Expand Down Expand Up @@ -217,6 +219,9 @@ while getopts v-: arg ; do
lib-dir=?*)
LIB_DIR=$(readlink -f "$LONG_OPTARG")
;;
sbin-dir=?*)
SBIN_DIR=$(readlink -f "$LONG_OPTARG")
;;
sysconf-dir=?*)
SYSCONF_DIR=$(readlink -f "$LONG_OPTARG")
;;
Expand Down Expand Up @@ -282,8 +287,8 @@ while getopts v-: arg ; do
'')
break # "--" terminates argument processing
;;
name* | work-dir* | prefix-dir* | include-dir* | lib-dir* | sysconf-dir* | share-dir* | cmake* | \
java-home* | jni-dir* | install-dir* | \
name* | work-dir* | prefix-dir* | include-dir* | lib-dir* | sbin-dir* | sysconf-dir* | share-dir* | \
cmake* | java-home* | jni-dir* | install-dir* | \
source-tag* | spec* | version* | release* | dist*)
echo "ERROR: Missing argument for --$OPTARG option" >&2
exit 1
Expand Down Expand Up @@ -319,6 +324,7 @@ if [ "$DEBUG" = true ] ; then
echo "PREFIX_DIR: $PREFIX_DIR"
echo "INCLUDE_DIR: $INCLUDE_DIR"
echo "LIB_DIR: $LIB_DIR"
echo "SBIN_DIR: $SBIN_DIR"
echo "SYSCONF_DIR: $SYSCONF_DIR"
echo "SHARE_DIR: $SHARE_DIR"
echo "CMAKE: $CMAKE"
Expand Down Expand Up @@ -376,6 +382,7 @@ if [ "$BUILD_TARGET" = "dist" ] ; then

OPTIONS+=(-DINCLUDE_INSTALL_DIR:PATH="$INCLUDE_DIR")
OPTIONS+=(-DLIB_INSTALL_DIR:PATH="$LIB_DIR")
OPTIONS+=(-DSBIN_INSTALL_DIR:PATH="$SBIN_DIR")
OPTIONS+=(-DSYSCONF_INSTALL_DIR:PATH="$SYSCONF_DIR")
OPTIONS+=(-DSHARE_INSTALL_PREFIX:PATH="$SHARE_DIR")

Expand Down

0 comments on commit cda2642

Please sign in to comment.