Allow user to override paths

This commit is contained in:
Laurence Withers 2007-09-17 09:51:49 +00:00
parent 40f6e654fd
commit d536de1e78
1 changed files with 60 additions and 37 deletions

View File

@ -5,54 +5,77 @@
# to override values if needed.
#
# build proposed paths
case "${PREFIX}" in
/)
BINDIR="/bin"
SBINDIR="/sbin"
LIBDIR="/lib"
INCLUDEDIR="/usr/include"
CONFIGDIR="/etc"
VARDIR="/var"
SHAREDIR="/usr/share/@P@"
DOCSDIR="/usr/share/doc/@P@"
WEBDIR="/srv/http"
MY_BINDIR="/bin"
MY_SBINDIR="/sbin"
MY_LIBDIR="/lib"
MY_INCLUDEDIR="/usr/include"
MY_CONFIGDIR="/etc"
MY_VARDIR="/var"
MY_SHAREDIR="/usr/share/@P@"
MY_DOCSDIR="/usr/share/doc/@P@"
MY_WEBDIR="/srv/http"
;;
/usr)
BINDIR="/usr/bin"
SBINDIR="/usr/sbin"
LIBDIR="/usr/lib"
INCLUDEDIR="/usr/include"
CONFIGDIR="/etc"
VARDIR="/var"
SHAREDIR="/usr/share/@P@"
DOCSDIR="/usr/share/doc/@P@"
WEBDIR="/srv/http"
MY_BINDIR="/usr/bin"
MY_SBINDIR="/usr/sbin"
MY_LIBDIR="/usr/lib"
MY_INCLUDEDIR="/usr/include"
MY_CONFIGDIR="/etc"
MY_VARDIR="/var"
MY_SHAREDIR="/usr/share/@P@"
MY_DOCSDIR="/usr/share/doc/@P@"
MY_WEBDIR="/srv/http"
;;
/usr/local)
BINDIR="/usr/local/bin"
SBINDIR="/usr/local/sbin"
LIBDIR="/usr/local/lib"
INCLUDEDIR="/usr/local/include"
CONFIGDIR="/usr/local/etc"
VARDIR="/var"
SHAREDIR="/usr/local/share/@P@"
DOCSDIR="/usr/local/share/doc/@P@"
WEBDIR="/srv/http"
MY_BINDIR="/usr/local/bin"
MY_SBINDIR="/usr/local/sbin"
MY_LIBDIR="/usr/local/lib"
MY_INCLUDEDIR="/usr/local/include"
MY_CONFIGDIR="/usr/local/etc"
MY_VARDIR="/var"
MY_SHAREDIR="/usr/local/share/@P@"
MY_DOCSDIR="/usr/local/share/doc/@P@"
MY_WEBDIR="/srv/http"
;;
/opt/*)
BINDIR="${PREFIX}/bin"
SBINDIR="${PREFIX}/sbin"
LIBDIR="${PREFIX}/lib"
INCLUDEDIR="${PREFIX}/include"
CONFIGDIR="/etc${PREFIX}"
VARDIR="/var${PREFIX}"
SHAREDIR="/var${PREFIX}"
DOCSDIR="${PREFIX}/doc"
WEBDIR="${PREFIX}/http"
MY_BINDIR="${PREFIX}/bin"
MY_SBINDIR="${PREFIX}/sbin"
MY_LIBDIR="${PREFIX}/lib"
MY_INCLUDEDIR="${PREFIX}/include"
MY_CONFIGDIR="/etc${PREFIX}"
MY_VARDIR="/var${PREFIX}"
MY_SHAREDIR="/var${PREFIX}"
MY_DOCSDIR="${PREFIX}/doc"
MY_WEBDIR="${PREFIX}/http"
;;
**)
MY_BINDIR="${PREFIX}/bin"
MY_SBINDIR="${PREFIX}/sbin"
MY_LIBDIR="${PREFIX}/lib"
MY_INCLUDEDIR="${PREFIX}/include"
MY_CONFIGDIR="${PREFIX}/etc"
MY_VARDIR="${PREFIX}/var"
MY_DOCSDIR="${PREFIX}/share/doc"
MY_WEBDIR="${PREFIX}/srv/http"
;;
esac
CGIDIR="${WEBDIR}/cgi-bin"
MY_CGIDIR="${WEBDIR}/cgi-bin"
# assign paths allowing user to override
[ -z "${BINDIR}" ] && BINDIR="${MY_BINDIR}"
[ -z "${SBINDIR}" ] && SBINDIR="${MY_SBINDIR}"
[ -z "${LIBDIR}" ] && LIBDIR="${MY_LIBDIR}"
[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${MY_INCLUDEDIR}"
[ -z "${CONFIGDIR}" ] && CONFIGDIR="${MY_CONFIGDIR}"
[ -z "${VARDIR}" ] && VARDIR="${MY_VARDIR}"
[ -z "${DOCSDIR}" ] && DOCSDIR="${MY_DOCSDIR}"
[ -z "${WEBDIR}" ] && WEBDIR="${MY_WEBDIR}"
[ -z "${CGIDIR}" ] && CGIDIR="${MY_CGIDIR}"