#!/bin/sh # # Build and package mod_php on Slackware. # by: David Cantrell # Modified for PHP 4.1.x+ by volkerdi@slackware.com CWD=`pwd` TMP=/tmp GD_VER=1.8.4 PHP_VER=4.1.2 # compile a static gd that we can link into php cd $TMP rm -rf gd-$GD_VER tar xvzf $CWD/gd-$GD_VER.tar.gz cd gd-$GD_VER make mkdir lib mkdir bin mkdir include cp libgd.a lib cp gd.h gdcache.h gd_io.h gdfontg.h gdfontmb.h gdfonts.h gdfontt.h include cp pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng \ bdftogd bin php_configure() { CFLAGS=-O2 ./configure --prefix=/usr \ $* \ --enable-discard-path \ --with-config-file-path=/etc/apache \ --enable-safe-mode \ --with-openssl \ --enable-bcmath \ --with-bz2 \ --enable-pic \ --enable-calendar \ --enable-ctype \ --with-gdbm \ --with-db2 \ --with-db3 \ --enable-dbase \ --enable-ftp \ --enable-gd-imgstrttf \ --with-gd=$TMP/gd-$GD_VER \ --with-jpeg-dir=$TMP/gd-$GD_VER \ --with-png-dir=$TMP/gd-$GD_VER \ --with-gmp \ --with-mysql=/usr \ --with-xml=shared \ --with-mm=/usr \ --enable-trans-sid \ --enable-shmop \ --enable-sockets \ --with-regex=php \ --enable-sysvsem \ --enable-sysvshm \ --enable-yp \ --enable-memory-limit \ --with-tsrm-pthreads \ --enable-shared \ --disable-debug \ --with-zlib=/usr # --with-mod_charset # only for Russian patched Apache # --with-readline=/usr # this is only for the CGI version # --with-ttf # this links with the shlib, need X for that # --with-java # no thanks # --with-dom # requires libxml >= 2.2.7 } # compile php cd $TMP tar xvzf $CWD/php-$PHP_VER.tar.gz cd php-$PHP_VER # Make the standalone interpreter: php_configure --enable-force-cgi-redirect make cat php > /usr/bin/php chmod 755 /usr/bin/php chown root.bin /usr/bin/php make distclean # Make the Apache modules: php_configure --disable-static --with-apxs=/usr/sbin/apxs make make install mkdir -p /usr/doc/php-$PHP_VER cp -a \ CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS README* RELEASE_PROCESS TODO* *.txt \ /usr/doc/php-$PHP_VER chown -R root.root /usr/doc/php-$PHP_VER mkdir -p /etc/apache cp -a php.ini-dist php.ini-recommended /etc/apache cp -a $CWD/mod_php.conf.example /etc/apache chmod 644 /etc/apache/* chown root.root /etc/apache/* mkdir -p /install cat $CWD/doinst.sh > /install/doinst.sh cat $CWD/slack-desc > /install/slack-desc