#set -e ############################# # USE PREFORK for building!!! ############################# #variables SRC_DIR=/data/src SVN_DIR=/data/svn PHP_VER=php-7.2.14 LIBDIR=lib EISFAIR_VER=1 export CFLAGS='-O2 -march=i486' if [ "`cat /etc/eisfair-system`" = "eisfair-64" ] then LIBDIR=lib64 EISFAIR_VER=64 export CFLAGS='-O2 -march=x86-64' fi export CXXFLAGS="${CFLAGS} -std=c++11" export COMMON_CONFIG='\ --prefix=/usr \ --exec-prefix=/usr \ --with-apxs2=/usr/bin/apxs \ --program-prefix= \ --bindir=/usr/bin \ --sysconfdir=/etc/php7 \ --libdir=/usr/lib/php7 \ --with-libdir=${LIBDIR} \ --datadir=/usr/lib/php7 \ --includedir=/usr/include/php7 \ --with-pear=/usr/share/php7 \ --disable-debug \ --enable-bcmath \ --enable-calendar \ --enable-dba \ --enable-exif \ --enable-ftp \ --enable-gd-jis-conv \ --enable-inline-optimization \ --enable-ipv6 \ --enable-mbstring \ --enable-mbregex \ --enable-session \ --enable-shmop \ --enable-sigchild \ --enable-sockets \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --enable-zip \ --with-bz2=shared,/usr \ --with-curl=shared,/usr \ --with-db4=shared,/usr \ --with-gettext=shared,/usr \ --with-gd=shared,/usr \ --with-freetype-dir \ --with-jpeg-dir \ --with-layout=GNU \ --with-ldap=shared,/usr \ --with-ldap-sasl \ --with-libmbfl \ --with-pdo-dblib=shared,/usr \ --with-pdo-mysql=shared,/usr \ --with-pgsql=shared,/usr \ --with-pdo-pgsql=shared,/usr \ --with-interbase=shared,/usr \ --with-pdo-firebird=shared,/usr \ --with-openssl=shared,/usr \ --with-png-dir \ --with-zlib=shared,/usr \ --with-imap=/usr \ --with-imap-ssl=/usr \ --enable-soap=shared \ --enable-sigchild \ --enable-pdo=shared \ --with-sqlite3=shared,/usr \ --with-pdo-sqlite=shared,/usr \ --enable-embedded-mysqli \ --enable-libxml \ --with-iconv=shared \ --with-mysqli=mysqlnd \ --with-pdo-mysql=shared,mysqlnd \ --with-xsl \ --with-xpm-dir=/usr \ --enable-fpm \ --with-fpm-user=wwwrun \ --with-fpm-group=nogroup \ --enable-intl=shared \ --with-openssl-dir=/usr' export apache2_config="\ --with-config-file-path=/etc/php7/apache2 \ --with-config-file-scan-dir=/etc/php7/apache2/conf.d \ $COMMON_CONFIG" export cli_config='\ --with-config-file-path=/etc/php7/cli \ --with-config-file-scan-dir=/etc/php7/cli/conf.d \ $COMMON_CONFIG' export fpm_config='\ --with-config-file-path=/etc/php7/fpm \ --with-config-file-scan-dir=/etc/php7/fpm/conf.d \ $COMMON_CONFIG' # goto src directory cd $SRC_DIR #-------------- # php #-------------- #wget #tar xjvf php-7.0.31.tar.bz2 cd $PHP_VER # rebuild configure script mv configure configure.orig ./buildconf --force # configure ./configure $apache2_config # compile php7 make make install # strip -R .note -R .comment /usr/lib/php7/20170718/* strip -R .note -R .comment /usr/lib/apache2/modules/libphp7.so #-------------- # apcu #-------------- cd $SRC_DIR wget https://pecl.php.net/get/apcu-5.1.16.tgz tar xzvf apcu-5.1.16.tgz cd apcu-5.1.16 make distclean phpize ./configure make make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # pdf #-------------- cd $SRC_DIR #wget https://pecl.php.net/get/pdflib-4.1.2.tgz #tar xzvf pdflib-4.1.2.tgz # see https://bugs.php.net/bug.php?id=60385 for hotfix cd pdflib-4.1.2 make distclean phpize ./configure make make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # redis #-------------- cd $SRC_DIR #wget http://pecl.php.net/get/redis-4.2.0.tgz #tar xzvf redis-4.2.0.tgz cd redis-4.2.0/ make distclean phpize ./configure make make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # php-xz #-------------- cd $SRC_DIR cd $PHP_VER cd ext git clone https://github.com/payden/php-xz xz cd xz git pull phpize && ./configure && make && make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # pcntl #-------------- cd $SRC_DIR cd $PHP_VER cd ext cd pcntl phpize && ./configure && make && make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # intl #-------------- cd $SRC_DIR cd $PHP_VER cd ext cd intl phpize && ./configure && make && make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # libsmbclient #-------------- cd $SRC_DIR cd $PHP_VER cd ext git clone git://github.com/eduardok/libsmbclient-php.git cd libsmbclient-php && phpize && ./configure --with-libsmbclient=/usr/${LIBDIR}/samba/ --includedir=/usr/include/samba-4.0/ && make && make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # imagick #-------------- cd $SRC_DIR #wget https://pecl.php.net/get/imagick-3.4.3.tgz #tar xzvf imagick-3.4.3.tgz cd imagick-3.4.3/ make distclean phpize ./configure make make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # mcrypt #-------------- cd $SRC_DIR wget https://pecl.php.net/get/mcrypt-1.0.2.tgz tar xzvf mcrypt-1.0.2.tgz cd mcrypt-1.0.2/ make distclean phpize ./configure make make install strip -R .note -R .comment /usr/lib/php7/20170718/* #-------------- # copy to svn #-------------- cd $SVN_DIR/trunk/web/apache2_php7/eisfair-${EISFAIR_VER} cp /usr/lib/apache2/modules/libphp7.so usr/lib/apache2/modules/libphp7.so mv /usr/lib/php7/20170718/apcu.so $SVN_DIR/trunk/web/php7-apcu/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/imagick.so $SVN_DIR/trunk/web/php7-imagick/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/interbase.so $SVN_DIR/trunk/web/php7-firebird/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/pdo_firebird.so $SVN_DIR/trunk/web/php7-firebird/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/intl.so $SVN_DIR/trunk/web/php7-intl/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/ldap.so $SVN_DIR/trunk/web/php7-ldap/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/pdo_mysql.so $SVN_DIR/trunk/web/php7-mysql/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/opcache.so $SVN_DIR/trunk/web/php7-opcache/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/pcntl.so $SVN_DIR/trunk/web/php7-pcntl/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/pdf.so $SVN_DIR/trunk/web/php7-pdflib/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/pgsql.so $SVN_DIR/trunk/web/php7-pgsql/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/pdo_pgsql.so $SVN_DIR/trunk/web/php7-pgsql/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/redis.so $SVN_DIR/trunk/web/php7-redis/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/smbclient.so $SVN_DIR/trunk/web/php7-smbclient/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/soap.so $SVN_DIR/trunk/web/php7-soap/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/sqlite3.so $SVN_DIR/trunk/web/php7-sqlite/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/pdo_sqlite.so $SVN_DIR/trunk/web/php7-sqlite/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ mv /usr/lib/php7/20170718/xz.so $SVN_DIR/trunk/web/php7-xz/eisfair-${EISFAIR_VER}/usr/lib/php7/extensions/ cd $SVN_DIR/trunk/web/php7-common/eisfair-${EISFAIR_VER} mv /usr/lib/php7/20170718/* usr/lib/php7/extensions/ ########### # build cli ./configure $cli_config make make install strip -R .note -R .comment /usr/bin/pear* strip -R .note -R .comment /usr/bin/pecl* strip -R .note -R .comment /usr/bin/php* #-------------- # copy to svn #-------------- cd ${SVN_DIR}/trunk/plang/php7-cli/eisfair-${EISFAIR_VER} cp /usr/bin/pear usr/bin/pear-7 cp /usr/bin/peardev usr/bin/peardev-7 cp /usr/bin/pecl usr/bin/pecl-7 cp /usr/bin/php usr/bin/php-7 cp /usr/bin/php-cgi usr/bin/php-cgi-7 cp /usr/bin/php-config usr/bin/php-config-7 cp /usr/bin/phpdbg usr/bin/phpdbg-7 cp /usr/bin/phpize usr/bin/phpize-7 cp -R /usr/share/php7/* usr/share/php7/ ########### #build fpm make clean ./configure $fpm_config make make install strip -R .note -R .comment /usr/sbin/php* #-------------- # copy to svn #-------------- cd ${SVN_DIR}/trunk/web/php7-fpm/eisfair-${EISFAIR_VER} cp /usr/sbin/php-fpm usr/sbin/php7-fpm