mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 03:16:35 +00:00
New compile script
This commit is contained in:
parent
902cee1107
commit
cd3aaa1b50
129
compile_php.sh
129
compile_php.sh
@ -1,76 +1,111 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "[INFO] PocketMine-MP PHP compiler for Linux - by @shoghicp v0.1"
|
echo "[INFO] PocketMine-MP PHP compiler for Linux - by @shoghicp v0.2"
|
||||||
if [ "$(whoami)" != 'root' ]; then
|
if [ "$(whoami)" != 'root' ]; then
|
||||||
echo "[ERROR] You must be root to run this script"
|
echo "[ERROR] You must be root to run this script"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
DIR=`pwd`
|
DIR=`pwd`
|
||||||
mkdir -m 0777 install_data
|
date > $DIR/install.log
|
||||||
mkdir -m 0777 php5
|
mkdir -m 0777 install_data >> $DIR/install.log 2>&1
|
||||||
|
mkdir -m 0777 php5 >> $DIR/install.log 2>&1
|
||||||
cd install_data
|
cd install_data
|
||||||
apt-get -f -y install
|
apt-get -f -y install >> $DIR/install.log 2>&1
|
||||||
apt-get -y install \
|
apt-get -y install \
|
||||||
php5-cli \
|
|
||||||
php5-common \
|
|
||||||
php5-curl \
|
|
||||||
php5-gd \
|
|
||||||
php5-gmp \
|
|
||||||
php5-mcrypt \
|
|
||||||
build-essential \
|
build-essential \
|
||||||
autoconf \
|
autoconf >> $DIR/install.log 2>&1
|
||||||
git-core \
|
|
||||||
libxml2-dev \
|
#zlib
|
||||||
libcurl4-openssl-dev \
|
echo -n "[zlib] Downloading..."
|
||||||
libjpeg-dev \
|
wget http://zlib.net/zlib-1.2.7.tar.gz -q -O zlib-1.2.7.tar.gz
|
||||||
libpng-dev \
|
echo -n " extracting..."
|
||||||
libmysqlclient-dev \
|
tar -zxvf zlib-1.2.7.tar.gz >> $DIR/install.log 2>&1
|
||||||
libfreetype6-dev \
|
mv zlib-1.2.7 zlib
|
||||||
libmcrypt-dev \
|
echo -n " compiling..."
|
||||||
libmhash-dev
|
cd zlib
|
||||||
wget ftp://ftp.gmplib.org/pub/gmp-5.1.0/gmp-5.1.0.tar.bz2 -O gmp-5.1.0.tar.bz2
|
./configure >> $DIR/install.log 2>&1
|
||||||
tar -jxvf gmp-5.1.0.tar.bz2
|
make >> $DIR/install.log 2>&1
|
||||||
cd gmp-5.1.0
|
make install >> $DIR/install.log 2>&1
|
||||||
./configure
|
echo " done!"
|
||||||
make
|
cd ..
|
||||||
make check
|
|
||||||
make install
|
#OpenSSL
|
||||||
wget http://php.net/get/php-5.4.10.tar.gz/from/this/mirror -O php-5.4.10.tar.gz
|
echo -n "[OpenSSL] downloading..."
|
||||||
tar -zxvf php-5.4.10.tar.gz
|
wget ftp://ftp.openssl.org/source/openssl-1.0.1c.tar.gz -q -O openssl-1.0.1c.tar.gz
|
||||||
cd php-5.4.10
|
echo -n " extracting..."
|
||||||
cd ext
|
tar -zxvf openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1
|
||||||
git clone https://github.com/krakjoe/pthreads.git
|
mv openssl-1.0.1c openssl
|
||||||
|
echo -n " compiling..."
|
||||||
|
cd openssl
|
||||||
|
./config >> $DIR/install.log 2>&1
|
||||||
|
make >> $DIR/install.log 2>&1
|
||||||
|
make install >> $DIR/install.log 2>&1
|
||||||
|
echo " done!"
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
#GMP
|
||||||
|
echo -n "[GMP] downloading..."
|
||||||
|
wget ftp://ftp.gmplib.org/pub/gmp-5.1.0/gmp-5.1.0.tar.bz2 -q -O gmp-5.1.0.tar.bz2
|
||||||
|
echo -n " extracting..."
|
||||||
|
tar -jxvf gmp-5.1.0.tar.bz2 >> $DIR/install.log 2>&1
|
||||||
|
mv gmp-5.1.0 gmp
|
||||||
|
echo -n " compiling..."
|
||||||
|
cd gmp
|
||||||
|
./configure >> $DIR/install.log 2>&1
|
||||||
|
make >> $DIR/install.log 2>&1
|
||||||
|
make install >> $DIR/install.log 2>&1
|
||||||
|
echo " done!"
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
echo -n "[cURL] downloading..."
|
||||||
|
wget https://github.com/bagder/curl/archive/master.tar.gz -q -O curl-master.tar.gz
|
||||||
|
echo -n " extracting..."
|
||||||
|
tar -zxvf curl-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
mv curl-master curl
|
||||||
|
echo -n " compiling..."
|
||||||
|
cd curl
|
||||||
|
./buildconf >> $DIR/install.log 2>&1
|
||||||
|
./configure >> $DIR/install.log 2>&1
|
||||||
|
make >> $DIR/install.log 2>&1
|
||||||
|
make install >> $DIR/install.log 2>&1
|
||||||
|
echo " done!"
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
#PHP 5
|
||||||
|
echo -n "[PHP5] downloading..."
|
||||||
|
wget http://php.net/get/php-5.4.10.tar.gz/from/this/mirror -q -O php-5.4.10.tar.gz
|
||||||
|
echo -n " extracting..."
|
||||||
|
tar -zxvf php-5.4.10.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
mv php-5.4.10 php
|
||||||
|
echo " done!"
|
||||||
|
cd php/ext
|
||||||
|
echo "[PHP pthreads] downloading..."
|
||||||
|
wget https://github.com/krakjoe/pthreads/archive/master.tar.gz -q -O pthreads-master.tar.gz
|
||||||
|
echo -n " extracting..."
|
||||||
|
tar -zxvf pthreads-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
mv pthreads-master pthreads
|
||||||
|
echo " done!"
|
||||||
cd ../
|
cd ../
|
||||||
|
echo -n "[PHP5] compiling..."
|
||||||
./buildconf --force
|
./buildconf --force
|
||||||
./configure --prefix=$DIR/php5 \
|
./configure --prefix=$DIR/php5 \
|
||||||
--exec-prefix=$DIR/php5 \
|
--exec-prefix=$DIR/php5 \
|
||||||
--enable-embedded-mysqli \
|
--enable-embedded-mysqli \
|
||||||
--with-openssl \
|
--with-openssl \
|
||||||
--with-mcrypt \
|
|
||||||
--with-mhash \
|
|
||||||
--enable-exif \
|
|
||||||
--with-freetype-dir \
|
|
||||||
--enable-calendar \
|
|
||||||
--enable-soap \
|
|
||||||
--enable-mbstring \
|
|
||||||
--enable-bcmath \
|
--enable-bcmath \
|
||||||
--enable-gd-native-ttf \
|
|
||||||
--with-gmp \
|
--with-gmp \
|
||||||
--with-curl \
|
--with-curl \
|
||||||
--enable-zip \
|
--enable-zip \
|
||||||
--with-gd \
|
|
||||||
--with-jpeg-dir \
|
|
||||||
--with-png-dir \
|
|
||||||
--with-mysql \
|
|
||||||
--with-mcrypt \
|
|
||||||
--with-zlib \
|
--with-zlib \
|
||||||
--enable-sockets \
|
--enable-sockets \
|
||||||
--enable-pthreads \
|
--enable-pthreads \
|
||||||
--enable-maintainer-zts \
|
--enable-maintainer-zts \
|
||||||
--enable-cli
|
--enable-cli
|
||||||
make
|
make
|
||||||
echo "n" | make test
|
|
||||||
make install
|
make install
|
||||||
|
echo " done!"
|
||||||
cd $DIR
|
cd $DIR
|
||||||
|
echo -n "[INFO] Cleaning up..."
|
||||||
rm -r -f install_data/
|
rm -r -f install_data/
|
||||||
rmdir install_data/
|
rmdir install_data/
|
||||||
echo "[INFO] Compilation Completed!"
|
echo " done!"
|
||||||
|
echo "[PocketMine] You should start the server now using \"./start.sh\""
|
Loading…
x
Reference in New Issue
Block a user