From: James Fournie Date: Tue, 13 Sep 2011 22:52:53 +0000 (-0700) Subject: Adding a DOWNLOADER variable to autotools which detects curl if wget is not found X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c76e829da71710e5b8e0d3bccd4f52c0c67c6021;p=working%2FEvergreen.git Adding a DOWNLOADER variable to autotools which detects curl if wget is not found This is currently only used to download xulrunner bits for staff client builds Signed-off-by: James Fournie --- diff --git a/Open-ILS/xul/staff_client/Makefile.am b/Open-ILS/xul/staff_client/Makefile.am index dab3b2fc6d..855b2bba7f 100644 --- a/Open-ILS/xul/staff_client/Makefile.am +++ b/Open-ILS/xul/staff_client/Makefile.am @@ -273,7 +273,7 @@ branding_check: win-xulrunner: unzip_check branding_check client_app @echo 'Preparing Windows xulrunner' - @if [ ! -f ${XULRUNNER_WINFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_WINFILE}; fi + @if [ ! -f ${XULRUNNER_WINFILE} ]; then ${DOWNLOADER} ${XULRUNNER_URL}${XULRUNNER_WINFILE}; fi @unzip -q ${XULRUNNER_WINFILE} -dclient @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","win");' >> client/defaults/preferences/autochannel.js; fi; @echo 'Preparing stub' @@ -281,7 +281,7 @@ win-xulrunner: unzip_check branding_check client_app linux-xulrunner: client_app @echo 'Preparing Linux xulrunner' - @if [ ! -f ${XULRUNNER_LINUXFILE} ]; then wget ${XULRUNNER_URL}${XULRUNNER_LINUXFILE}; fi + @if [ ! -f ${XULRUNNER_LINUXFILE} ]; then ${DOWNLOADER} ${XULRUNNER_URL}${XULRUNNER_LINUXFILE}; fi @cd client; tar xjf ../${XULRUNNER_LINUXFILE}; cd .. @if [ -f client/defaults/preferences/autoupdate.js ]; then echo 'pref("app.update.channel","lin");' >> client/defaults/preferences/autochannel.js; fi; @echo 'Preparing stub' @@ -290,7 +290,7 @@ linux-xulrunner: client_app # Build a windows installer. win-client: nsis_check win-xulrunner - @if [ "${NSIS_AUTOUPDATE}${NSIS_PERMACHINE}" -a ! -d AccessControl ]; then echo 'Fetching AccessControl Plugin'; wget ${NSIS_ACCESSCONTROL} -O AccessControl.zip; unzip AccessControl.zip; fi + @if [ "${NSIS_AUTOUPDATE}${NSIS_PERMACHINE}" -a ! -d AccessControl ]; then echo 'Fetching AccessControl Plugin'; ${DOWNLOADER} ${NSIS_ACCESSCONTROL} -O AccessControl.zip; unzip AccessControl.zip; fi @echo 'Building installer' @makensis -V2 -DPRODUCT_VERSION="${STAFF_CLIENT_VERSION}" ${NSIS_WICON} ${NSIS_AUTOUPDATE} ${NSIS_DEV} ${NSIS_PERMACHINE} ${NSIS_EXTRAS} ${NSIS_EXTRAOPTS} windowssetup.nsi @echo 'Done' diff --git a/configure.ac b/configure.ac index dd0b098b5f..f22857088f 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,21 @@ AC_PROG_MKDIR_P AM_PROG_CC_C_O #----------------------------------- +# Checks for wget vs curl +#----------------------------------- +AC_CHECK_PROGS([DOWNLOADER], [wget curl]) +if test "X$DOWNLOADER" = "Xwget"; then + DOWNLOADER="wget -q"; +else + if test "X$DOWNLOADER" = "Xcurl"; then + DOWNLOADER="curl -O"; + else + AC_MSG_ERROR(Could not find wget or curl); + fi +fi + + +#----------------------------------- # Install options #-----------------------------------