Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 204 lines (169 sloc) 5.317 kb
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
1 #! /bin/sh
2
3 # Based slightly on an original by John H Terpstra but not much left of his.
4 # S Liddicott 1999 sam@campbellsci.co.uk
5
6 PREFIX="php"
7 TARDIR="`basename \`pwd\``"
8 RELEASE=${1:-1}
5c8035e This file needed an update..
foobar authored
9 VERSION=${2:-`echo $TARDIR | sed "s/$PREFIX-//g"`}
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
10
11 if [ "$VERSION" = "" ]
12 then cat <<"EOH"
13 $PREFIX source needs to be installed in a folder that contains the version
91b3f34 Make this work again
Marcus Boerger authored
14 number, e.g. ${PREFIX}5 or ${PREFIX}5b2
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
15 EOH
16 fi
17
18 echo "Usage:"
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
19 echo "$0 <release> <version>"
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
20 echo
21 echo "e.g.:"
22 echo "$0 2"
23 echo -n "Building RPM version $VERSION, release: $RELEASE "
24 sleep 1 ; echo -n . ; sleep 1 ; echo -n . ; sleep 1 ; echo -n .
25 echo
26
5c8035e This file needed an update..
foobar authored
27 TAR=php-$VERSION.tar.gz
28 SPEC=php-$VERSION.spec
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
29 PREQUIRES=`rpm -q --provides apache|grep "\(webserver\|httpd\)"`
30 if [ "$PREQUIRES" = "" ]
31 then PREQUIRES="webserver"
32 fi
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
33
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" \
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
38 -e "s/PREQUIRES/$PREQUIRES/g" \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
39 > $SPEC <<'EOF'
91b3f34 Make this work again
Marcus Boerger authored
40 Summary: PHP 5 - A powerful scripting language
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
41 Name: php5
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
42 Version: PVERSION
43 Release: PRELEASE
44 Group: Networking/Daemons
5c8035e This file needed an update..
foobar authored
45 Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz
91b3f34 Make this work again
Marcus Boerger authored
46 Copyright: PHP License
47 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
48 Requires: PREQUIRES
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
49
50 %description
3bf293f @andigutmans - Change from PHP5 -> PHP 5
andigutmans authored
51 PHP 5 is a powerful apache module that adds scripting and database connection
91b3f34 Make this work again
Marcus Boerger authored
52 capabilities to the apache server. This version includes the "php_cgi" binary
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
53 for suExec and stand alone php scripts too.
54
55 %prep
56 %setup -q -n TARDIR
57 #mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz
58 ./buildconf
59
60 %build
61 # first the standalone (why can't you build both at once?)
62 # need to run this under sh or it breaks
63
64 sh ./configure --prefix=/usr \
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
65 --with-config-file-path=%{_sysconfdir} \
66 --disable-cli \
67 --without-pear \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
68 --enable-force-cgi-redirect \
69 --enable-safe-mode \
70 --with-exec-dir=/usr/bin \
91b3f34 Make this work again
Marcus Boerger authored
71 --with-mysql \
72 --with-zlib \
5c8035e This file needed an update..
foobar authored
73 --enable-xml \
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
74 --enable-wddx \
75 --with-gd \
76 --enable-shared \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
77
78 make
91b3f34 Make this work again
Marcus Boerger authored
79 mv sapi/cgi/php php.keepme
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
80
81 # then the apache module
91b3f34 Make this work again
Marcus Boerger authored
82 test -f config.cache && rm -f config.cache
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
83 sh ./configure --prefix=/usr \
84 --with-apxs=/usr/sbin/apxs \
91b3f34 Make this work again
Marcus Boerger authored
85 --enable-cli \
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
86 --with-config-file-path=%{_sysconfdir} \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
87 --enable-safe-mode \
88 --with-exec-dir=/usr/bin \
91b3f34 Make this work again
Marcus Boerger authored
89 --with-mysql \
90 --with-zlib \
5c8035e This file needed an update..
foobar authored
91 --enable-xml \
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
92 --enable-wddx \
93 --with-gd \
94 --enable-shared \
95
96 # --with-pgsql=shared \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
97
98 make clean
99 make
100 # restore cgi version
91b3f34 Make this work again
Marcus Boerger authored
101 mv php.keepme sapi/cgi/php
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
102
103 %install
104 rm -rf $RPM_BUILD_ROOT
91b3f34 Make this work again
Marcus Boerger authored
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
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
114 mkdir -p $RPM_BUILD_ROOT%{_libdir}/php/extensions
115 install -m 0755 modules/*.so $RPM_BUILD_ROOT%{_libdir}/php/extensions
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %changelog
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
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.
124 - Fix config dir.
125 - Rename package to php.
126 - Add gd extension.
127 - Support building of shared extensions.
128 - Build CLI only once.
129
91b3f34 Make this work again
Marcus Boerger authored
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
134 - Fix targets.
135 - Install both CLI and CGI.
136 - Install manpage.
137 - Install ini.
138
ea2a3bd - Fix a path and remove --with-imap
Derick Rethans authored
139 * Mon Mar 04 2002 Arjen Lentz <agl@bitbike.com>
140 - Fix path and remove --with-imap due to conflicts with kerberos.
141
5c8035e This file needed an update..
foobar authored
142 * Fri Jun 29 2001 Jani Taskinen <sniper@iki.fi>
143 - Removed some useless configure options. Made the tar names correct.
144
564f979 Small fix: Description still referred to package as PHP3.
Joey Smith authored
145 * Sun Apr 30 2000 Joey Smith <joey@samaritan.com>
146 - Small fix: Description still referred to package as PHP3.
147
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
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
150
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
153
154 * Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
155 - rebuild for apache 1.3.3
156
157 * Thu Oct 08 1998 Preston Brown <pbrown@redhat.com>
158 - updated to 3.0.5, fixes nasty bugs in 3.0.4.
159
160 * Sun Sep 27 1998 Cristian Gafton <gafton@redhat.com>
161 - updated to 3.0.4 and recompiled for apache 1.3.2
162
163 * Thu Sep 03 1998 Preston Brown <pbrown@redhat.com>
164 - improvements; builds with apache-devel package installed.
165
166 * Tue Sep 01 1998 Preston Brown <pbrown@redhat.com>
167 - Made initial cut for PHP3.
168
169 %files
91b3f34 Make this work again
Marcus Boerger authored
170 %defattr(-,root,root)
171 %{_libdir}/apache/libphp5.so
172 %{_bindir}/php
173 %{_bindir}/php_cgi
174 %{_mandir}/man1/php.1*
175 %{_sysconfdir}/php.ini
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
176 %{_libdir}/php/extensions/*.so
91b3f34 Make this work again
Marcus Boerger authored
177
178 %doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE NEWS
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
179 EOF
180
c41dc88 - Fix requirements for older systems.
Marcus Boerger authored
181 RPMBASE=/usr/src/redhat
182 for i in /usr/src/redhat /usr/src/packages /usr/src/RPM; do
183 if test -d $i; then
184 RPMBASE=$i
185 break
186 fi
187 done
188
189 RPMDIR=${RPMBASE}/RPMS
190 SPECDIR=${RPMBASE}/SPECS
191 SRCDIR=${RPMBASE}/SOURCES
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
192
193 (
194 make clean
91b3f34 Make this work again
Marcus Boerger authored
195 find . -name config.cache -exec rm -f '{}' \;
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
196 cd ..
197 tar czvf ${SRCDIR}/${TAR} $TARDIR )
198
199 cp -a $SPEC $SPECDIR/${SPEC}
200 #cp -a *.patch $SRCDIR
201 cd $SRCDIR
202 cd $SPECDIR
203 rpm -ba -v ${SPEC}
Something went wrong with that request. Please try again.