gentoo-overlay/games-sports/maniadrive/files/maniadrive-1.1-no-download.patch

103 lines
3 KiB
Diff

--- configure.old 2006-08-18 23:12:18.000000000 +0200
+++ configure 2006-08-19 00:56:59.000000000 +0200
@@ -60,6 +60,7 @@
echo " --force-php-install Force PHP 5 local reinstall"
echo " --ode-cvs Use ODE CVS version"
echo " --disable-x Disable X/GL/GLU test (server)"
+ echo " --no-download Disable ode and php5 download"
exit 0
}
@@ -88,12 +89,18 @@
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/opende co -r UNSTABLE -P raydium/ode
exit_if_error "$?" "CVS server error ? Try manual install (http://ode.org)"
else
- echo " Downloading 'stable CVS' version from Raydium website ..."
- if [ -f "raydium/ode.tar.gz" ]; then
- rm -f raydium/ode.tar.gz
+ if [ $no_download = "true" ]; then
+ if ! [ -f "raydium/ode.tar.gz" ]; then
+ exit_if_error "1" "ode.tar.gz must be present in the raydium directory when using --no-download"
+ fi
+ else
+ echo " Downloading 'stable CVS' version from Raydium website ..."
+ if [ -f "raydium/ode.tar.gz" ]; then
+ rm -f raydium/ode.tar.gz
+ fi
+ wget -O raydium/ode.tar.gz http://freeway.raydium.org/data/stable_mirrors/ode.tar.gz
+ exit_if_error "$?" "Error downloading."
fi
- wget -O raydium/ode.tar.gz http://freeway.raydium.org/data/stable_mirrors/ode.tar.gz
- exit_if_error "$?" "Error downloading."
# uncompress
echo " Uncompressing ..."
@@ -180,9 +187,15 @@
exit_if_error "$?" "xml2-config not found in path. Please install 'libxml2-devel' to compile PHP"
# download
- echo " Downloading latest PHP5 ..."
- wget -O raydium/php-latest.tar.gz http://snaps.php.net/php5.2-latest.tar.gz
- exit_if_error "$?" "wget not found, or network error"
+ if [ $no_download == "true" ]; then
+ if ! [ -f "raydium/php-latest.tar.gz" ]; then
+ exit_if_error "1" "php-latest.tar.gz must be present in the raydium directory when using --no-download"
+ fi
+ else
+ echo " Downloading latest PHP5 ..."
+ wget -O raydium/php-latest.tar.gz http://snaps.php.net/php5.2-latest.tar.gz
+ exit_if_error "$?" "wget not found, or network error"
+ fi
# uncompress
echo " Uncompressing ..."
@@ -228,37 +241,28 @@
####### Main
+
+ode_cvs="false"
+disable_x="no"
+force_ode="false"
+force_php="false"
+no_download="false"
+
for i in "$@"; do
if [ $i = "--help" ]; then
usage_print
fi
-done
-
-ode_cvs="false"
-for i in "$@"; do
if [ $i = "--ode-cvs" ]; then
- ode_cvs="true"
+ ode_cvs="true"
fi
-done
-
-disable_x="no"
-for i in "$@"; do
if [ $i = "--disable-x" ]; then
- disable_x="yes"
+ disable_x="yes"
fi
-done
-
-force_ode="false"
-for i in "$@"; do
if [ $i = "--force-ode-install" ]; then
- force_ode="true"
+ force_ode="true"
fi
-done
-
-force_php="false"
-for i in "$@"; do
- if [ $i = "--force-php-install" ]; then
- force_php="true"
+ if [ $i = "--no-download" ]; then
+ no_download="true"
fi
done