Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: php-4.0.4pl1RC2
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 177 lines (145 sloc) 4.322 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
#! /bin/sh

# Based slightly on an original by John H Terpstra but not much left of his.
# S Liddicott 1999 sam@campbellsci.co.uk

PREFIX="php"
TARDIR="`basename \`pwd\``"
RELEASE=${1:-1}
VERSION=${2:-`echo $TARDIR | sed "s/$PREFIX//g"`}

if [ "$VERSION" = "" ]
then cat <<"EOH"
$PREFIX source needs to be installed in a folder that contains the version
number, e.g. ${PREFIX}4 or ${PREFIX}4b2
EOH
fi

echo "Usage:"
echo "$0 <release>"
echo
echo "e.g.:"
echo "$0 2"
echo -n "Building RPM version $VERSION, release: $RELEASE "
sleep 1 ; echo -n . ; sleep 1 ; echo -n . ; sleep 1 ; echo -n .
echo

TAR=php$VERSION.tar.gz
SPEC=php$VERSION.spec

# write out the .spec file
sed -e "s/PVERSION/$VERSION/g" \
    -e "s/PRELEASE/$RELEASE/g" \
    -e "s/TARDIR/$TARDIR/g" \
    > $SPEC <<'EOF'
Summary: PHP4b1 - a powerful scripting language for HTML
Name: mod_php4
Version: PVERSION
Release: PRELEASE
Group: Networking/Daemons
Source0: http://www.php.net/distributions/php%{PACKAGE_VERSION}.tar.gz
#Source1: php3-manual.tar.gz
Copyright: GPL
BuildRoot: /tmp/php3-root
Requires: webserver

%description
PHP4 is a powerful apache module that adds scripting and database connection
capabilities to the apache server. This version includes the "php" binary
for suExec and stand alone php scripts too.

%prep
%setup -q -n TARDIR
#mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz
chown -R root.root .
./buildconf

%build
# first the standalone (why can't you build both at once?)
# need to run this under sh or it breaks
cd ext/wddx
ln -s /usr/src/redhat/BUILD/apache_1.3.9/src/lib/expat-lite ./xml
cd ../..

sh ./configure --prefix=/usr \
--without-gd \
--with-config-file-path=/usr/lib \
--enable-force-cgi-redirect \
--enable-debugger=yes \
--enable-safe-mode \
--with-exec-dir=/usr/bin \
--with-mysql=/usr \
--with-imap=/usr \
--with-pdflib=/usr \
--with-system-regex \
--enable-track-vars \
--with-ttf \
--with-zlib \
--with-xml=/usr/src/redhat/BUILD/apache_1.3.9/src/lib/expat-lite \
--with-wddx \

# ldap don't work
# --with-ldap=/usr \

# system regex conflicts with apache_ssl for some reason

make
mv php php.keepme

# then the apache module
rm config.cache
sh ./configure --prefix=/usr \
--without-gd \
--with-apxs=/usr/sbin/apxs \
--enable-versioning \
--with-config-file-path=/usr/lib \
--enable-debugger=yes \
--enable-safe-mode \
--with-exec-dir=/usr/bin \
--with-mysql=/usr \
--with-imap=/usr \
--with-pdflib=/usr \
--with-system-regex \
--enable-track-vars \
--with-ttf \
--with-zlib \
--with-xml=/usr/src/redhat/BUILD/apache_1.3.9/src/lib/expat-lite \
--with-wddx \

# ldap don't work
# --with-ldap=/usr \

# system regex conflicts with apache_ssl for some reason

make clean
make
# restore cgi version
mv php.keepme php

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/lib/apache
install -m 755 libphp4.so $RPM_BUILD_ROOT/usr/lib/apache
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -m 755 php $RPM_BUILD_ROOT/usr/bin

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Sun Apr 30 2000 Joey Smith <joey@samaritan.com>
- Small fix: Description still referred to package as PHP3.

* Wed Jul 21 1999 Sam Liddicott <sam@campbellsci.co.uk>
- added php4b1 and modified cgi building rules so it doesn't break module

* Wed Mar 17 1999 Sam Liddicott <sam@campbellsci.co.uk>
- Stuffed in 3.0.7 source tar and added "php" as a build destination

* 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.

%files
/usr/lib/apache/libphp4.so
/usr/bin/php
%doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE BUGS examples
%doc manual/*
EOF

RPMDIR=/usr/src/redhat/RPMS
SPECDIR=/usr/src/redhat/SPECS
SRCDIR=/usr/src/redhat/SOURCES

(
make clean
find . -name config.cache -exec rm -f '{}'
cd ..
tar czvf ${SRCDIR}/${TAR} $TARDIR )

cp -a $SPEC $SPECDIR/${SPEC}
#cp -a *.patch $SRCDIR
cd $SRCDIR
chown -R root.root ${TAR}
cd $SPECDIR
rpm -ba -v ${SPEC}
Something went wrong with that request. Please try again.