Bug 4828

Summary: New mod_php3-3.0.9 package doesn't build from source
Product: [Retired] Red Hat Linux Reporter: ptomblin
Component: mod_php3Assignee: David Lawrence <dkl>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-09-01 15:37:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description ptomblin 1999-09-01 15:15:29 UTC
I got the new mod_php3-3.0.9 source rpm, and attempted to
build it with mysql support.  I don't have PostgresSQL
installed, and it's not a required package to use mod_php3.
Never the less, when I try and build, I get the following
make: Leaving directory
+ gcc -shared -fPIC -DCOMPILE_DL=1 -I. -I/usr/include/apache
-I/usr/include/pgsql -o pgsql.so ./functions/pgsql.c -lpg
In file included from ./functions/pgsql.c:40:
functions/php3_pgsql.h:46: libpq-fe.h: No such file or
functions/php3_pgsql.h:47: libpq/libpq-fs.h: No such file or
Bad exit status from /var/tmp/rpm-tmp.65831 (%build)

There is no libpq on my entire system.  I assume it's some
part of one of the postgress packages?  I tried changing the
build options to put --without-pgsql, and it didn't help.

Note that I successfully built from source with the previous
package, 3.0.7.  Since the changelog says it "fixed
postgressql", I'd suggest a rollback of whatever you
supposedly "fixed".

Comment 1 Preston Brown 1999-09-01 15:37:59 UTC
unmodified, the php package needs postgres installed in order to
rebuild.  Soon it will require mysql as well.

There is no problem with the package, but you do have to have some
knowledge about building RPMs and software in general to rip out the
postgresql (and soon mysql) specific parts of the RPM.

Comment 2 ptomblin 1999-09-01 15:39:59 UTC
Note that if I delete all reference to Postgress from the spec file, I
can build it, and mysql works fine.  My spec file now looks like:
Summary: The PHP3 HTML-embedded scripting language for use with
Name: mod_php3
Version: 3.0.9
Release: 1
Group: System Environment/Daemons
Source0: http://www.php.net/distributions/php-%{version}.tar.gz
Source1: manual.tar.gz
Source2: imap-4.5.tar.Z
Source3: FAQ.php3
Source4: logo1t.gif
Icon: php3.gif
Patch1:    imap-4.4-vfs.patch
Patch2:    imap-4.5-linux.patch
Patch3:    imap-4.5-redhat.patch
Patch4:    php-3.0.9-config.patch
Copyright: GPL
BuildRoot: /var/tmp/%{name}-root
Requires: webserver

PHP is an HTML-embedded scripting language.  PHP attempts to make it
easy for developers to write dynamically generated web pages.  PHP
also offers built-in database integration for several commercial
and non-commercial database management systems, so writing a
database-enabled web page with PHP is fairly simple.  The most
common use of PHP coding is probably as a replacement for CGI
scripts.  The mod_php module enables the Apache web server to
understand and process the embedded PHP language in web pages.

This package contains PHP3, or PHP version 3.08.  If you use
applications which specifically rely on PHP/FI, you should instead
install the PHP/FI module contained in the mod_php package.
If you're just starting with PHP, you should install this package.
You'll also need to install the Apache web server.

%package manual
Group: System Environment/Daemons
Summary: On-line manual for PHP3

%description manual
Comprehensive documentation for PHP3, viewable through any web

%package imap
Group: System Environment/Daemons
Requires: mod_php3
Summary: IMAP module for PHP3.

%description imap
This is a dynamic shared object (DSO) for Apache that will add IMAP
support to PHP3.  If you need to have IMAP support for PHP3
you will need to install this package in addition to the main mod_php3
%setup -q -n php-%{version} -a 2
%patch4 -p1 -b .config

cd imap-4.5
%patch1 -p1 -b .vfs
%patch2 -p1 -b .linux
%patch3 -p1 -b .redhat

cd imap-4.5
cd ..

CFLAGS="-fPIC" ./configure --prefix=/usr \
   --with-apxs=/usr/sbin/apxs \
   --with-config-file-path=/etc/httpd \
   --enable-safe-mode \
   --with-exec-dir=/usr/bin \
   --with-system-regex \
   --disable-debug \
   --with-zlib \
   --without-pgsql \
   --with-mysql=/usr \
   --enable-debugger \
   --enable-magic-quotes \

make -C convertor

# IMAP module
perl -pi -e 's/HAVE_IMAP 0/HAVE_IMAP 1/g' config.h
gcc -shared -fPIC -DCOMPILE_DL=1 -I. -I/usr/include/apache \
   -Iimap-4.5/c-client -o imap.so ./functions/imap.c \
   imap-4.5/c-client/c-client.a -lc

mkdir -p $RPM_BUILD_ROOT/usr/lib/apache
mkdir -p $RPM_BUILD_ROOT/etc/httpd
mkdir -p $RPM_BUILD_ROOT/home/httpd/icons
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -m 755 -s libphp3.so $RPM_BUILD_ROOT/usr/lib/apache
install -m 755 -s imap.so $RPM_BUILD_ROOT/usr/lib/apache
install -m 644 php3.ini-dist $RPM_BUILD_ROOT/etc/httpd/php3.ini
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/home/httpd/icons
install -m 644 extra/icons/*.gif $RPM_BUILD_ROOT/home/httpd/icons
install -m 755 convertor/convertor $RPM_BUILD_ROOT/usr/bin
mv convertor/README convertor/README.convertor

# manual
mkdir -p $RPM_BUILD_ROOT/home/httpd/html/manual/mod/mod_php3
cd $RPM_BUILD_ROOT/home/httpd/html/manual/mod/mod_php3
tar xzf %{SOURCE1}
ln -sf manual.html index.html


%post imap
perl -pi -e 's|^;extension=imap.so|extension=imap.so|g'

%postun imap
if [ $1 = 0 ]; then
  perl -pi -e 's|^extension=imap.so|;extension=imap.so|g'

%config /etc/httpd/php3.ini
%doc convertor/README.convertor

%files imap

%files manual

* Mon Jun 14 1999 Preston Brown <pbrown>
- 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>
- 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>
- hacked in imap support in an ugly way until imap gets an official
  shared library implementation

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

* Wed Mar 24 1999 Preston Brown <pbrown>
- build against apache 1.3.6

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

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

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

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

* Mon Oct 12 1998 Cristian Gafton <gafton>
- rebuild for apache 1.3.3

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

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

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

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