RPM spec file or zope-phpcgi-4.3.4-0ied01
%define zopedir %{_libdir}/zope
%define zopeproductsdir %{zopedir}/lib/python/Products
%define zopebindir %{zopedir}/bin
%define phpversion 4.3.4
%define phpini %{zopebindir}/php.ini
Summary: PHP CGI for using with Zope's PHParser/PHPGateway product
Name: zope-phpcgi
Version: %{phpversion}
Release: 0ied01
License: The PHP License
Group: Development/Languages
URL: http://www.php.net/
Source: http://www.php.net/distributions/php-%{version}.tar.bz2
Patch1: php-4.2.1-ldap-TSRM.patch
Patch2: php-4.3.1-config.patch
Patch3: php-4.3.4-lib64.patch
Patch4: php-4.2.2-cxx.patch
Patch5: php-4.3.3-aprinc.patch
Patch6: php-4.3.3-tests.patch
Patch7: php-4.3.2-libtool15.patch
Patch8: php-4.2.1-snmp.patch
# Fixes for extension modules
Patch20: php-4.2.2-apache2.patch
Patch21: php-4.3.1-odbc.patch
Patch22: php-4.3.2-db4.patch
Patch23: php-4.3.2-domxml.patch
# Functional changes
Patch30: php-4.3.1-dlopen.patch
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: sed, pkgconfig, libtool, autoconf, automake
BuildRequires: glibc-devel, pcre-devel, gmp-devel, pspell-devel
BuildRequires: gd-devel >= 1.8.4, libjpeg-devel, libpng-devel, freetype-devel
BuildRequires: openssl-devel, krb5-devel
BuildRequires: libxml2-devel
BuildRequires: expat-devel
BuildRequires: xmlrpc-epi-devel, imap-devel
BuildRequires: mysql-devel
#----------------------------------------------------------------------
%description
This is a slim CGI version of PHP dedicated for using with the
PHParser/PHPGateway product.
Only some of the PHP extensions are compiled in, among them are
gd, imap and mysql. For a complete list of extensions compiled in,
see the configure option in the {percent}build section.
%prep
%setup -q -n php-%{phpversion}
%patch1 -p1
%patch2 -p1 -b .config
%patch4 -p1 -b .cxx
%patch3 -p0 -b .lib64
%patch5 -p0 -b .aprinc
%patch6 -p0 -b .tests
%patch7 -p1 -b .libtool15
%patch8 -p1 -b .snmp
## %patch20 -p1 -b .ap2
%patch21 -p1 -b .odbc
%patch22 -p1 -b .db4
##%patch23 -p1 -b .domxml
%patch30 -p1 -b .dlopen
%{__rm} ext/xmlrpc/EXPERIMENTAL
# Prevent %doc confusion over LICENSE & Zend/LICENSE
%{__cp} -a Zend/LICENSE Zend/ZEND_LICENSE
# Use correct libdir
%{__sed} 's|%{_prefix}/lib|%{_libdir}|' php.ini-dist > php.ini-dist.fixed
%{__mv} php.ini-dist.fixed php.ini-dist
#----------------------------------------------------------------------
%build
#CFLAGS="$RPM_OPT_FLAGS -fPIC"; export CFLAGS
export CFLAGS="$RPM_OPT_FLAGS"
# Add the Kerberos library path to the default LDFLAGS so that the IMAP checks
# will be able to find the GSSAPI libraries.
#LDFLAGS="-L/usr/kerberos/%{_lib}"; export LDFLAGS
# Configure may or may not catch these (mostly second-order) dependencies.
#LIBS="-lpng -ljpeg -lz -lnsl"; export LIBS
# This pulls the static /usr/lib/libc-client.a into the IMAP extension module.
IMAP_SHARED_LIBADD=-lc-client ; export IMAP_SHARED_LIBADD
#if pkg-config openssl; then
# CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
# LIBS="$LIBS `pkg-config --libs openssl`"
#fi
libtoolize --force --copy
# force aclocal run during buildconf
touch acinclude.m4
# Regenerate configure scripts (patches change config.m4's)
./buildconf --force
# Shell function to configure and build a PHP tree.
%configure \
--with-config-file-path=%{zopebindir} \
--without-config-file-path \
--disable-debug \
--enable-pic \
--disable-rpath \
--enable-inline-optimization \
--with-dom=%{_prefix} \
--with-exec-dir=%{_bindir} \
--with-zlib-dir=%{_prefix} \
--with-gd \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-ttf \
--with-gettext \
--with-gmp \
--with-iconv \
--with-jpeg-dir=%{_prefix} \
--with-openssl \
--with-png \
--with-pspell \
--with-regex=system \
--enable-xml \
--with-expat-dir=%{_prefix} \
--with-pcre=%{_prefix} \
--with-zlib \
--with-layout=GNU \
--enable-bcmath \
--enable-magic-quotes \
--enable-safe-mode \
--enable-sockets \
--enable-sysvshm \
--enable-discard-path \
--enable-track-vars \
--enable-trans-sid \
--without-pear \
--with-imap=%{_prefix} \
--with-imap-ssl \
--with-kerberos \
--with-mysql=%{_prefix} \
--enable-memory-limit \
--enable-versioning \
--enable-mbstring=all \
--enable-mbstr-enc-trans \
--enable-mbregex \
--enable-sysvshm \
--enable-zend-multibyte \
--with-xmlrpc=%{_prefix} \
--enable-force-cgi-redirect \
--disable-cli
%{__make} %{?_smp_mflags}
#----------------------------------------------------------------------
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
# Install from CGI tree
%{__make} install-sapi INSTALL_ROOT=$RPM_BUILD_ROOT
# Install the default configuration file and icons
%{__mkdir_p} -m755 $RPM_BUILD_ROOT%{zopebindir}
%{__install} -m 644 php.ini-dist $RPM_BUILD_ROOT%{zopebindir}/php.ini
%{__install} -s -m 755 sapi/cgi/php $RPM_BUILD_ROOT%{zopebindir}
# Remove unpackaged files
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/php4/*.a \
$RPM_BUILD_ROOT%{_bindir}/{php,phptar,pearize}
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%config(noreplace) %{zopebindir}/php.ini
%{zopebindir}/php
%changelog
* Tue Feb 24 2004 Wei He <[email protected]> 4.3.4-0ied01
- Made buildable on RedHat 8 with sed 3.x
* Mon Feb 16 2004 Wei He <[email protected]> 4.3.4-0ied00
- First release
%define zopeproductsdir %{zopedir}/lib/python/Products
%define zopebindir %{zopedir}/bin
%define phpversion 4.3.4
%define phpini %{zopebindir}/php.ini
Summary: PHP CGI for using with Zope's PHParser/PHPGateway product
Name: zope-phpcgi
Version: %{phpversion}
Release: 0ied01
License: The PHP License
Group: Development/Languages
URL: http://www.php.net/
Source: http://www.php.net/distributions/php-%{version}.tar.bz2
Patch1: php-4.2.1-ldap-TSRM.patch
Patch2: php-4.3.1-config.patch
Patch3: php-4.3.4-lib64.patch
Patch4: php-4.2.2-cxx.patch
Patch5: php-4.3.3-aprinc.patch
Patch6: php-4.3.3-tests.patch
Patch7: php-4.3.2-libtool15.patch
Patch8: php-4.2.1-snmp.patch
# Fixes for extension modules
Patch20: php-4.2.2-apache2.patch
Patch21: php-4.3.1-odbc.patch
Patch22: php-4.3.2-db4.patch
Patch23: php-4.3.2-domxml.patch
# Functional changes
Patch30: php-4.3.1-dlopen.patch
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: sed, pkgconfig, libtool, autoconf, automake
BuildRequires: glibc-devel, pcre-devel, gmp-devel, pspell-devel
BuildRequires: gd-devel >= 1.8.4, libjpeg-devel, libpng-devel, freetype-devel
BuildRequires: openssl-devel, krb5-devel
BuildRequires: libxml2-devel
BuildRequires: expat-devel
BuildRequires: xmlrpc-epi-devel, imap-devel
BuildRequires: mysql-devel
#----------------------------------------------------------------------
%description
This is a slim CGI version of PHP dedicated for using with the
PHParser/PHPGateway product.
Only some of the PHP extensions are compiled in, among them are
gd, imap and mysql. For a complete list of extensions compiled in,
see the configure option in the {percent}build section.
%prep
%setup -q -n php-%{phpversion}
%patch1 -p1
%patch2 -p1 -b .config
%patch4 -p1 -b .cxx
%patch3 -p0 -b .lib64
%patch5 -p0 -b .aprinc
%patch6 -p0 -b .tests
%patch7 -p1 -b .libtool15
%patch8 -p1 -b .snmp
## %patch20 -p1 -b .ap2
%patch21 -p1 -b .odbc
%patch22 -p1 -b .db4
##%patch23 -p1 -b .domxml
%patch30 -p1 -b .dlopen
%{__rm} ext/xmlrpc/EXPERIMENTAL
# Prevent %doc confusion over LICENSE & Zend/LICENSE
%{__cp} -a Zend/LICENSE Zend/ZEND_LICENSE
# Use correct libdir
%{__sed} 's|%{_prefix}/lib|%{_libdir}|' php.ini-dist > php.ini-dist.fixed
%{__mv} php.ini-dist.fixed php.ini-dist
#----------------------------------------------------------------------
%build
#CFLAGS="$RPM_OPT_FLAGS -fPIC"; export CFLAGS
export CFLAGS="$RPM_OPT_FLAGS"
# Add the Kerberos library path to the default LDFLAGS so that the IMAP checks
# will be able to find the GSSAPI libraries.
#LDFLAGS="-L/usr/kerberos/%{_lib}"; export LDFLAGS
# Configure may or may not catch these (mostly second-order) dependencies.
#LIBS="-lpng -ljpeg -lz -lnsl"; export LIBS
# This pulls the static /usr/lib/libc-client.a into the IMAP extension module.
IMAP_SHARED_LIBADD=-lc-client ; export IMAP_SHARED_LIBADD
#if pkg-config openssl; then
# CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
# LIBS="$LIBS `pkg-config --libs openssl`"
#fi
libtoolize --force --copy
# force aclocal run during buildconf
touch acinclude.m4
# Regenerate configure scripts (patches change config.m4's)
./buildconf --force
# Shell function to configure and build a PHP tree.
%configure \
--with-config-file-path=%{zopebindir} \
--without-config-file-path \
--disable-debug \
--enable-pic \
--disable-rpath \
--enable-inline-optimization \
--with-dom=%{_prefix} \
--with-exec-dir=%{_bindir} \
--with-zlib-dir=%{_prefix} \
--with-gd \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-ttf \
--with-gettext \
--with-gmp \
--with-iconv \
--with-jpeg-dir=%{_prefix} \
--with-openssl \
--with-png \
--with-pspell \
--with-regex=system \
--enable-xml \
--with-expat-dir=%{_prefix} \
--with-pcre=%{_prefix} \
--with-zlib \
--with-layout=GNU \
--enable-bcmath \
--enable-magic-quotes \
--enable-safe-mode \
--enable-sockets \
--enable-sysvshm \
--enable-discard-path \
--enable-track-vars \
--enable-trans-sid \
--without-pear \
--with-imap=%{_prefix} \
--with-imap-ssl \
--with-kerberos \
--with-mysql=%{_prefix} \
--enable-memory-limit \
--enable-versioning \
--enable-mbstring=all \
--enable-mbstr-enc-trans \
--enable-mbregex \
--enable-sysvshm \
--enable-zend-multibyte \
--with-xmlrpc=%{_prefix} \
--enable-force-cgi-redirect \
--disable-cli
%{__make} %{?_smp_mflags}
#----------------------------------------------------------------------
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
# Install from CGI tree
%{__make} install-sapi INSTALL_ROOT=$RPM_BUILD_ROOT
# Install the default configuration file and icons
%{__mkdir_p} -m755 $RPM_BUILD_ROOT%{zopebindir}
%{__install} -m 644 php.ini-dist $RPM_BUILD_ROOT%{zopebindir}/php.ini
%{__install} -s -m 755 sapi/cgi/php $RPM_BUILD_ROOT%{zopebindir}
# Remove unpackaged files
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/php4/*.a \
$RPM_BUILD_ROOT%{_bindir}/{php,phptar,pearize}
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%config(noreplace) %{zopebindir}/php.ini
%{zopebindir}/php
%changelog
* Tue Feb 24 2004 Wei He <[email protected]> 4.3.4-0ied01
- Made buildable on RedHat 8 with sed 3.x
* Mon Feb 16 2004 Wei He <[email protected]> 4.3.4-0ied00
- First release