From a495e8f4362d589f2effb94c7c9ef02d21f5acca Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Fri, 4 Jan 2013 15:46:29 +0100 Subject: [PATCH] Added install scripts for linux --- compile_php.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 20 ++++++++++++++ start.sh | 6 +++++ 3 files changed, 99 insertions(+) create mode 100644 compile_php.sh create mode 100644 install.sh diff --git a/compile_php.sh b/compile_php.sh new file mode 100644 index 000000000..175516f74 --- /dev/null +++ b/compile_php.sh @@ -0,0 +1,73 @@ +#!/bin/bash +echo "[INFO] PocketMine-MP PHP compiler for Linux - by @shoghicp v0.1" +if [ "$(whoami)" != 'root' ]; then +echo "[ERROR] You must be root to run this script" +exit 1; +fi +DIR=`pwd` +mkdir -m 0777 install_data +mkdir -m 0777 php5 +cd install_data +apt-get -f -y install +apt-get -y install \ +php5-cli \ +php5-common \ +php5-curl \ +php5-gd \ +php5-gmp \ +php5-mcrypt \ +build-essential \ +git-core \ +libxml2-dev \ +libcurl4-openssl-dev \ +libjpeg-dev \ +libpng-dev \ +libmysqlclient-dev \ +libfreetype6-dev \ +libmcrypt-dev \ +libmhash-dev +wget ftp://ftp.gmplib.org/pub/gmp-5.1.0/gmp-5.1.0.tar.bz2 -O gmp-5.1.0.tar.bz2 +tar -jxvf gmp-5.1.0.tar.bz2 +cd gmp-5.1.0 +./configure +make +make check +make install +wget http://php.net/get/php-5.4.10.tar.gz/from/this/mirror -O php-5.4.10.tar.gz +tar -zxvf php-5.4.10.tar.gz +cd php-5.4.10 +cd ext +git clone https://github.com/krakjoe/pthreads.git +cd ../ +./buildconf --force +./configure -q --prefix=$DIR/php5 \ +--exec-prefix=$DIR/php5 \ +--enable-embedded-mysqli \ +--with-openssl \ +--with-mcrypt \ +--with-mhash \ +--enable-exif \ +--with-freetype-dir \ +--enable-calendar \ +--enable-soap \ +--enable-mbstring \ +--enable-bcmath \ +--enable-gd-native-ttf \ +--with-gmp \ +--with-curl \ +--enable-zip \ +--with-gd \ +--with-jpeg-dir \ +--with-png-dir \ +--with-mysql \ +--with-mcrypt \ +--with-zlib \ +--enable-pthreads \ +--enable-maintainer-zts +make +echo "n" | make test +make install +cd $DIR +rm -r -f install_data/ +rmdir install_data/ +cd php5 \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100644 index 000000000..6d71555f2 --- /dev/null +++ b/install.sh @@ -0,0 +1,20 @@ +#!/bin/bash +echo "[INFO] PocketMine-MP installer for Linux [APT VERSION] - by @shoghicp v0.1" +if [ "$(whoami)" != 'root' ]; then + echo "[ERROR] You must be root to run this script" +# exit 1; +fi +echo "[0/4] Updating APT and fixing APT" +apt-get -y check +apt-get -y update +echo "[1/4] Installing PHP5" +./compile_php.sh +echo "[3/4] Fetching PocketMine-MP..." +wget https://github.com/shoghicp/PocketMine-MP/archive/master.zip -O latest.zip +echo "[4/4] Extracting..." +unzip -o -q latest.zip +mv -f PocketMine-MP-master/* ./ +rm -f -r PocketMine-MP-master/ +rm -f latest.zip +chmod 0755 ./start.sh +echo "[INFO] Done" \ No newline at end of file diff --git a/start.sh b/start.sh index 2d816ceb2..1e918a675 100644 --- a/start.sh +++ b/start.sh @@ -1,2 +1,8 @@ #!/bin/bash +DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR +if [ -f php5/bin/php ] then +php5/bin/php -d enable_dl=On PocketMine-MP.php +exit 0 +fi php -d enable_dl=On PocketMine-MP.php \ No newline at end of file