forked from couchbaselabs/cbsdkbb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lsetup_php
executable file
·69 lines (60 loc) · 2.66 KB
/
lsetup_php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
set -xe
MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PHPVER=$1
ARCH=$2
PLAT=$3
IGBINARY_VER=2.0.1
if [ "$PLAT" == "sunos" ]; then
echo "Skipping PHP $1 $2 $3 due to SmartOS"
else
echo "Downloading PHP $1 $2 $3"
[ ! -e src/php-src-$PHPVER.tar.bz2 ] && wget -nc "http://php.net/get/php-$PHPVER.tar.bz2/from/this/mirror" -O src/php-src-$PHPVER.tar.bz2
[ ! -e src/php-phpunit.phar ] && wget -nc "https://phar.phpunit.de/phpunit-5.7.phar" -O src/php-phpunit.phar
# [ ! -e src/php-phpdoc.phar ] && wget -nc "http://phpdoc.org/phpDocumentor.phar" -O src/php-phpdoc.phar
[ ! -e src/igbinary-${IGBINARY_VER}.tgz ] && wget -nc "https://pecl.php.net/get/igbinary-${IGBINARY_VER}" -O src/igbinary-${IGBINARY_VER}.tgz
echo "Installing PHP $1 $2 $3"
echo "Installing NTS"
if [ ! -e php-files/src/$PHPVER-nts-$ARCH ]; then
tar -xjvf src/php-src-$PHPVER.tar.bz2 -C tmp
mv tmp/php-$PHPVER php-files/src/$PHPVER-nts-$ARCH
fi
echo "Extracting IGBINARY extension sources for NTS"
if [ ! -e php-files/src/$PHPVER-nts-$ARCH/igbinary-${IGBINARY_VER} ]; then
tar -xzvf src/igbinary-${IGBINARY_VER}.tgz -C tmp
mv tmp/igbinary-${IGBINARY_VER} php-files/src/$PHPVER-nts-$ARCH/igbinary-${IGBINARY_VER}
fi
echo "Building NTS"
if [ ! -e php-files/build/$PHPVER-nts-$ARCH ]; then
./lsetup_php_build $PHPVER nts $ARCH $IGBINARY_VER
cp src/php-phpunit.phar php-files/build/$PHPVER-nts-$ARCH/
fi
echo "Adding NTS Helpers"
if [ ! -e php-files/build/$PHPVER-nts-$ARCH/phpunit.phar ]; then
cp src/php-phpunit.phar php-files/build/$PHPVER-nts-$ARCH/phpunit.phar
fi
# if [ ! -e php-files/build/$PHPVER-nts-$ARCH/phpdoc.phar ]; then
# cp src/php-phpdoc.phar php-files/build/$PHPVER-nts-$ARCH/phpdoc.phar
# fi
echo "Installing ZTS"
if [ ! -e php-files/src/$PHPVER-zts-$ARCH ]; then
tar -xjvf src/php-src-$PHPVER.tar.bz2 -C tmp
mv tmp/php-$PHPVER php-files/src/$PHPVER-zts-$ARCH
fi
echo "Extracting IGBINARY extension sources for ZTS"
if [ ! -e php-files/src/$PHPVER-zts-$ARCH/igbinary-${IGBINARY_VER} ]; then
tar -xzvf src/igbinary-${IGBINARY_VER}.tgz -C tmp
mv tmp/igbinary-${IGBINARY_VER} php-files/src/$PHPVER-zts-$ARCH/igbinary-${IGBINARY_VER}
fi
echo "Building ZTS"
if [ ! -e php-files/build/$PHPVER-zts-$ARCH ]; then
./lsetup_php_build $PHPVER zts $ARCH $IGBINARY_VER
fi
echo "Adding ZTS Helpers"
if [ ! -e php-files/build/$PHPVER-zts-$ARCH/phpunit.phar ]; then
cp src/php-phpunit.phar php-files/build/$PHPVER-zts-$ARCH/phpunit.phar
fi
# if [ ! -e php-files/build/$PHPVER-zts-$ARCH/phpdoc.phar ]; then
# cp src/php-phpdoc.phar php-files/build/$PHPVER-zts-$ARCH/phpdoc.phar
# fi
fi