2011-11-06 22:50:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi
|
|
|
|
|
DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
|
|
|
|
|
|
|
|
|
|
set -e # DO NOT USE PIPES unless this is rewritten
|
|
|
|
|
|
2011-11-06 23:13:36 +00:00
|
|
|
if [ -d "$DEV/php" ]; then
|
2011-11-06 22:50:32 +00:00
|
|
|
echo "PHP is already installed"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
TAR=php5.4-latest.tar.gz
|
2011-11-06 23:13:36 +00:00
|
|
|
PHPURL="http://snaps.php.net/$TAR"
|
2011-11-06 22:50:32 +00:00
|
|
|
|
2011-11-06 23:13:36 +00:00
|
|
|
cd "$DEV"
|
2011-11-06 22:50:32 +00:00
|
|
|
|
|
|
|
|
# Some debain-like systems bundle wget but not curl, some other systems
|
|
|
|
|
# like os x bundle curl but not wget... use whatever is available
|
|
|
|
|
echo -n "Downloading PHP 5.4"
|
|
|
|
|
if command -v wget &>/dev/null; then
|
|
|
|
|
echo "- using wget"
|
2011-11-06 23:13:36 +00:00
|
|
|
wget "$PHPURL"
|
2011-11-06 22:50:32 +00:00
|
|
|
elif command -v curl &>/dev/null; then
|
|
|
|
|
echo "- using curl"
|
2011-11-06 23:13:36 +00:00
|
|
|
curl -O "$PHPURL"
|
2011-11-06 22:50:32 +00:00
|
|
|
else
|
|
|
|
|
echo "- aborting"
|
|
|
|
|
echo "Could not find curl or wget." >&2;
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Extracting php 5.4"
|
2011-11-06 23:13:36 +00:00
|
|
|
tar -xzf "$TAR"
|
2011-11-06 22:50:32 +00:00
|
|
|
|
|
|
|
|
cd php5.4-*/
|
|
|
|
|
|
2011-11-06 23:13:36 +00:00
|
|
|
echo "Configuring and installing php 5.4 in \$IP/maintenance/dev/php/"
|
|
|
|
|
./configure --prefix="$DEV/php/"
|
2011-11-06 22:50:32 +00:00
|
|
|
make
|
|
|
|
|
make install
|