3 # Based slightly on an original by John H Terpstra but not much left of his.
4 # S Liddicott 1999 sam@campbellsci.co.uk
7 TARDIR
="`basename \`pwd\``"
9 VERSION
=${2:-`echo $TARDIR | sed "s/$PREFIX-//g"`}
11 if [ "$VERSION" = "" ]
13 $PREFIX source needs to be installed in a folder that contains the version
14 number, e.g. ${PREFIX}5 or ${PREFIX}5b2
19 echo "$0 <release> <version>"
23 echo -n "Building RPM version $VERSION, release: $RELEASE "
24 sleep 1 ; echo -n . ; sleep 1 ; echo -n . ; sleep 1 ; echo -n .
27 TAR=php-$VERSION.tar.gz
28 SPEC=php-$VERSION.spec
29 PREQUIRES=`rpm -q --provides apache|grep "\(webserver\|httpd\)"`
30 if [ "$PREQUIRES" = "" ]
31 then PREQUIRES="webserver"
34 # write out the .spec file
35 sed -e "s/PVERSION/$VERSION/g" \
36 -e "s/PRELEASE/$RELEASE/g" \
37 -e "s/TARDIR/$TARDIR/g" \
38 -e "s/PREQUIRES/$PREQUIRES/g" \
40 Summary: PHP 5 - A powerful scripting language
44 Group: Networking/Daemons
45 Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz
46 Copyright: PHP License
47 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
51 PHP 5 is a powerful apache module that adds scripting and database connection
52 capabilities to the apache server. This version includes the "php_cgi" binary
53 for suExec and stand alone php scripts too.
57 #mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz
61 # first the standalone (why can't you build both at once?)
62 # need to run this under sh or it breaks
64 sh ./configure --prefix=/usr \
65 --with-config-file-path=%{_sysconfdir} \
68 --enable-force-cgi-redirect \
70 --with-exec-dir=/usr/bin \
79 mv sapi/cgi/php php.keepme
81 # then the apache module
82 test -f config.cache && rm -f config.cache
83 sh ./configure --prefix=/usr \
84 --with-apxs=/usr/sbin/apxs \
86 --with-config-file-path=%{_sysconfdir} \
88 --with-exec-dir=/usr/bin \
96 # --with-pgsql=shared \
100 # restore cgi version
101 mv php.keepme sapi/cgi/php
104 rm -rf $RPM_BUILD_ROOT
105 mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache
106 install -m 0755 .libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/apache
107 mkdir -p $RPM_BUILD_ROOT%{_bindir}
108 install -m 0755 sapi/cli/php $RPM_BUILD_ROOT%{_bindir}
109 install -m 0755 sapi/cgi/php $RPM_BUILD_ROOT%{_bindir}/php_cgi
110 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
111 install -m 0755 sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1
112 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
113 install -m 0755 php.ini-recommended $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
114 mkdir -p $RPM_BUILD_ROOT%{_libdir}/php/extensions
115 install -m 0755 modules/*.so $RPM_BUILD_ROOT%{_libdir}/php/extensions
118 rm -rf $RPM_BUILD_ROOT
121 * Thu Nov 27 2003 Marcus Boerger <helly@php.net>
122 - Fix requirements for older systems.
123 - Fix rpm build directory for the major distributions.
125 - Rename package to php.
127 - Support building of shared extensions.
128 - Build CLI only once.
130 * Thu Oct 31 2003 Marcus Boerger <helly@php.net>
131 - Update version to 5.
132 - Remove unsure external requirements.
133 - Remove non existing directories
135 - Install both CLI and CGI.
139 * Mon Mar 04 2002 Arjen Lentz <agl@bitbike.com>
140 - Fix path and remove --with-imap due to conflicts with kerberos.
142 * Fri Jun 29 2001 Jani Taskinen <sniper@iki.fi>
143 - Removed some useless configure options. Made the tar names correct.
145 * Sun Apr 30 2000 Joey Smith <joey@samaritan.com>
146 - Small fix: Description still referred to package as PHP3.
148 * Wed Jul 21 1999 Sam Liddicott <sam@campbellsci.co.uk>
149 - added php4b1 and modified cgi building rules so it doesn't break module
151 * Wed Mar 17 1999 Sam Liddicott <sam@campbellsci.co.uk>
152 - Stuffed in 3.0.7 source tar and added "php" as a build destination
154 * Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
155 - rebuild for apache 1.3.3
157 * Thu Oct 08 1998 Preston Brown <pbrown@redhat.com>
158 - updated to 3.0.5, fixes nasty bugs in 3.0.4.
160 * Sun Sep 27 1998 Cristian Gafton <gafton@redhat.com>
161 - updated to 3.0.4 and recompiled for apache 1.3.2
163 * Thu Sep 03 1998 Preston Brown <pbrown@redhat.com>
164 - improvements; builds with apache-devel package installed.
166 * Tue Sep 01 1998 Preston Brown <pbrown@redhat.com>
167 - Made initial cut for PHP3.
170 %defattr(-,root,root)
171 %{_libdir}/apache/libphp5.so
174 %{_mandir}/man1/php.1*
175 %{_sysconfdir}/php.ini
176 %{_libdir}/php/extensions/*.so
178 %doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE NEWS
181 RPMBASE=/usr/src/redhat
182 for i in /usr/src/redhat /usr/src/packages /usr/src/RPM; do
189 RPMDIR=${RPMBASE}/RPMS
190 SPECDIR=${RPMBASE}/SPECS
191 SRCDIR=${RPMBASE}/SOURCES
195 find . -name config.cache -exec rm -f '{}' \;
197 tar czvf ${SRCDIR}/${TAR} $TARDIR )
199 cp -a $SPEC $SPECDIR/${SPEC}
200 #cp -a *.patch $SRCDIR