Summary: php - PHP4 built for apache (apxs) Name: php Version: 4.0.2 Release: 1 Group: Networking/Daemons Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz Source1: http://www.anteil.com/Anteil/udb-1.5.tgz Copyright: GPL BuildRoot: %{_tmppath}/php Packager: Jim Capp Provides: php %description php module for apache (apxs) %package mysql Group: Database/Daemons Summary: mysql module for php 4.0.2 Requires: php, libmysqlclient.so.6 Provides: mysql.so %description mysql installs mysql module for php 4.0.2 %package udb Group: Database/Daemons Summary: udb module for php 4.0.2 Requires: mysql.so, libudb.so, libmysqlclient.so.6 %description udb installs udb module for php 4.0.2 %prep %setup -q -n php-4.0.2 %setup -T -D -b 1 # install udb modules into php4 cd $RPM_BUILD_DIR/udb-1.5/php4 find ext -print | cpio -pdmuv $RPM_BUILD_DIR/php-$RPM_PACKAGE_VERSION/ # now get back to php4 and do the real work cd $RPM_BUILD_DIR/php-$RPM_PACKAGE_VERSION chown -R root.root . autoconf ./buildconf ./configure --with-apxs=/usr/sbin/apxs --with-mysql=shared,/usr --with-udb=shared,/usr/src/redhat/BUILD/udb-1.5 --without-gd %build # mysql should be built as a shared module make %install install -m755 -D $RPM_BUILD_DIR/php-$RPM_PACKAGE_VERSION/.libs/libphp4.so $RPM_BUILD_ROOT/usr/lib/apache/libphp4.so LIB=usr/local/lib install -m755 -D $RPM_BUILD_DIR/php-${RPM_PACKAGE_VERSION}/php.ini-dist $RPM_BUILD_ROOT/usr/local/lib/php.ini LIB=usr/local/lib EXT=$LIB/php/extensions/no-debug-non-zts-20000809 install -m755 -D $RPM_BUILD_DIR/php-${RPM_PACKAGE_VERSION}/modules/mysql.so $RPM_BUILD_ROOT/$EXT/mysql.so install -m755 -D $RPM_BUILD_DIR/php-${RPM_PACKAGE_VERSION}/modules/udb.so $RPM_BUILD_ROOT/$EXT/udb.so %post # # modify /etc/httpd/conf/httpd.conf # cat > /tmp/$$.awk << __AWK__ /LoadModule php3_module/ { print; printf( "LoadModule php4_module modules/libphp4.so\n" ); next; } /AddModule mod_php3.c/ { print; printf( "AddModule mod_php4.c\n" ); next; } // { printf( "\n" ); printf( "AddType application/x-httpd-php .php\n" ); printf( "\n" ); printf( "\n" ); print; next; } /DirectoryIndex index.html index.htm index.shtml index.cgi/ { printf( "DirectoryIndex index.html index.htm index.shtml index.cgi index.php\n" ); next; } { print; } __AWK__ CONFIG=/etc/httpd/conf/httpd.conf TMPF=/tmp/$$.conf awk -f /tmp/$$.awk < $CONFIG > $TMPF && cat $TMPF > $CONFIG rm -fr $TMPF $$.awk %post mysql # add mysql shared library to /usr/local/lib/php.ini cat > /tmp/$$.awk << __AWK__ /extension_dir =/ { printf( "extension_dir\t= /usr/local/lib/php/extensions/no-debug-non-zts-20000809/ ; directory in which the loadable extensions (modules) reside\n" ); next; } /; extension=msql.so/ { print; printf( "extension=mysql.so\n" ); printf( "\n" ); next; } { print; } __AWK__ CONFIG=/usr/local/lib/php.ini TMPF=/tmp/$$.ini awk -f /tmp/$$.awk < $CONFIG > $TMPF && cat $TMPF > $CONFIG rm -f /tmp/$$.awk %post udb # modify /usr/local/lib/php.ini cat > /tmp/$$.awk << __AWK__ /^extension=mysql.so/ { print; printf( "extension=udb.so\n" ); printf( "\n" ); next; } { print; } __AWK__ CONFIG=/usr/local/lib/php.ini TMPF=/tmp/$$.ini awk -f /tmp/$$.awk < $CONFIG > $TMPF && cat $TMPF > $CONFIG rm -f $TMPF /tmp/$$.awk %clean rm -rf $RPM_BUILD_ROOT %changelog * Thu Sep 7 2000 Jim Capp - revised for php-4.0.2 * Wed Aug 30 2000 Jim Capp - Made initial cut for php for apache (apxs) %files /usr/lib/apache/libphp4.so %config /usr/local/lib/php.ini %files mysql /usr/local/lib/php/extensions/no-debug-non-zts-20000809/mysql.so %files udb /usr/local/lib/php/extensions/no-debug-non-zts-20000809/udb.so