Use more flexible scheme in assignment of default directories

This commit is contained in:
Laurence Withers 2008-02-05 21:07:25 +00:00
parent 3226cfafa9
commit 91c9082624
1 changed files with 45 additions and 68 deletions

View File

@ -8,79 +8,56 @@
# to override values if needed. # to override values if needed.
# #
# build proposed paths MY_PREFIX="${PREFIX}"
case "${PREFIX}" in [ "${MY_PREFIX}" == "/" ] && MY_PREFIX=""
/)
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) [ -z "${BINDIR}" ] && BINDIR="${PREFIX}/bin"
MY_BINDIR="/usr/bin" [ -z "${SBINDIR}" ] && SBINDIR="${PREFIX}/sbin"
MY_SBINDIR="/usr/sbin" [ -z "${LIBDIR}" ] && LIBDIR="${PREFIX}/lib"
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) if [ -z "${INCLUDEDIR}" ]
MY_BINDIR="/usr/local/bin" then
MY_SBINDIR="/usr/local/sbin" case "${PREFIX}" in
MY_LIBDIR="/usr/local/lib" /) INCLUDEDIR="/usr/include" ;;
MY_INCLUDEDIR="/usr/local/include" *) INCLUDEDIR="${PREFIX}/include" ;;
MY_CONFIGDIR="/usr/local/etc" esac
MY_VARDIR="/var" fi
MY_SHAREDIR="/usr/local/share/@P@"
MY_DOCSDIR="/usr/local/share/doc/@P@"
MY_WEBDIR="/srv/http"
;;
/opt/*) if [ -z "${CONFIGDIR}" ]
MY_BINDIR="${PREFIX}/bin" then
MY_SBINDIR="${PREFIX}/sbin" case "${PREFIX}" in
MY_LIBDIR="${PREFIX}/lib" / | /usr) CONFIGDIR="/etc" ;;
MY_INCLUDEDIR="${PREFIX}/include" /opt*) CONFIGDIR="/etc${PREFIX}" ;;
MY_CONFIGDIR="/etc${PREFIX}" *) CONFIGDIR="${PREFIX}/etc" ;;
MY_VARDIR="/var${PREFIX}" esac
MY_SHAREDIR="/var${PREFIX}" fi
MY_DOCSDIR="${PREFIX}/doc"
MY_WEBDIR="${PREFIX}/http"
;;
**) if [ -z "${VARDIR}" ]
MY_BINDIR="${PREFIX}/bin" then
MY_SBINDIR="${PREFIX}/sbin" case "${PREFIX}" in
MY_LIBDIR="${PREFIX}/lib" / | /usr | /usr/local) VARDIR="/var" ;;
MY_INCLUDEDIR="${PREFIX}/include" /opt*) VARDIR="/var${PREFIX}" ;;
MY_CONFIGDIR="${PREFIX}/etc" *) VARDIR="${PREFIX}/var" ;;
MY_VARDIR="${PREFIX}/var" esac
MY_SHAREDIR="${PREFIX}/share" fi
MY_DOCSDIR="${PREFIX}/share/doc"
MY_WEBDIR="${PREFIX}/srv/http"
;;
esac
# assign paths allowing user to override if [ -z "${SHAREDIR}" ]
[ -z "${BINDIR}" ] && BINDIR="${MY_BINDIR}" then
[ -z "${SBINDIR}" ] && SBINDIR="${MY_SBINDIR}" case "${PREFIX}" in
[ -z "${LIBDIR}" ] && LIBDIR="${MY_LIBDIR}" /) SHAREDIR="/usr/share" ;;
[ -z "${INCLUDEDIR}" ] && INCLUDEDIR="${MY_INCLUDEDIR}" *) SHAREDIR="${PREFIX}/share" ;;
[ -z "${CONFIGDIR}" ] && CONFIGDIR="${MY_CONFIGDIR}" esac
[ -z "${VARDIR}" ] && VARDIR="${MY_VARDIR}" fi
[ -z "${SHAREDIR}" ] && SHAREDIR="${MY_SHAREDIR}" [ -z "${DOCSDIR}" ] && DOCSDIR="${SHAREDIR}/doc"
[ -z "${DOCSDIR}" ] && DOCSDIR="${MY_DOCSDIR}"
[ -z "${WEBDIR}" ] && WEBDIR="${MY_WEBDIR}" if [ -z "${SRVDIR}" ]
then
case "${PREFIX}" in
/ | /usr | /usr/local) SRVDIR="/srv" ;;
*) SRVDIR="${PREFIX}/srv" ;;
esac
fi
[ -z "${WEBDIR}" ] && WEBDIR="${SRVDIR}/http"
[ -z "${CGIDIR}" ] && CGIDIR="${WEBDIR}/cgi-bin" [ -z "${CGIDIR}" ] && CGIDIR="${WEBDIR}/cgi-bin"
# kate: @KATE_MODELINE@ # kate: @KATE_MODELINE@