IGNOREPATH=/tmp:/dev:/root:/var:/etc:/home:/sbin:/bin:/usr/local:/usr/src STRIPLIB=y STRIPBIN=y PHP_VER=4.3.3 PINE=4.58 PROGNAME="PHP $PHP_VER" DESC="\ php (HTML-embedded scripting language) \n\ \n\ PHP is an HTML-embedded scripting language. It shares syntax \n\ characteristics with C, Java, and Perl. The primary objective \n\ behind this language is to make a fast and easy-to-use scripting \n\ language for dynamic web sites. \n\ \n\ More information can be found online at http://www.php.net/" BUILD=1 MAINTAINER="Mark Post " SOURCE=http://www.php.net PKGNAME=php-$PHP_VER-s390-$BUILD TAG=OPT compile() { # we need to compile Pine to get c-client.a for IMAP support: if [ ! -f $TMP/pine${PINE}/imap/c-client/lib/c-client.a ]; then ( cd $TMP if echo $CWD | grep patches >/dev/null; then CWD=$CWD/../pine # have to figure out how to make this work in all cases else CWD=$CWD/../pine # CWD=$CWD/../../../source/n/pine fi source $CWD/prototype compile cd $TMP/pine${PINE}/imap/c-client mkdir include cp *.h include mkdir lib cp *.a lib ) fi php_configure() { EXTENSION_DIR=/usr/lib/php/extensions \ CFLAGS=-O2 ./configure --prefix=/usr \ $* \ --sysconfdir=/etc \ --enable-discard-path \ --with-config-file-path=/etc/apache \ --enable-safe-mode \ --with-openssl \ --enable-bcmath \ --with-bz2 \ --with-pic \ --enable-calendar \ --enable-ctype \ --with-gdbm \ --with-db3 \ --with-imap-ssl=$TMP/pine${PINE}/imap/c-client \ --with-imap=$TMP/pine${PINE}/imap/c-client \ --enable-dbase \ --enable-ftp \ --with-iconv \ --with-gd \ --enable-gd-native-ttf \ --with-jpeg-dir=/usr \ --with-png \ --with-gmp \ --with-mysql=shared,/usr \ --with-xml=shared,/usr \ --with-gettext=shared,/usr \ --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 # --with-curl # no requests for this, so we'll avoid the dependancy } # compile php cd $TMP tar -yxvf $CWD/php-$PHP_VER.tar.bz2 cd php-$PHP_VER/ # Fixup perms/owners: chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -name "*.h" -exec chmod 644 {} \; # Sometimes they ship a few of these: find . -name "*.orig" -exec rm {} \; # Patch ini files: zcat $CWD/php.ini.diff.gz | patch -p1 # Make the standalone interpreter: php_configure --enable-force-cgi-redirect --enable-fastcgi make clean make # Have to save the php module so that the make distclean doesn't erase it mv sapi/cgi/php sapi/cgi/php.save make distclean # Make the Apache module version of PHP: php_configure --disable-static --with-apxs=/usr/sbin/apxs make # libtool can't seem to figure out how to link in a static library when making # a shared library any more. So, we need to do it manually. if [ ! -f .libs/libphp4.so ]; then sh -x $CWD/link.libphp4 $PHP_VER ls -la .libs cat $CWD/libtool.diff | patch -p0 cp -vp .libs/libphp4* libs/ fi } install() { cd $TMP/php-$PHP_VER/ # This next step is needed to keep the "make install" from complaining about # /package-php/etc/apache/httpd.conf not existing. It gets removed right after that, # along with the .bak file that gets created. mkdir -p /package-php/etc/apache/ cat $CWD/dummy.httpd.conf > /package-php/etc/apache/httpd.conf make install INSTALL_ROOT=/package-php cp -p sapi/cgi/php.save /package-php/usr/bin/php rm /package-php/etc/apache/httpd.conf* mkdir -p /package-php/etc/apache cp -a php.ini-dist php.ini-recommended /package-php/etc/apache/ cp -a $CWD/mod_php.conf.example /package-php/etc/apache/ mkdir -p /package-php/usr/doc/php-$PHP_VER cp -a CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE \ NEWS README* TODO* sapi/cgi/README.FastCGI \ /package-php/usr/doc/php-$PHP_VER gzip -9 /package-php/usr/man/man1/*.1 } attributes() { chown -R root.bin $PKG/package-php/usr/bin } special() { cd $PKG mv package-php/* ./ rmdir package-php/ cd $CTL cat $CWD/slack-desc > slack-desc zcat $CWD/doinst.sh.gz > doinst.sh sed -e 's%package-php/%%g' doinst.sh > doinst.sh.new cat doinst.sh.new > doinst.sh rm doinst.sh.new }