Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > by-pkgid > 46f35177574cc2977dd298fe2418a482 > files > 41

php-5.0.4-9mdk.src.rpm

%define _requires_exceptions BEGIN\\|mkinstalldirs\\|pear(

%define build_test 0
%define build_hardened 0
%{?_with_test: %{expand: %%global build_test 1}}
%{?_without_test: %{expand: %%global build_test 0}}
%{?_with_hardened: %{expand: %%global build_hardened 1}}
%{?_without_hardened: %{expand: %%global build_hardened 0}}

%define epoch 3
%define major 5
%define libname %mklibname php5_common %{major}
%define old_libname %mklibname php_common 432

Summary:	The PHP5 scripting language
Name:		php
Version:	5.0.4
Release:	%mkrel 9
Group:		Development/Other
License:	PHP License
URL:		http://www.php.net
Source0:	php-%{version}.tar.bz2
Source3:	FAQ.php.bz2
Patch0:		php-4.3.0-init.patch.bz2
Patch1:		php-5.0.0-shared.diff.bz2
Patch2:		php-4.3.0-imap.patch.bz2
Patch3:		php-4.3.4RC3-64bit.patch.bz2
Patch4:		php-5.0.4-lib64.diff.bz2
Patch5:		php-4.3.0-fix-pear.patch.bz2
Patch6:		php-4.3.11-libtool.diff.bz2
Patch7:		php-5.0.4-no_egg.diff.bz2
Patch8:		php-5.0.4-phpize.diff.bz2
Patch9:		php-5.0.0-remove_bogus_iconv_deps.diff.bz2
# for kolab2
Patch11:	php-5.0.4-imap-annotation.diff.bz2
Patch12:	php-5.0.4-imap-status-current.diff.bz2
#####################################################################
# Stolen from PLD
Patch20:	php-4.3.0-mail.patch.bz2
Patch21:	php-sybase-fix.patch.bz2
Patch22:	php-wddx-fix.patch.bz2
#####################################################################
# Stolen from fedora
Patch100:	php-5.0.1-config.patch.bz2
Patch101:	php-4.2.2-cxx.patch.bz2
Patch102:	php-4.3.3-install.patch.bz2
Patch103:	php-5.0.4-norpath.patch.bz2
Patch104:	php-4.3.2-libtool15.patch.bz2
Patch105:	php-4.3.6-umask.patch.bz2
Patch106:	php-5.0.2-gdnspace.patch.bz2
Patch107:	php-4.3.8-round.patch.bz2
Patch108:	php-5.0.3-gdheaders.patch.bz2
Patch109:	php-5.0.3-gcc4.patch.bz2
Patch110:	php-5.0.4-streamcopy.patch.bz2
# Fixes for extension modules
Patch111:	php-4.3.1-odbc.patch.bz2
Patch112:	php-4.3.11-shutdown.patch.bz2
Patch113:	php-5.0.4-bug32282.patch.bz2
Patch114:	php-5.0.4-xmldom.patch.bz2
# Functional changes
Patch115:	php-5.0.4-dlopen.patch.bz2
# Fixes for tests
Patch120:	php-5.0.4-tests-dashn.patch.bz2
Patch121:	php-5.0.4-tests-wddx.patch.bz2
Patch122:	php-5.0.4-tests-sunfunc.patch.bz2
#####################################################################
# make the tests work better
#Patch200:	php-4.3.3-make_those_darn_tests_work.patch.bz2
# Fix bugs
Patch200:	php-bug-22414.patch.bz2
# http://bugs.php.net/bug.php?id=29119
Patch201:	php-5.0.4-bug29119.diff.bz2
# http://www.hardened-php.net/
Patch300:	http://www.hardened-php.net/hardening-patch-5.0.4-0.4.1.patch.gz
Source4:	http://www.hardened-php.net/hardening-patch-5.0.4-0.4.1.patch.gz.sig
BuildRequires:	apache-devel >= 2.0.54, autoconf2.5, automake1.7, bison, byacc, flex, libtool, libxml2-devel, libxslt-devel
BuildRequires:	openssl >= 0.9.7, openssl-devel >= 0.9.7, pcre-devel >= 5.0, pam-devel, dos2unix
%if %mdkversion >= 1020
BuildRequires:	multiarch-utils >= 1.0.3
%endif
Epoch:		%{epoch}
Requires(post,preun): %{libname} >= %{version}
# the tests will fail because any file in /etc/php.d/ will be picked up,
# wo we need to have this build conflict...
%if %{build_test}
BuildConflicts:	php-bz2 php-calendar php-ctype php-curl php-date_time php-dba php-dbase php-dbx php-dio php-dom php-eaccelerator php-eaccelerator-eloader
BuildConflicts:	php-enchant php-esmtp php-event php-exif php-fam php-ffmpeg php-fileinfo php-filepro php-ftp php-gd php-gettext php-gmp php-iconv php-id3
BuildConflicts:	php-idn php-imap php-imlib2 php-ini php-ldap php-mailparse php-mbstring php-mcache php-mcrypt php-mhash php-ming php-mnogosearch php-mssql
BuildConflicts:	php-mysql php-mysqli php-ncurses php-newt php-odbc php-oggvorbis php-pam_auth php-pcntl php-pcre php-pgsql php-posix php-pspell php-radius
BuildConflicts:	php-readline php-recode php-ruli php-sasl php-session php-shmop php-simplexml php-snmp php-soap php-sockets php-sqlite php-ssh2 php-sysvmsg
BuildConflicts:	php-sysvsem php-sysvshm php-tclink php-tcpwrap php-tidy php-tokenizer php-translit php-xattr php-xdebug php-xml php-xmlrpc php-xsl php-yaz
BuildConflicts:	php-yp php-zip
%endif
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
PHP5 is an HTML-embeddable scripting language. PHP5 offers built-in
database integration for several commercial and non-commercial
database management systems, so writing a database-enabled script
with PHP5 is fairly simple.  The most common use of PHP5 coding is
probably as a replacement for CGI scripts.

(ie. use with rpm --rebuild):
--with[out] hardened	Compile with the Hardened-PHP patch applied (disabled)
			you will have to rebuild all php-* extensions against
			the Hardened-PHP, and also live with the fact that
			commercial extensions will not work anymore :(

%package	cli
Summary:	PHP5 CLI interface
Group:		Development/Other
Requires(post): %{libname} >= %{version}
Requires(post): php-ini >= %{version}
Requires(post): php-ftp >= %{epoch}:%{version}
Requires(post): php-yp >= %{epoch}:%{version}
Requires(post): php-pcre >= %{epoch}:%{version}
Requires(post): php-gettext >= %{epoch}:%{version}
Requires(post): php-posix >= %{epoch}:%{version}
Requires(post): php-ctype >= %{epoch}:%{version}
Requires(post): php-session >= %{epoch}:%{version}
Requires(post): php-sysvsem >= %{epoch}:%{version}
Requires(post): php-sysvshm >= %{epoch}:%{version}
Requires(post): php-tokenizer >= %{version}
Requires(preun): %{libname} >= %{version}
Requires(preun): php-ini >= %{version}
Requires(preun): php-ftp >= %{epoch}:%{version}
Requires(preun): php-yp >= %{epoch}:%{version}
Requires(preun): php-pcre >= %{epoch}:%{version}
Requires(preun): php-gettext >= %{epoch}:%{version}
Requires(preun): php-posix >= %{epoch}:%{version}
Requires(preun): php-ctype >= %{epoch}:%{version}
Requires(preun): php-session >= %{epoch}:%{version}
Requires(preun): php-sysvsem >= %{epoch}:%{version}
Requires(preun): php-sysvshm >= %{epoch}:%{version}
Requires(preun): php-tokenizer >= %{version}
Requires:	%{libname} >= %{version}
Requires:	php-ini >= %{version}
Requires:	php-ftp >= %{epoch}:%{version}
Requires:	php-yp >= %{epoch}:%{version}
Requires:	php-pcre >= %{epoch}:%{version}
Requires:	php-gettext >= %{epoch}:%{version}
Requires:	php-posix >= %{epoch}:%{version}
Requires:	php-ctype >= %{epoch}:%{version}
Requires:	php-session >= %{epoch}:%{version}
Requires:	php-sysvsem >= %{epoch}:%{version}
Requires:	php-sysvshm >= %{epoch}:%{version}
Requires:	php-tokenizer >= %{version}
Provides:	php php3 php4 php432 php430
Obsoletes:	php php3 php4 php432 php430
Epoch:		%{epoch}

%description	cli
PHP5 is an HTML-embeddable scripting language. PHP5 offers built-in
database integration for several commercial and non-commercial
database management systems, so writing a database-enabled script
with PHP5 is fairly simple.  The most common use of PHP5 coding is
probably as a replacement for CGI scripts.

This package contains a command-line (CLI) version of php. You must
also install libphp5_common. If you need apache module support, you
also need to install the apache-mod_php package.

%package	cgi
Summary:	PHP5 CGI interface
Group:		Development/Other
Requires(post): %{libname} >= %{version}
Requires(post): php-ini >= %{version}
Requires(post): php-ftp >= %{epoch}:%{version}
Requires(post): php-yp >= %{epoch}:%{version}
Requires(post): php-pcre >= %{epoch}:%{version}
Requires(post): php-gettext >= %{epoch}:%{version}
Requires(post): php-posix >= %{epoch}:%{version}
Requires(post): php-ctype >= %{epoch}:%{version}
Requires(post): php-session >= %{epoch}:%{version}
Requires(post): php-sysvsem >= %{epoch}:%{version}
Requires(post): php-sysvshm >= %{epoch}:%{version}
Requires(post): php-tokenizer >= %{version}
Requires(preun): %{libname} >= %{version}
Requires(preun): php-ini >= %{version}
Requires(preun): php-ftp >= %{epoch}:%{version}
Requires(preun): php-yp >= %{epoch}:%{version}
Requires(preun): php-pcre >= %{epoch}:%{version}
Requires(preun): php-gettext >= %{epoch}:%{version}
Requires(preun): php-posix >= %{epoch}:%{version}
Requires(preun): php-ctype >= %{epoch}:%{version}
Requires(preun): php-session >= %{epoch}:%{version}
Requires(preun): php-sysvsem >= %{epoch}:%{version}
Requires(preun): php-sysvshm >= %{epoch}:%{version}
Requires(preun): php-tokenizer >= %{version}
Requires:	%{libname} >= %{version}
Requires:	php-ini >= %{version}
Requires:	php-ftp >= %{epoch}:%{version}
Requires:	php-yp >= %{epoch}:%{version}
Requires:	php-pcre >= %{epoch}:%{version}
Requires:	php-gettext >= %{epoch}:%{version}
Requires:	php-posix >= %{epoch}:%{version}
Requires:	php-ctype >= %{epoch}:%{version}
Requires:	php-session >= %{epoch}:%{version}
Requires:	php-sysvsem >= %{epoch}:%{version}
Requires:	php-sysvshm >= %{epoch}:%{version}
Requires:	php-tokenizer >= %{version}
Provides:	php php3 php4 php432 php430
Obsoletes:	php php3 php4 php432 php430
Epoch:		%{epoch}

%description	cgi
PHP5 is an HTML-embeddable scripting language. PHP5 offers built-in
database integration for several commercial and non-commercial
database management systems, so writing a database-enabled script
with PHP5 is fairly simple.  The most common use of PHP5 coding is
probably as a replacement for CGI scripts.

This package contains a standalone (CGI) version of php. You must
also install libphp5_common. If you need apache module support, you
also need to install the apache-mod_php package.

%package	fcgi
Summary:	PHP5 CGI interface with FastCGI support
Group:		Development/Other
Requires(post): %{libname} >= %{version}
Requires(post): php-ini >= %{version}
Requires(post): php-ftp >= %{epoch}:%{version}
Requires(post): php-yp >= %{epoch}:%{version}
Requires(post): php-pcre >= %{epoch}:%{version}
Requires(post): php-gettext >= %{epoch}:%{version}
Requires(post): php-posix >= %{epoch}:%{version}
Requires(post): php-ctype >= %{epoch}:%{version}
Requires(post): php-session >= %{epoch}:%{version}
Requires(post): php-sysvsem >= %{epoch}:%{version}
Requires(post): php-sysvshm >= %{epoch}:%{version}
Requires(post): php-tokenizer >= %{version}
Requires(preun): %{libname} >= %{version}
Requires(preun): php-ini >= %{version}
Requires(preun): php-ftp >= %{epoch}:%{version}
Requires(preun): php-yp >= %{epoch}:%{version}
Requires(preun): php-pcre >= %{epoch}:%{version}
Requires(preun): php-gettext >= %{epoch}:%{version}
Requires(preun): php-posix >= %{epoch}:%{version}
Requires(preun): php-ctype >= %{epoch}:%{version}
Requires(preun): php-session >= %{epoch}:%{version}
Requires(preun): php-sysvsem >= %{epoch}:%{version}
Requires(preun): php-sysvshm >= %{epoch}:%{version}
Requires(preun): php-tokenizer >= %{version}
Requires:	%{libname} >= %{version}
Requires:	php-ini >= %{version}
Requires:	php-ftp >= %{epoch}:%{version}
Requires:	php-yp >= %{epoch}:%{version}
Requires:	php-pcre >= %{epoch}:%{version}
Requires:	php-gettext >= %{epoch}:%{version}
Requires:	php-posix >= %{epoch}:%{version}
Requires:	php-ctype >= %{epoch}:%{version}
Requires:	php-session >= %{epoch}:%{version}
Requires:	php-sysvsem >= %{epoch}:%{version}
Requires:	php-sysvshm >= %{epoch}:%{version}
Requires:	php-tokenizer >= %{version}
Provides:	php php3 php4 php432 php430
Obsoletes:	php php3 php4 php432 php430
Epoch:		%{epoch}

%description	fcgi
PHP5 is an HTML-embeddable scripting language. PHP5 offers built-in
database integration for several commercial and non-commercial
database management systems, so writing a database-enabled script
with PHP5 is fairly simple.  The most common use of PHP5 coding is
probably as a replacement for CGI scripts.

This package contains a standalone (CGI) version of php with FastCGI
support. You must also install libphp5_common. If you need apache
module support, you also need to install the apache-mod_php
package.

%package -n	%{libname}
Summary:	Shared library for PHP5
Group:		Development/Other
Provides:	php-zlib php-openssl
Provides:	libphp_common libphp_common430 %{old_libname} php-common
Obsoletes:	libphp_common libphp_common430 %{old_libname} php-common
Epoch:		%{epoch}

%description -n	%{libname}
This package provides the common files to run with different
implementations of PHP5. You need this package if you install the
php standalone package or a webserver with php support (ie: 
apache-mod_php).

%package	devel
Summary:	Development package for PHP5
Group:		Development/C
Requires(post): %{libname} >= %{version}
Requires(preun): %{libname} >= %{version}
Requires:	%{libname} >= %{version}
Requires:	autoconf2.5, automake1.7, bison, byacc, flex, libtool, libxml2-devel, libxslt-devel
Requires:	openssl >= 0.9.7, openssl-devel >= 0.9.7, pcre-devel >= 5.0, pam-devel, dos2unix, chrpath
Provides:	php432-devel
Obsoletes:	php432-devel
Epoch:		%{epoch}

%description	devel
The php-devel package lets you compile dynamic extensions to
PHP5. Included here is the source for the php extensions. Instead
of recompiling the whole php binary to add support for, say,
oracle, install this package and use the new self-contained
extensions support. For more information, read the file
SELF-CONTAINED-EXTENSIONS.

%prep

%setup -q -n php-%{version}

%patch0 -p1 -b .init.droplet
%patch1 -p1 -b .shared.droplet
%patch2 -p0 -b .imap.droplet
%patch3 -p1 -b .64bit.droplet
%patch4 -p1 -b .lib64.droplet
%patch5 -p1 -b .fix-pear.droplet
%patch6 -p0 -b .libtool.droplet
%patch7 -p1 -b .no_egg.droplet
%patch8 -p1 -b .phpize.droplet
%patch9 -p0 -b .remove_bogus_iconv_deps.droplet

# for kolab2
%patch11 -p1 -b .imap-annotation
%patch12 -p1 -b .imap-status-current

#####################################################################
# Stolen from PLD
%patch20 -p1 -b .mail.droplet
%patch21 -p1 -b .sybase-fix.droplet
%patch22 -p1 -b .wddx-fix.droplet

#####################################################################
# Stolen from fedora
%patch100 -p1 -b .config.droplet
%patch101 -p1 -b .cxx.droplet
%patch102 -p1 -b .install.droplet
%patch103 -p1 -b .norpath.droplet
%patch104 -p1 -b .libtool15.droplet
%patch105 -p1 -b .umask.droplet
%patch106 -p1 -b .gdnspace.droplet
%patch107 -p1 -b .round.droplet
%patch108 -p1 -b .gdheaders.droplet
%patch109 -p1 -b .gcc4.droplet
%patch110 -p1 -b .streamcopy.droplet
%patch111 -p1 -b .odbc.droplet
%patch112 -p1 -b .shutdown.droplet
%patch113 -p1 -b .bug32282.droplet
%patch114 -p1 -b .xmldom.droplet
%patch115 -p1 -b .dlopen.droplet
#
%patch120 -p1 -b .tests-dashn
%patch121 -p1 -b .tests-wddx
%patch122 -p1 -b .tests-sunfunc

# make the tests worky
%patch200 -p1 -b .bug-22414.droplet
%patch201 -p0 -b .bug29119.droplet

%if %{build_hardened}
%patch300 -p1 -b .hardened
%endif

# Change perms otherwise rpm would get fooled while finding requires
find -name "*.inc" | xargs chmod 644
find -name "*.php*" | xargs chmod 644

mkdir -p php-devel/extensions
mkdir -p php-devel/sapi
mkdir -p php-devel/pear

# Install test files in php-devel
cp -a pear/tests php-devel/pear/
mkdir -p php-devel/pear/Console
cp -a pear/Console/tests php-devel/pear/Console
cp -a tests php-devel

cp -dpR ext/* php-devel/extensions/
rm -f php-devel/extensions/informix/stub.c
rm -f php-devel/extensions/standard/.deps
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

# likewise with these:
find php-devel -name "*.dsp" | xargs rm -f
find php-devel -name "*.mak" | xargs rm -f
find php-devel -name "*.w32" | xargs rm
find php-devel -name "*.droplet" | xargs rm -f

# strip away annoying ^M
find -type f | \
    grep -v "\.gif" | \
    grep -v "\.gz" | \
    grep -v "\.jpeg" | \
    grep -v "\.jpg" | \
    grep -v "\.png" | \
    grep -v "\.psd" | \
    grep -v "\.tgz" | \
    grep -v "\.ttf" | \
    grep -v "\.zip" | \
    xargs dos2unix -U

cp -dpR sapi/* php-devel/sapi/ 
rm -f php-devel/sapi/thttpd/stub.c
rm -f php-devel/sapi/cgi/php.sym
rm -f php-devel/sapi/fastcgi/php.sym
rm -f php-devel/sapi/pi3web/php.sym

bzcat %{SOURCE3} > php-devel/PHP_FAQ.php

cat > php-devel/buildext <<EOF
#!/bin/bash
gcc -Wall -fPIC -shared %{optflags} \\
    -I. \`%{_bindir}/php-config --includes\` \\
    -I%{_includedir}/libxml2 \\
    -I%{_includedir}/freetype \\
    -I%{_includedir}/openssl \\
    -I%{_usrsrc}/php-devel/ext \\
    -I%{_includedir}/\$1 \\
    \$4 \$2 -o \$1.so \$3 -lc
EOF

chmod 755 php-devel/buildext

%build

# this _has_ to be executed!
#./buildconf --force
export WANT_AUTOCONF_2_5=1
rm -f configure; aclocal-1.7 && autoconf --force && autoheader

%serverbuild

export oldstyleextdir=yes
export EXTENSION_DIR="%{_libdir}/php/extensions"
export PROG_SENDMAIL="%{_sbindir}/sendmail"
export CFLAGS="%{optflags} -fPIC -L%{_libdir}"

# Configure php5
for i in fcgi cgi apxs cli; do
%configure2_5x \
    `[ $i = apxs ] && echo --with-apxs2=%{_sbindir}/apxs` \
    `[ $i = cgi ] && echo --enable-discard-path --disable-cli --enable-force-cgi-redirect` \
    `[ $i = cli ] && echo --disable-cgi --enable-cli %{?build_test:--with-pcre-regex=shared,%{_prefix}}` \
    `[ $i = fcgi ] && echo --enable-fastcgi --with-fastcgi=%{_prefix} --disable-cli --enable-force-cgi-redirect` \
    --cache-file=config.cache \
    --enable-shared=yes \
    --enable-static=no \
    --disable-all \
    --with-config-file-path=%{_sysconfdir} \
    --with-config-file-scan-dir=%{_sysconfdir}/php.d \
    --disable-debug --enable-pic --disable-rpath \
    --enable-inline-optimization \
    --with-exec-dir=%{_bindir} \
    --with-ttf --with-freetype-dir=%{_prefix} --with-zlib=%{_prefix} \
    --with-png-dir=%{_prefix} \
    --with-regex=php \
    --enable-magic-quotes \
    --enable-safe-mode \
    --with-zlib=%{_prefix} --with-zlib-dir=%{_prefix} \
    --with-openssl=%{_prefix} \
    --enable-libxml --with-libxml-dir=%{_prefix} \
    --enable-spl \
    --enable-track-vars \
    --enable-trans-sid \
    --enable-memory-limit \
    --with-versioning \
    --with-mod_charset \
    --without-pear

cp -f Makefile Makefile.$i
# left for debugging purposes
cp -f main/php_config.h php_config.h.$i
done

# remove all confusion...
perl -pi -e "s|^#define CONFIGURE_COMMAND .*|#define CONFIGURE_COMMAND \"This is irrelevant, look inside the %{_docdir}/libphp5_common%{major}-%{version}/configure_command file. urpmi is your friend, use it to install extensions not shown below.\"|g" main/build-defs.h
cp config.nice configure_command; chmod 644 configure_command

# make the shared lib
%make -f Makefile.apxs

# build the cli version
%make -f Makefile.cli

# this is needed by make test below
%{?build_test:mkdir -p modules-cli; cp modules/pcre.* modules-cli/}

# fix install paths, avoid evil rpaths
%{__perl} -pi -e "s|^libdir=.*|libdir='%{_libdir}'|" libphp5_common.la
%{__perl} -pi -e "s|^libdir=.*|libdir='%{_libdir}/apache'|" libphp5.la
%{__perl} -pi -e 's|^(relink_command=.* -rpath )[^ ]*/libs |$1%{_libdir}/apache |' libphp5.la

# for fcgi: -DDISCARD_PATH=0 -DENABLE_PATHINFO_CHECK=1 -DFORCE_CGI_REDIRECT=0
# -DHAVE_FILENO_PROTO=1 -DHAVE_FPOS=1 -DHAVE_LIBNSL=1(die) -DHAVE_SYS_PARAM_H=1
# -DPHP_FASTCGI=1 -DPHP_FCGI_STATIC=1 -DPHP_WRITE_STDOUT=1
make sapi/cgi/php -f Makefile.fcgi \
    CFLAGS_CLEAN="%{optflags} -DDISCARD_PATH=0 -DENABLE_PATHINFO_CHECK=1 -DFORCE_CGI_REDIRECT=0 -DHAVE_FILENO_PROTO=1 -DHAVE_FPOS=1 -DHAVE_LIBNSL=1 -DHAVE_SYS_PARAM_H=1 -DPHP_FASTCGI=1 -DPHP_FCGI_STATIC=1 -DPHP_WRITE_STDOUT=1"
cp -r sapi/cgi sapi/fcgi
rm -rf sapi/cgi/.libs sapi/cgi/*.lo

# notes:
# -DENABLE_CHROOT_FUNC=1 (cgi,fcgi) is used in ext/standard/dir.c (libphp5_common)
# -DPHP_WRITE_STDOUT is used also for cli, but not set by its config.m4
make sapi/cgi/php -f Makefile.cgi \
    CFLAGS_CLEAN="%{optflags} -DDISCARD_PATH=1 -DENABLE_PATHINFO_CHECK=1 -DFORCE_CGI_REDIRECT=0 -DPHP_WRITE_STDOUT=1"

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_libdir}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_libdir}/php/extensions
install -d %{buildroot}%{_usrsrc}/php-devel
install -d %{buildroot}%{_mandir}/man1

make -f Makefile.apxs install \
	INSTALL_ROOT=%{buildroot} \
	INSTALL_IT="\$(LIBTOOL) --mode=install install libphp5_common.la %{buildroot}%{_libdir}/ ; \$(LIBTOOL) --mode=install install sapi/cgi/php %{buildroot}%{_bindir}/php-cgi ; \$(LIBTOOL) --mode=install install sapi/fcgi/php %{buildroot}%{_bindir}/php-fcgi" \
	INSTALL_CLI="\$(LIBTOOL) --mode=install install sapi/cli/php %{buildroot}%{_bindir}/php"

%if %{build_test}
cp modules-cli/pcre.* modules/

# do a make test
#export LD_LIBRARY_PATH="."
export PHPRC="."
export NO_INTERACTION=1
export REPORT_EXIT_STATUS=1
export MALLOC_CHECK_=2
unset TZ LANG LC_ALL

# FIXME: The following tests (except 021) are known to fail on 64-bit
# architectures
#%ifarch x86_64
#disable_tests="	ext/session/tests/019.phpt \
#		ext/session/tests/021.phpt \
#		ext/standard/tests/math/pow.phpt \
#		ext/standard/tests/math/round.phpt \
#		ext/standard/tests/math/abs.phpt "
#%endif

# FAILING TESTS:
# http://bugs.php.net/bug.php?id=31672 (no fix yet)
# http://bugs.php.net/bug.php?id=22836 (no fix since 2003)
# http://bugs.php.net/bug.php?id=29992 (not a bug)
# http://bugs.php.net/bug.php?id=31213 (no fix yet)
# http://bugs.php.net/bug.php?id=22414 (claimed to be fixed in 2003, but seems not)
# http://bugs.php.net/bug.php?id=24403 (claimed to be fixed in 2003, but seems not)
# http://bugs.php.net/bug.php?id=31402 (no fix yet)
# tests/run-test/test008.phpt requires the Zend Optimizer

disable_tests="	ext/standard/tests/file/bug21131.phpt \
		ext/standard/tests/file/bug22414.phpt \
	        tests/func/008.phpt \
		tests/lang/038.phpt \
		tests/lang/bug24403.phpt \
		tests/basic/bug31672.phpt \
		Zend/tests/bug22836.phpt \
		ext/standard/tests/array/bug29992.phpt \
		ext/standard/tests/array/bug31213.phpt \
		ext/standard/tests/file/bug22414.phpt \
		ext/iconv/tests/bug16069.phpt \
		ext/standard/tests/serialize/bug31402.phpt \
		ext/standard/tests/array/array_sum.phpt \
		ext/standard/tests/image/getimagesize.phpt \
		ext/standard/tests/image/image_type_to_mime_type.phpt \
		ext/standard/tests/strings/bug29119.phpt \
		ext/standard/tests/strings/nl2br.phpt \
		ext/standard/tests/time/bug20382.phpt"

[[ -n "$disable_tests" ]] && \
for f in $disable_tests; do
  [[ -f "$f" ]] && mv $f $f.disabled
done

for f in `find .. -name \*.diff -type f -print`; do
    echo "TEST FAILURE: $f --"
    cat "$f"
    echo "-- $f result ends."
done

# OE: Tue May 27 2003
# Make a php.ini file for testing..., if not the tests 
# will fail. P30 and this one is the way to go...
# OE: Wed Aug 27 2003
# php will use the php.ini in current dir, so there's no
# need to hardcode the path in P30, the php folks claim 
# it's a feature not a bug..., oh well...

cat > php.ini <<EOF
; This file was used when running "make test" at rpm build time by
; %{packager} at `date`.
;
; You need to ask root set some reasonable values for shared memory
; for the session and semaphore tests to work, maybe something like
; this:
; echo "33554432" > /proc/sys/kernel/shmmax
; echo "4096" > /proc/sys/kernel/shmmni
; echo "300 90000 100 150" > /proc/sys/kernel/sem
;
; the following tests was disabled:
`for test in "${disable_tests}"; do echo "\; ${test}; done`

[PHP]

extension_dir=./modules

open_basedir=
safe_mode=0
output_buffering=0
output_handler=0
magic_quotes_runtime=
memory_limit=32M

extension=pcre.so

[pcre]

[Session]
; We use this as the saved files is cleaned by the rpm build 
; process. (but not with php-test, yet...)
session.save_path="."

EOF

# tuck away the php.ini file used for the test, it may come handy(?)
cp php.ini php-devel/

TEST_PHP_EXECUTABLE=sapi/cli/php sapi/cli/php -c ./php.ini run-tests.php
#make -f Makefile.cli test
%endif

cp -dpR php-devel/* %{buildroot}%{_usrsrc}/php-devel/
install -m644 run-tests*.php %{buildroot}%{_usrsrc}/php-devel/
install -m644 main/internal_functions.c %{buildroot}%{_usrsrc}/php-devel/

ln -snf extensions %{buildroot}%{_usrsrc}/php-devel/ext

# fix docs
cp Zend/LICENSE Zend/ZEND_LICENSE
cp README.SELF-CONTAINED-EXTENSIONS SELF-CONTAINED-EXTENSIONS
cp ext/openssl/README README.openssl
cp ext/spl/README README.spl
cp ext/libxml/CREDITS CREDITS.libxml
cp ext/zlib/CREDITS CREDITS.zlib

# cgi docs
cp sapi/cgi/CREDITS CREDITS.cgi

# fcgi docs
cp sapi/cgi/README.FastCGI README.fcgi
cp sapi/cgi/CREDITS CREDITS.fcgi

# cli docs
cp sapi/cli/CREDITS CREDITS.cli
cp sapi/cli/README README.cli
cp sapi/cli/TODO TODO.cli

# house cleaning
rm -f %{buildroot}%{_bindir}/pear
rm -f %{buildroot}%{_libdir}/*.a

# make libtool a (dangling) symlink
ln -snf ../../../bin/libtool %{buildroot}%{_libdir}/php/build/libtool

# fix one strange weirdo
%{__perl} -pi -e "s|^libdir=.*|libdir='%{_libdir}'|g" %{buildroot}%{_libdir}/*.la

# install the static apache module, may come handy later on
install -m0644 .libs/libphp5.a %{buildroot}%{_libdir}/mod_php5.a

%if %mdkversion >= 1020
%multiarch_includes %{buildroot}%{_includedir}/php/main/build-defs.h
%multiarch_includes %{buildroot}%{_includedir}/php/main/config.w32.h
%multiarch_includes %{buildroot}%{_includedir}/php/main/php_config.h
%multiarch_includes %{buildroot}%{_includedir}/php/ext/gd/libgd/gd.h
%multiarch_includes %{buildroot}%{_includedir}/php/ext/gd/libgd/gd_io.h
%endif

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%pre cgi
update-alternatives --remove php %{_bindir}/php-cgi
update-alternatives --remove php %{_bindir}/php-fcgi
update-alternatives --remove php %{_bindir}/php-cli

%pre fcgi
update-alternatives --remove php %{_bindir}/php-cgi
update-alternatives --remove php %{_bindir}/php-fcgi
update-alternatives --remove php %{_bindir}/php-cli

%pre cli
update-alternatives --remove php %{_bindir}/php-cgi
update-alternatives --remove php %{_bindir}/php-fcgi
update-alternatives --remove php %{_bindir}/php-cli

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files -n %{libname}
%defattr(-,root,root)
%doc CREDITS INSTALL LICENSE NEWS Zend/ZEND_LICENSE
%doc php.ini-dist php.ini-recommended configure_command
%doc README.openssl README.spl CREDITS.libxml CREDITS.zlib
%attr(0755,root,root) %{_libdir}/libphp5_common.so.*

%files cli
%defattr(-,root,root)
%doc CREDITS.cli README.cli TODO.cli
%attr(0755,root,root) %{_bindir}/php
%attr(0644,root,root) %{_mandir}/man1/php.1*

%files cgi
%defattr(-,root,root)
%doc CREDITS.cgi
%attr(0755,root,root) %{_bindir}/php-cgi

%files fcgi
%defattr(-,root,root)
%doc CREDITS.fcgi README.fcgi
%attr(0755,root,root) %{_bindir}/php-fcgi

%files devel
%defattr(-,root,root)
%doc SELF-CONTAINED-EXTENSIONS CODING_STANDARDS README.* TODO EXTENSIONS
%doc Zend/ZEND_*
%attr(0755,root,root) %{_bindir}/php-config
%attr(0755,root,root) %{_bindir}/phpextdist
%attr(0755,root,root) %{_bindir}/phpize
%attr(0755,root,root) %{_libdir}/libphp5_common.so
%attr(0755,root,root) %{_libdir}/libphp5_common.la
%attr(0644,root,root) %{_libdir}/mod_php5.a
%{_libdir}/php/build
%{_usrsrc}/php-devel
%if %mdkversion >= 1020
%multiarch %{multiarch_includedir}/php/main/build-defs.h
%multiarch %{multiarch_includedir}/php/main/config.w32.h
%multiarch %{multiarch_includedir}/php/main/php_config.h
%multiarch %{multiarch_includedir}/php/ext/gd/libgd/gd.h
%multiarch %{multiarch_includedir}/php/ext/gd/libgd/gd_io.h
%endif
%{_includedir}/php

%changelog
* Tue Sep 06 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-9mdk
- hardening-patch-5.0.4-0.4.1

* Tue Aug 09 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-8mdk
- rule out pear auto deps

* Fri Jul 29 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-7mdk
- added work arounds for rpm bugs, "Requires(foo,bar)" don't work

* Mon Jul 11 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-6mdk
- hardening-patch-5.0.4-0.3.2
- reworked the --with/--without magic

* Wed Jul 06 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-5mdk
- added rediffed P11 and P12 from the openpkg kolab2 packages

* Sat Jun 04 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-4mdk
- fix deps (typo)

* Sat Jun 04 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-3mdk
- fix deps

* Fri Jun 03 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-2mdk
- rebuild

* Thu May 26 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-1mdk
- rename the package (php5/php)
- sync with fedora
- use better anti ^M stripper
- use new rpm-4.4.x pre,post magic
- reworked the test suite run, many tests fails. some are fixed
  in cvs, and some are not and simply fails.

* Sat Apr 16 2005 Oden Eriksson <oeriksson@mandriva.com> 5.0.4-1mdk
- 5.0.4
- rediff P4,P6,P8,P9.P100
- drop P59,P60,P60 as they are implemented upstream

* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-8mdk
- use the %%mkrel macro

* Thu Feb 17 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-7mdk
- it wasn't possible to build it --with hardened, fixed

* Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-6mdk
- fix description
- strip away annoying ^M, better approach

* Sat Feb 12 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-5mdk
- hardened-php-0.2.6 is disabled as it totally breaks commercial 
  applications like Zend(tm) stuff... :(
- added P57-P67 from fedora
- fix a *lot* of wrong-script-end-of-line-encoding rpmlint errors...

* Mon Jan 31 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-4mdk
- fix deps and conditional %%multiarch

* Fri Jan 14 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-3mdk
- hardened-php-0.2.6

* Thu Dec 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-2mdk
- fix deps for the devel package
- drop S5, it's in the NEWS file anyhow

* Thu Dec 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.3-1mdk
- 5.0.3
- new hardened-php-0.2.4 patch (P11)
- rediffed P4
- drop P55
- new P56

* Thu Dec 09 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.2-3mdk
- misc spec file fixes
- make and run the tests
- more lib64 fixes (P4,P55)

* Mon Nov 08 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.2-2mdk
- added P11 (from www.hardened-php.net)

* Fri Sep 24 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.2-1mdk
- 5.0.2

* Sat Aug 14 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.1-1mdk
- 5.0.1

* Sun Jul 18 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 5.0.0-1mdk
- 5.0.0
- used pld magic to make the shared lib and the php binaries
- rediffed and added some patches
- used parts from my private spec files
- get rid of the php-devel/PHP_BUILD file
- broke out ftp, yp, pcre, gettext, posix, ctype, sysvsem, sysvshm
- drop the "extensions hack", use another way in the info
- had to enable libxml in order to build some xml related modules

* Wed Jul 14 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.8-1mdk
- security fixes release (CAN-2004-0594, CAN-2004-0595)

* Mon Jul 12 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.7-5mdk
- remove redundant provides

* Fri Jun 25 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.7-4mdk
- sync with fedora (P57,P58) (4.3.7-3)

* Fri Jun 11 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.7-3mdk
- fix deps

* Wed Jun 09 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.7-2mdk
- added P11 (fixes one minor annoyance while running the tests)
- added P56 (fedora)

* Fri Jun 04 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.7-1mdk
- 4.3.7

* Wed May 26 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.6-5mdk
- fixed P8 and P10
- added P11 (fixes from 4.3.7RC1)
- updated S5

* Fri May 21 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.6-4mdk
- fix P5, i messed it up...
- nuke some patch -b droplets because it pollutes the php-devel package

* Fri May 21 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.6-3mdk
- rediffed P5, P21, P22
- added P23 - P29 from PLD, slightly adjusted

* Thu May 20 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.6-2mdk
- added P21 - P25 from fedora
- use the %%configure2_5x macro
- added P10 to make phpize work
- fix deps
- move scandir to /etc/php.d
- misc spec file fixes

* Tue May 04 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 4.3.6-1mdk
- rediffed P1 and P20
- drop P40, it's included

* Sun Mar 21 2004 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.4-4mdk
- fix PHP bug #25547
- fix bug22414.phpt

* Tue Feb 24 2004  Pascal Terjan <pterjan@mandrake.org> 4.3.4-3mdk
- add a %%{epoch} instead and use it in requires
- disable debug

* Tue Feb 24 2004 Pascal Terjan <pterjan@mandrake.org> 4.3.4-2mdk
- add Provides without the Epoch on the main lib to make php packages 
  installable using recent rpm

* Tue Nov 04 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.4-1mdk
- 4.3.4

* Wed Oct 29 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.4-0.1mdk
- 4.3.4RC3
- rediff P1, P4 & P5
- had to use --without-pear
- use _requires_exceptions magic to filter out some weirdness

* Wed Aug 27 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.3-2mdk
- php-devel should require openssl-devel (buchan?)
- drop php-killrpath (S1), use chrpath instead
- do not own certain directories (php-devel)
- fixed the make test stuff again
- fix the configure string as for example sysconfdir was unset (wrong)

* Mon Aug 25 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.3-1mdk
- 4.3.3
- rediffed P5 & P30
- fixed the EXTERNAL_MANDRAKE_MODULES array
- new S5

* Wed Aug 20 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.3.2-10mdk
- Fix lib64 patch for phpize
- Provides: libphp_common{,-devel} more convenient for compares

* Thu Aug 14 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.3.2-9mdk
- Dependencies clean-ups, lib64 & libtool fixes

* Mon Jul 21 2003 David BAUDENS <baudens@mandrakesoft.com> 4.3.2-8mdk
- Rebuild to fix Bad signature

* Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-7mdk
- rebuild

* Thu Jun 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-6mdk
- fix a faulty symlink

* Wed Jun 04 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-5mdk
- really apply P20
- put session.save_path in current dir so that it will be cleaned in %%clean

* Wed Jun 04 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-4mdk
- require openssl to have the make test work as pointed out 
  by Stefan van der Eijk 
- added P20 from rh rawhide
- added php-cli man page
- misc spec file fixes

* Mon Jun 02 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-3mdk
- third try..., php430 was installed and linked against..., duh!
- added adodb & mmcache to the extensions array
- added apd cybercash, cybermut, cyrus, mono, mqseries, netools,
  python spplus & spread to the extensions array (possible upcoming
  stuff)

* Sat May 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-2mdk
- second try...

* Sat May 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-1mdk
- change libversion to 432 since 430 is not binary compatible with 432
- fix P1
- increase epoch
- Obsoletes libphp_common430-devel
- Provides libphp_common430-devel = 4.3.0-%{release}

* Fri May 30 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-1mdk
- 4.3.2
- added S4
- use epoch as pointed out by warly (thanks man!).
- misc spec file fixes

* Fri May 30 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-0.3mdk
- revert back again... someone needs to delete the offending packages,
  otherwise we're stucked using 14mdk, 15mdk, etc.

* Fri May 30 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-0.2mdk
- have to stick with the old versioning for now...

* Fri May 30 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.2-0.1mdk
- 4.3.2RC4
- drop P7, P8 & P11, it's incuded upstream
- new P1 & P2
- new P14 from PLD
- deactivated P20 (it's incuded upstream?, J-M?)
- added P30 + spec file magic to make the tests work
- misc spec file fixes

* Wed May 07 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.1-13mdk
- really require libopenssl0.9.7 and not libopenssl0 as pointed
  out by J.A. Magallon

* Mon May 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.1-12mdk
- require libopenssl0.9.7 and not libopenssl0

* Thu Mar 06  2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.1-11mdk
- fix showstopper bugs in streams, openssl, file and passthru functions
- add make test **** 270 tests total! ****
- add /usr/bin/php-test to the -devel package. This way, QA only has to run
  a single command to see if every module works .
- Bug #22414 (passthru command not working) VERY IMPORTANT ONE!
- Bug #21131 (fopen with 'a+' and rewind() doesn't work)
- Bug #21713 (include remote files leaks temporary files + descriptors)
- Bug #21185 (move_uploaded_file() does not ignore open_basedir)
- Bug #22362 (fwrite(), fread() and fseek() produce unexpected results)
- Bug #21986 (openssl test failure).
- Bug #22383 (getcvs not handling quoting correctly)

* Mon Mar 03  2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.1-10mdk
- add Obsoletes: php-devel so we don't remove that package when doing an
  upgrade.

* Mon Feb 17 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.1-9mdk
- 4.3.1 security release (within a few minutes of the announce!)
- get rid of the update-alternative scheme and use /usr/bin/php for the
  command line interface, as is now the convention. It will maybe break
  a couple of setups, but with all the fuss with this security release, 
  it's the right thing to do.
- keep -9mdk so we don't have to change libversion and recompile everything

* Thu Feb 13 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.0-8mdk
- use %%mklibname
- add BuildConflicts %libname since it tries to link with a previous version
  of itself.

* Fri Jan 17 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.0-7mdk
- re-add ctype, since it's enabled by default since php 4.2.0, does not use
  any external library besides glibc,  and several scripts depend on these 
  functions.

* Wed Jan 15 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.0-6mdk
- merged unofficial rpm releases up to 6mdk (my packages)
- rebuilt against openssl-0.9.7
- added P9, P10 & P11 (packager credits, no eastern egg and jmdaults
  scandir patch)
- added apache2 fix from CVS (P8) (php bugs: #21045 & #17098)
- added ctype, overload, imagick, pam_auth smbauth, tokenizer and rrdtool
  to the EXTENSIONS HACK, this prevents for example ctype, overload and
  tokenizer to be built in. 
- enable build with debugging code, used ideas from my apache2 package
- fix the buildext script
- remove aspell from spec file (it's gone)
- ignore all MS stuff (don't ship it, duh!)
- added P7 (db4 support from CVS) Yihaa!
- misc spec file fixes

* Tue Jan 07 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.0-2mdk
- Put all extensions in the EXTERNAL_MANDRAKE_MODULES hack.
- Add Provides: ADVXpackage, all ADVX package will have this tag, 
  so we can easily do a rpm --whatprovides ADVXpackage to find out
  what ADVX packages a user has installed on his system. 

* Fri Jan 03 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.3.0-1mdk
- Shiny new version, remade all patches
- Add command-line interface in package php-cli and renamed the main
  package as php-cgi
- Use update-alternatives to determine whether php-cgi or php-cli will be
  called as the main php binary.
- Add openssl to be able to call fopen with https://
- Make rpmlint totally happy
- rename php-common to libphp_common430 
- rename php-devel to php430-devel
- move php.ini to a php-ini RPM so we can modify the ini files more easily,
  specially with the new scan-dir approach and the new php-cli.ini file.
  (Oden, have fun ;-)
- put a new PHP_BUILD file with rpm global defines, a bit like ADVX-build,
  since php -v doesn't give the version number alone, but puts it within a
  couple of lines of misc. information.
- put php-killrpath into the -devel package so we can use it for the extensions
  as well.
- fix Requires and BuildRequires
- remove pear, will be in a new package, built directly from pear.php.net.
  This will enable us not to ship XML as part of the main package
- pick up internal_functions.c, since this is needed to build mod_php and
  apache2-mod_php, and symlink extensions/ to ext/ as well, because of some
  includes of internal_functions.c

* Wed Nov 27 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.2.3-3mdk
- Patch4: Temptative 64-bit fixes
- Patch5: Teach it wonderful life of lib64
- Ship with pearize and phptar, don't know what's that maintainer will
  please clear this out

* Tue Oct 29 2002 Stefan van der Eijk <stefan@eijk.nu> 4.2.3-2mdk
- BuildRequires: zlib-devel

* Sat Sep  7 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.2.3-1mdk
- 4.2.3 maintenance release
- remove patches 18 and 22, re-made patches 13 and 15.

* Thu Aug 22 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.2.2-2mdk
- Put back gettext support (a lot of people complained about that)
- Fix include_path in php.ini so the directories have a trailing slash 
  (to be able to do include "a.php" instead of include "/usr/lib/php/a.php", 
  as Alexander Skwar pointed out)
- clean up spec a bit

* Thu Aug 22 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.2.2-1mdk
- PHP 4.2.2 security update
- Update php.ini
- SSL is now an external module, since it's marked as experimental, and its
  API may change in future releases without notice. 
- Put back these modules into the main PHP lib (see note at top of the spec):
  ftp, posix, session, sysvsem, sysvshm, yp, zlib, pcre
- Remove all "--disable" entries with phpinfo, and correct wording for
  availability of external modules 

* Wed Jul 03 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-8mdk
- updated by Alexander Skwar <ASkwar@DigitalProjects.com>
	- Fix PEAR
	- Move PEAR to %{peardir}
	- Move PEAR files from devel to pear package
	- Make php.ini readable on 80 col displays
	- Add %{peardir} to include_path in ini

* Fri May 31 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-7mdk
- add xmlrpc.so in php.ini.

* Thu May 30 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-6mdk
- add tclink.so in php.ini.

* Tue May 28 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-5mdk
- php-pear requires php-xmlrpc.

* Mon May 27 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-4mdk
- fix provides in php-devel

* Sun May 26 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-3mdk
- updated by Oden Eriksson <oden.eriksson@kvikkjokk.net>
	- misc spec file fixes
	- added the %{phpdir}/*.php files that so mysteriousely disappeared,
	  those belong to the pear package (?)
	- broke out the xmlrpc stuff as an external module php-xmlrpc, added that
	  to php.ini
	- removed "-lpthread" (--enable-experimental-zts broke apache1); check:
	  http://www.mandrake.com/en/archives/cooker/2002-05/msg01099.php

* Wed May 22 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-2mdk
- add BuildRequires&Requires libxmlrpc (for the temporary --with-xmlrpc)

* Tue May 21 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.1-1mdk
- keep xmlrpc changes.
- make a separate php-pear package.
- updated by Oden Eriksson <oden.eriksson@kvikkjokk.net>:
	- new version
	- added P10-P22 (stolen from PLD)
	- fix php.ini
	- misc spec file fixes

* Thu May 16 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.0-2mdk
- build against latest openssl.
- updated by Oden Eriksson <oden.eriksson@kvikkjokk.net>:
	- misc spec file fixes
	- rebuilt with latest system compiler (gcc3.1)
	- force mail() inclusion
	- added more extensions to php.ini

* Mon Apr 29 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.2.0-1mdk
- updated by Oden Eriksson <oden.eriksson@kvikkjokk.net> :
	- new Source6
	- made it possible to have most common extensions as modules, and a more
	  clever way to do it and expose it (Patch3 + spec file hack).
	- added requires openssl (forgot about that :))
	- new version
	- adjusted Patch1
	- misc spec file fixes
	- added "--with-openssl" to be able to build the new imap and snmp extensions.

* Mon Mar 02 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.1.2-1mdk
- 4.1.2 is the same as 4.1.1+patch, but the Zend optimizer will not link
  properly if the release number is not the same...
- Removec expat because of segfaults when different versions of expat are
  linked statically in different pieces of apache.

* Wed Feb 27 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.1.1-4mdk
- File uploads security fix.

* Tue Jan 15 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.1.1-3mdk
- Remove --with-mm because of a bug with libmm & /tmp/session_mm.sem (Thanks to Thor).

* Mon Jan 07 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.1.1-2mdk
- Added smtpdaemon in BuildRequires (needed to include mail()).

* Mon Jan 07 2002 Christian Belisle <cbelisle@mandrakesoft.com> 4.1.1-1mdk
- 4.1.1 (bug fixes)

* Wed Dec 12 2001 Christian Belisle <cbelisle@mandrakesoft.com> 4.1.0-2mdk
- Patch2 to be able to compile php-imap.

* Tue Dec 11 2001 Christian Belisle <cbelisle@mandrakesoft.com> 4.1.0-1mdk
- 4.1.0.

* Sat Sep 09 2001 David BAUDENS <baudens@mandrakesoft.com> 4.0.6-5mdk
- Clean after build
- Remove french locale from Summary
- Fix Provides and Requires
- Bzip2 patches
- Use %%make
- Add missing file

* Tue Aug 28 2001 Christian Belisle <cbelisle@mandrakesoft.com> 4.0.6-4mdk
- s/libgdbm1/libgdbm2 (Thanx to Digital Wokan).
- Fixed some rpmlint warnings and errors.

* Tue Jul 24 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 4.0.6-3mdk
- removed Obsoletes: php-devel for devel subpackage

* Mon Jul  9 2001 Vincent Danen <vdanen@mandrakesoft.com> 4.0.6-2mdk
- removed Obsoletes: php-mysql

* Wed Jul  4 2001 Vincent Danen <vdanen@mandrakesoft.com> 4.0.6-1mdk
- 4.0.6
- remove -DHAVE_CONFIG_H from buildext script so that modules build
- fix PEAR installation by specifying peardir explicitly
- s/Copyright/License/

* Thu Apr 12 2001 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.4pl1-6mdk
- recreate php.ini in case someone uses rpm -Uvh *, since rpm handles
  config files in a weird way when movig the config file to a different
  sub-package. *Very important* since it can render php useless when
  updating from the 7.2 updates from 8.0

* Mon Apr  9 2001 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.4pl1-5mdk
- use serverbuild macro

* Tue Mar 27 2001 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.4pl1-4mdk
- completely remade spec file
- renamed library to fit the libtool philosophy
- created libphp package, the php package is now only the standalone. People
  shouldn't have to install the standalone package if they don't want to,
  and rpmlint doesn't want a binary and a library in same package
- put manual and all sub-modules into their own package. It will be easier
  this way, since we can, say, recompile only php-mysql without touching the
  other modules
- changed builddefs so people see --external-modules=mysql,pgsql,etc...
  instead of --without-mysql which fooled people in thinking they had to
  recompile when they only had to install the right module
- removed RPATH since it could be a security problem
- fix upgrade scripts for good

* Mon Jan 22 2001 Vincent Danen <vdanen@mandrakesoft.com> 4.0.4pl1-3mdk
- fix upgrade scripts

* Sun Jan 21 2001 Vincent Danen <vdanen@mandrakesoft.com> 4.0.4pl1-2mdk
- rebuild against new MySQL for php-mysql

* Thu Jan 18 2001 Vincent Danen <vdanen@mandrakesoft.com> 4.0.4pl1-1mdk
- 4.0.4pl1; security fixes for PHP directive problems

* Thu Dec 21 2000 Vincent Danen <vdanen@mandrakesoft.com> 4.0.4-1mdk
- 4.0.4

* Tue Dec 12 2000 Vincent Saugey <vince@mandrakesoft.com> 4.0.3pl1-3mdk
- declare top_srcdir at build step 

* Sat Nov 11 2000 Daouda Lo <daouda@mandrakesoft.com> 4.0.3pl1-2mdk
- correct php-pgsql preuninstall typo (thanx Florent Guillaume)

* Sun Oct 22 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.3pl1-1mdk
- Bugfix + Security release

* Wed Sep 27 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.2-4mdk
- Fixed requires
- Rebuilt for new Apache
- Removed security patch SRADV00001 because it was causing segfaults with
  POST and multipart/form-data
- Removed CVS junk files in php-manual

* Fri Sep  8 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.2-3mdk
- Added security patch from Vincent Danen for (SRADV00001) Arbitrary file
  disclosure through PHP file upload
- Patched aclocal.m4 and acinclude.m4... Looks like every release they
  break something!
- imap was also broken. Added -lpam to the flags.
- compiled php with -lpthread to fix damn segfaults
- new MySQL release: compile with lmysqlclient_r
- removed conflict with midgard (i heard that both can coexist now)
- mysql: Tested phpMyAdmin - success! Tested also standalone with
  code from: php-manual/function.mysql-pconnect.html
- gd: Tested generation of png graphics with truetype, both in standalone
  and apache module
- pgsql: tested with standalone binary and the example code contained in
  php-manual/ref.pgsql.html. After a "createuser apache" in postgres, also
  tested successfully the apache mode
- imap: tested imap_open and imap_close on port 110 with standalone
  and in apache module
- ldap: tested functions in php-manual/function.ldap-add.html
  with standalone and apache module
- split dba_gdbm_db2 and readline from the main package. The first, because we
  might support db3 eventually, and the lase because it required 3
  additional libraries, and was only for the standalone version.
- tested dba_gdbm_db2 with standalone and apache module with sample code from
  php-manual/ref.dba.html
- tested readline with standalone (it is interactive so it won't work with
  apache) with code from php-manual/ref.readline.html
- we now use a libphp4_shared: this saves space and permits to use
  any module with any server API
- put the SAPI files into the php-devel package so we can compile eventually
  thttpd, roxen, or the servlet API
- put php_standalone into the main php package to be able to use the new
  PEAR interface (like CPAN, but for PHP4)
- renamed all modules. They are now called php-something instead of
  mod_php-something. The reason is they can be used with either php-thttpd,
  php-standalone, php-servlet or under apache (where this module is still
  called mod_php, to be consistent with mod_perl, mod_jserv, etc..).

* Fri Sep  1 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.2-2mdk
- Heavy use of perl s///g to make it install at the right place

* Thu Aug 31 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.2-1mdk
- shiny new 4.0.2!!
- removed db3 support: it crashes the configure script, and besides, it's
  not in the distro (only in contribs). We use GDBM and DB2.

* Thu Aug 24 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.1pl2-6mdk
- created extensions package
- fixed mysql support

* Wed Aug  9 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.1pl2-5mdk
- link mysql.so with libmysqlclient.so

* Wed Aug  9 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.1pl2-4mdk
- Compile with latest MySQL
- Changed paths for FHS
- Macroize
- Fixed the BuildRequires (please, don't auto-regenerate)

* Mon Aug 07 2000 Frederic Lepied <flepied@mandrakesoft.com> 4.0.1pl2-3mdk
- automatically added BuildRequires

* Fri Jul 14 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.1pl2-2mdk
- added recode
- rebuilt for new EAPI
- use new AESctl script for %post
- Bonnne Fete la France! =)

* Sat Jul 08 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.1pl2-1mdk
- update to 4.0.1pl2 (lots of bug fixes)
- moved php binary to php-standalone package
- fixed module compilation (specially the again badly broken pgsql)

* Tue Jun 20 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 4.0.0-1mdk
- update to PHP 4.0.0
- compile in two pass so that the extensions work both with PHP and mod_php
- include development package. This will enable us to compile dynamic
  extensions outside the main PHP4 package. This will come handy for
  the Oracle, Sybase, swf, etc. modules.
- spent long nights figuring how to make GD+ttf+t1lib with PHP4
- many fixes to remain RH-compatible a bit, but to keep our improvements,
  and have a working config (RH handles extensions poorly and makes php
  require postgres, ldap and imap even if the use won't use it).
- change most of the Requires to Prereqs, because the post edits config files
- change most of the postuns to preuns in case php gets removed before subpkgs
- make subpackages require php = %{version}
- add Obsoletes: phpfi, because their content handler names are the same
- add standalone binary
- change license from "GPL" to "PHP"

* Wed Jun 14 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.0.16-6mdk
- last version, PHP4 is on the way (hurray! ;-)
- added -llber to the ldap package
- split gd library out of the main package so it doesn't require
  XFree-libs!
- removed Dadou's hack for i486 compilation. When cross-compiling,
  first build Apache, then install apache and apache-devel before
  you compile other apache modules. It will then compile for the
  same architecture that apache has been compiled with.

* Thu May 18 2000 David BAUDENS <baudens@mandrakesoft.com> 3.0.16-5mdk
- Better fix for i486

* Mon May 15 2000 David BAUDENS <baudens@mandrakesoft.com> 3.0.16-4mdk
- Fix build for i486
- Fix some typos
- Fix build as user

* Mon May 08 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.0.16-3mdk
- added Prereq so it doesn't complain about missing php3.ini
- rebuild with EAPI 2.6.4 (bugfixes)
- include /usr/bin/* 
- removed old manual from sources

* Thu Apr  6 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.0.16-2mdk
- rebuit with EAPI 2.6.3
- moved doc
- added -DHAVE_PQCMDTUPLES
- put ldap in separate module

* Thu Apr  6 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.0.16-1mdk
- 3.0.16 bugfix release

* Mon Apr  3 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.0.15-4mdk
- fixed group
- created MySQL as a separate module to fix dependancies

* Tue Feb 29 2000 Jean-Michel Dault <jmdault@netrevolution.com> 3.0.15-3mdk
- rebuild for EAPI 2.6.1
- updated manual

* Mon Feb 27 2000 Jean-Michel Dault <jmdault@netrevolution.com> 3.0.15-2mdk
- re-made gd+ttf patch. (again)

* Mon Feb 27 2000 Jean-Michel Dault <jmdault@netrevolution.com> 3.0.15-1mdk
- added many BuildRequires (this is a very complex package!)
- upgraded to 3.0.15 (security updates)
- updated mysql client to 3.22.32
- added patch suggested by jeff b <jeff@univrel.pr.uconn.edu> to
  decrease the TOKEN_BITS from 20 to 18. This allows large applications
  written in PHP to not bomb out due to running out of tokens.

* Tue Jan 18 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- upgraded to 3.0.14
- updated mysql client to 3.22.30
- added support for ftp

* Mon Jan  3 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- final cleanup for Mandrake 7

* Mon Jan 3 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- upgraded to 3.0.13
- fixed png support
- fixed reversed ttf fonts
- fixed imap and pgsql for good, made apache restart when installing these
  packages
- updated mysql client to 3.22.29

* Thu Dec 30 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- rebuilt for Oxygen and new mm-1.0.12 in Apache
- added ttf and t1lib, which are now part of Mandrake
- added gd support (png only, to enable gifs, you have to rebuild the rpm
  with the old library)

* Fri Sep 3 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- rebuilt for new mm-1.0.10 in Apache

* Thu Aug 26 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- added Conflicts line

* Fri Aug 19 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- Solaris adaptations

* Wed Aug 18 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- modified post scripts

* Sat Jul 31 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- upgraded to 3.0.12

* Wed Jul 21 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- upgraded to 3.0.11
- added RPM_OPT_FLAGS
- added fr locale
- "mandrakized" package again

* Mon Jun 14 1999 Preston Brown <pbrown@redhat.com>
- upgraded to 3.0.9
- fixed postgresql module and made separate package
- separated manual into separate documentation package

* Mon May 24 1999 Preston Brown <pbrown@redhat.com>
- upgraded to 3.0.8, which fixes problems with glibc 2.1.
- took some ideas grom Gomez's RPM.

* Tue May 04 1999 Preston Brown <pbrown@redhat.com>
- hacked in imap support in an ugly way until imap gets an official
  shared library implementation

* Fri Apr 16 1999 Preston Brown <pbrown@redhat.com>
- pick up php3.ini

* Wed Mar 24 1999 Preston Brown <pbrown@redhat.com>
- build against apache 1.3.6

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 2)

* Mon Mar 08 1999 Preston Brown <pbrown@redhat.com>
- upgraded to 3.0.7.

* Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
- Injected new description and group.

* Sun Feb 07 1999 Preston Brown <pbrown@redhat.com>
- upgrade to php 3.0.6, built against apache 1.3.4

* Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
- rebuild for apache 1.3.3

* Thu Oct 08 1998 Preston Brown <pbrown@redhat.com>
- updated to 3.0.5, fixes nasty bugs in 3.0.4.

* Sun Sep 27 1998 Cristian Gafton <gafton@redhat.com>
- updated to 3.0.4 and recompiled for apache 1.3.2

* Thu Sep 03 1998 Preston Brown <pbrown@redhat.com>
- improvements; builds with apache-devel package installed.

* Tue Sep 01 1998 Preston Brown <pbrown@redhat.com>
- Made initial cut for PHP3.