Added install scripts for linux

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-04 15:46:29 +01:00
parent 3e9afbdf54
commit a495e8f436
3 changed files with 99 additions and 0 deletions

73
compile_php.sh Normal file
View File

@ -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

20
install.sh Normal file
View File

@ -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"

View File

@ -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