diff --git a/grass/Makefile b/grass/Makefile index d2ac9f4..9f92975 100644 --- a/grass/Makefile +++ b/grass/Makefile @@ -228,18 +228,18 @@ install: FORCE ${MAKE} install-macosx; \ exit; \ fi; \ - INST_PATH=`dirname ${INST_DIR}`; \ + INST_PATH=`dirname ${DESTDIR}${INST_DIR}`; \ while [ ! -d $$INST_PATH ]; do \ INST_PATH=`dirname $$INST_PATH`; \ done; \ - if [ ! -d "${INST_DIR}" -a ! -w "$$INST_PATH" ] ; then \ + if [ ! -d "${DESTDIR}${INST_DIR}" -a ! -w "$$INST_PATH" ] ; then \ echo "ERROR: Directory $$INST_PATH is a parent directory of your"; \ echo " install directory ${INST_DIR} and is not writable."; \ echo " Perhaps you need root access."; \ echo " Installation aborted, exiting Make."; \ exit; \ fi; \ - if [ -d ${INST_DIR} -a ! -w "${INST_DIR}" ] ; then \ + if [ -d ${DESTDIR}${INST_DIR} -a ! -w "${DESTDIR}${INST_DIR}" ] ; then \ echo "ERROR: Your install directory ${INST_DIR} is not writable."; \ echo " Perhaps you need root access."; \ echo " Installation aborted, exiting Make."; \ @@ -262,41 +262,41 @@ install: FORCE ${MAKE} real-install real-install: FORCE - test -d ${INST_DIR} || ${MAKE_DIR_CMD} ${INST_DIR} + test -d ${DESTDIR}${INST_DIR} || ${MAKE_DIR_CMD} ${DESTDIR}${INST_DIR} @##### test -d ${INST_DIR}/dev || ${MAKE_DIR_CMD} ${INST_DIR}/dev - test -d ${BINDIR} || ${MAKE_DIR_CMD} ${BINDIR} - -sed -e "s#^GISBASE.*#GISBASE=${INST_DIR}#" ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} > ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} - -chmod a+x ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} + test -d ${DESTDIR}${BINDIR} || ${MAKE_DIR_CMD} ${DESTDIR}${BINDIR} + -sed -e "s#^GISBASE.*#GISBASE=${INST_DIR}#" ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} > ${DESTDIR}${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} + -chmod a+x ${DESTDIR}${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} ifneq ($(strip $(MINGW)),) - -sed -e "s#WINGISBASE=.*#WINGISBASE=${INST_DIR}#" ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat > ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat - -chmod a+x ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat + -sed -e "s#WINGISBASE=.*#WINGISBASE=${INST_DIR}#" ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat > ${DESTDIR}${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat + -chmod a+x ${DESTDIR}${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat endif - -cd ${GISBASE} ; tar cBf - $(FILES) | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - bin | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - bwidget | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - docs | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - driver | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - etc | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - fonts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - man | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - scripts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - tools | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - if [ ${LOCALE} -eq 1 ] ; then cd ${GISBASE} ; tar cBf - locale | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null ; fi + -cd ${GISBASE} ; tar cBf - $(FILES) | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - bin | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - bwidget | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - docs | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - driver | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - etc | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - fonts | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - man | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - scripts | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - tools | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + if [ ${LOCALE} -eq 1 ] ; then cd ${GISBASE} ; tar cBf - locale | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null ; fi @ # The man, include, and lib could go to ${PREFIX}/ BUT if this is @ # done, then the corresponding uninstall instructions must delete @ # the grass files BY FILENAME NOT DIRECTORY!! Otherwise there is a @ # high risk of deleteing system files since PREFIX is defined by @ # default to be /usr/local @##### -cd ${GISBASE} ; tar cBf - man | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - include | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -cd ${GISBASE} ; tar cBf - lib | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null - -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/monitorcap > ${INST_DIR}/etc/monitorcap - -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap > ${INST_DIR}/etc/fontcap + -cd ${GISBASE} ; tar cBf - include | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -cd ${GISBASE} ; tar cBf - lib | (cd ${DESTDIR}${INST_DIR} ; tar xBf - ) 2>/dev/null + -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/monitorcap > ${DESTDIR}${INST_DIR}/etc/monitorcap + -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap > ${DESTDIR}${INST_DIR}/etc/fontcap @##### -chmod -R 1777 ${INST_DIR}/locks 2>/dev/null - -chmod -R a+rX ${INST_DIR} 2>/dev/null + -chmod -R a+rX ${DESTDIR}${INST_DIR} 2>/dev/null @#GEM installation - -tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null - -${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null + -tar cBf - gem/skeleton | (cd ${DESTDIR}${INST_DIR}/etc ; tar xBf - ) 2>/dev/null + -${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${DESTDIR}${BINDIR} 2>/dev/null @# enable OSX Help Viewer @if [ "`cat include/Make/Platform.make | grep -i '^ARCH.*darwin'`" ] ; then /bin/ln -sfh "${INST_DIR}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi