Hi. I made a simple script that I intend to run each time I make some changes to apache2 and/or php. The script simply downloads my local "phpinfo.php" page, does some magic with it and uploads it to: http://d-srv.com/php/
One guy reported problems connecting to http://d-srv.com/, is he the only one that experiences this? (I suspect some wierd transparent proxy or something...) Appearently http://www.d-srv.com/ worked better for him, but then I have to fix the static htmls links everywhere... Currently there's this one there: http://d-srv.com/php/phpinfo-20030114.html (or http://www.deserve-it.com/php/phpinfo-20030114.html) Note the "Apache 2.0" section this time (fix included in P8). Also note I have almost every apache2 module and php extension installed ;) Everthing is built on Mandrake Linux 9.0 though... P7 adds db4 support to the dba extension. P8 fixes these bugs for apache2filter: * http://bugs.php.net/bug.php?id=21045 * http://bugs.php.net/bug.php?id=17098 I haven't tried jmdaults patch (http://bugs.php.net/bug.php?id=21625) yet, that's probably why I have problems with the php-apc extension... Well..., it's pretty obvious what changes I made to the php.spec file. Chears. -- Regards // Oden Eriksson, Deserve-IT.com
php-4.3.0-db4.patch.bz2
Description: BZip2 compressed data
php-4.3.0-apache2.patch.bz2
Description: BZip2 compressed data
--- php.spec 2003-01-08 05:24:00.000000000 +0100
+++ php.spec.oden 2003-01-13 21:12:17.000000000 +0100
@@ -1,8 +1,32 @@
+# OE: conditional switches
+#
+#(ie. use with rpm --rebuild):
+#
+# --with debug Compile with debugging code
+#
+# enable build with debugging code: will _not_ strip away any debugging code,
+# will _add_ -g3 to CFLAGS, will _add_ --enable-maintainer-mode to
+# configure.
+
+%define build_debug 0
+
+# commandline overrides:
+# rpm -ba|--rebuild --with 'xxx'
+%{?_with_debug: %{expand: %%define build_debug 1}}
+
+%if %{build_debug}
+# disable build root strip policy
+%define __spec_install_post %{_libdir}/rpm/brp-compress || :
+
+# This gives extra debuggin and huge binaries
+%{expand:%%define optflags %{optflags} %([ ! $DEBUG ] && echo '-g3')}
+%endif
+
%define phpdir %{_libdir}/php
%define peardir %{_datadir}/pear
%define libversion 430
%define phpversion 4.3.0
-%define phprelease 1mdk
+%define phprelease 5mdk
#The external_modules definition has been put in the %%build section
#to clean things a bit
@@ -23,6 +47,8 @@
Patch3: php-4.3.0-info.patch.bz2
Patch4: php-4.3.0-64bit.patch.bz2
Patch6: php-4.3.0-fix-pear.patch.bz2
+Patch7: php-4.3.0-db4.patch.bz2
+Patch8: php-4.3.0-apache2.patch.bz2
# Stolen from PLD
Patch14: php-4.3.0-mail.patch.bz2
Patch15: php-4.3.0-mcal-shared-lib.patch.bz2
@@ -35,6 +61,7 @@
BuildRequires: zlib-devel
BuildRequires: glibc-devel
BuildRequires: gettext-devel
+#BuildRequires: autoconf2.5
BuildRoot: %{_tmppath}/%{name}-%{version}
Provides: ADVXpackage
@@ -45,6 +72,12 @@
systems, so writing a database-enabled script with PHP is fairly simple. The
most common use of PHP coding is probably as a replacement for CGI scripts.
+You can build %{name} with some conditional build swithes;
+
+(ie. use with rpm --rebuild):
+--with debug Compile with debugging code
+
+
%package cli
Group: Development/Other
Summary: Command-line interface to PHP
@@ -160,7 +193,6 @@
SELF-CONTAINED-EXTENSIONS.
%prep
-[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
%setup -q
%patch0 -p1
@@ -169,6 +201,8 @@
%patch3 -p1
%patch4 -p1
%patch6 -p1
+%patch7 -p1
+%patch8 -p1
# Stolen from PLD
%patch14 -p1
@@ -194,6 +228,12 @@
rm -f php-devel/extensions/skeleton/EXPERIMENTAL
rm -f php-devel/extensions/ncurses/EXPERIMENTAL
+# don't ship MS Windows source
+rm -rf php-devel/extensions/com
+rm -rf php-devel/extensions/dotnet
+rm -rf php-devel/extensions/printer
+rm -rf php-devel/extensions/w32api
+
cp -dpR sapi/* php-devel/sapi/
rm -f php-devel/sapi/thttpd/stub.c
rm -f php-devel/sapi/cgi/php.sym
@@ -205,16 +245,15 @@
cat > php-devel/buildext <<EOF
#!/bin/bash
gcc -fPIC -shared %{optflags} \\
- -I. \\
- -I/usr/include/php \\
- -I/usr/include/php/Zend \\
- -I/usr/include/php/TSRM \\
- -I/usr/include/php/main \\
+ -I. \`%{_bindir}/php-config --includes\` \\
-I/usr/include/freetype \\
+ -I/usr/include/openssl \\
-I/usr/include/\$1 \\
\$4 \$2 -o \$1.so \$3 -lc
EOF
+chmod 755 php-devel/buildext
+
cat > php-devel/PHP_BUILD <<EOF
%%global phpdir %{phpdir}
%%global peardir %{peardir}
@@ -223,9 +262,12 @@
%%global phprelease %{phprelease}
EOF
-chmod 755 php-devel/buildext
-
%build
+
+# OE: we should run buildconf if applied patches changes the configure stuff...
+# but currently I'm just too lazy to fix P1 ;)
+#./buildconf
+
%serverbuild
#For eventual compatibility with RedHat
@@ -241,7 +283,7 @@
#############################################################################
# Yes I know..., some of these names are mandrake specific.
# JMD: put mysql, pgsql ... ldap first, so people will see them first.
-%define external_modules mysql pgsql gd imap ldap bcmath bz2 calendar com cpdf crack curl cyrus db dba_bundle dbase dbx dio domxml dotnet exif fbsql fdftk filepro fribidi gmp hwapi hyperwave iconv informix ingres_ii interbase ircg java mcrypt mbstring mhash mime_magic ming mnogosearch msession msql mssql ncurses notes oci8 odbc oracle ovrimos pcntl pdf pfpro pspell qtdom readline recode rpc shmop snmp sockets swf sybase sybase_ct sysvmsg wddx xml xmlrpc xslt yaz zip
+%define external_modules mysql pgsql gd imap ldap bcmath bz2 calendar cpdf crack curl cyrus db dba dba_bundle dbase dbx dio domxml exif fbsql fdf filepro fribidi gmp hwapi hyperwave iconv imagick informix ingres_ii interbase ircg java mbstring mcal mcrypt mcve mhash mime_magic ming mnogosearch msession msql mssql ncurses notes oci8 odbc oracle overload ovrimos pam_auth pcntl pdf pfpro pgsql posix pspell qtdom readline recode shmop snmp sockets swf sybase sybase_ct sysvmsg tokenizer wddx xml xmlrpc xslt yaz zip
#DO NOT PUT THESE EXTENSIONS AS EXTERNAL:
# Here are reasons for each extension
@@ -299,8 +341,10 @@
--with-config-file-scan-dir=%{_sysconfdir}/php \
--with-pear=%{peardir} \
--enable-magic-quotes \
+%if %{build_debug}
+ --enable-maintainer-mode \
+%endif
--enable-debugger \
- --with-openssl \
--enable-track-vars \
--with-exec-dir=%{_bindir} \
--with-versioning \
@@ -309,22 +353,20 @@
--enable-track-vars \
--enable-trans-sid \
--enable-safe-mode \
- --with-ctype \
- --with-ttf \
- --with-freetype-dir=%{_prefix} \
- --with-zlib \
+ --enable-ctype \
+ --enable-ftp \
+ --enable-gettext=%{_prefix} \
+ --enable-posix \
+ --enable-session \
--enable-sysvsem \
--enable-sysvshm \
--enable-yp \
- --enable-ftp \
- --with-gettext \
- --without-aspell \
+ --with-openssl=%{_prefix} \
--without-kerberos \
- --without-dba \
- --without-db2 \
- --without-db3 \
+ --with-ttf --with-freetype-dir=%{_prefix} --with-zlib=%{_prefix} \
+ --with-zlib=%{_prefix} --with-zlib-dir=%{_prefix} \
`for i in %{external_modules}; do echo --without-${i} --disable-${i}; done` \
- --without-gdbm
+ --without-dba --without-gdbm --without-ndbm --without-db2 --without-db3 --without-db4 --without-dbm --without-cdb --without-flatfile
### This configuration makes a dependency on those libs:
# -ldl -lpam -lcrypt -lresolv -lm -lz
@@ -348,14 +390,21 @@
./php-killrpath sapi/cli/php
./php-killrpath sapi/cgi/php
+
%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
-mv libphp_common.so libphp_common.so.430
-ln -s libphp_common.so.430 libphp_common.so
+# OE: make this somewhat short-circuitable
+if ! [ -f libphp_common.so.430 ]; then
+ mv libphp_common.so libphp_common.so.430
+ ln -s libphp_common.so.430 libphp_common.so
+fi
+
export LD_LIBRARY_PATH="."
export INSTALL_ROOT="$RPM_BUILD_ROOT"
export PHP_PEAR_INSTALL_DIR="%{peardir}"
+touch php.ini
+export PHPRC="."
make install
mkdir -p %{buildroot}%{_libdir}
@@ -381,6 +430,7 @@
ln -s extensions ext
rm -rf %{buildroot}%{peardir}
+rm -f %{buildroot}%{_bindir}/pear
%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
@@ -424,7 +474,7 @@
%files -n php%{libversion}-devel
%defattr(-,root,root)
-%doc SELF-CONTAINED-EXTENSIONS CODING_STANDARDS README.* TODO
+%doc SELF-CONTAINED-EXTENSIONS CODING_STANDARDS README.* TODO EXTENSIONS
%doc Zend/ZEND_*
%{_bindir}/php-config
%{_bindir}/phpextdist
@@ -439,6 +489,22 @@
%{_libdir}/*.so
%changelog
+* Mon Jan 13 2003 Oden Eriksson <[EMAIL PROTECTED]> 4.3.0-5mdk
+- added apache2 fix from CVS (P8) (php bugs: #21045 & #17098)
+
+* Sun Jan 12 2003 Oden Eriksson <[EMAIL PROTECTED]> 4.3.0-4mdk
+- added overload, imagick, pam_auth and tokenizer to the EXTENSIONS HACK,
+ this prevents overload and tokenizer to be built in.
+- enable build with debugging code, used ideas from the apache2 package
+- fix the buildext script
+- remove aspell (it's gone)
+- ignore all MS stuff
+- force php to load dummy php.ini in %%install
+- misc spec file fixes
+
+* Thu Jan 09 2003 Oden Eriksson <[EMAIL PROTECTED]> 4.3.0-3mdk
+- added P7 (db4 support from CVS) Yihaa!
+
* Tue Jan 07 2003 Jean-Michel Dault <[EMAIL PROTECTED]> 4.3.0-2mdk
- Put all extensions in the EXTERNAL_MANDRAKE_MODULES hack.
- Add Provides: ADVXpackage, all ADVX package will have this tag,
