Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 174 lines (142 sloc) 4.525 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:"
19 echo "$0 <release>"
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
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
29
30 # write out the .spec file
31 sed -e "s/PVERSION/$VERSION/g" \
32 -e "s/PRELEASE/$RELEASE/g" \
33 -e "s/TARDIR/$TARDIR/g" \
34 > $SPEC <<'EOF'
91b3f34 Make this work again
Marcus Boerger authored
35 Summary: PHP 5 - A powerful scripting language
36 Name: mod_php5
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
37 Version: PVERSION
38 Release: PRELEASE
39 Group: Networking/Daemons
5c8035e This file needed an update..
foobar authored
40 Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz
91b3f34 Make this work again
Marcus Boerger authored
41 Copyright: PHP License
42 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
43 Requires: webserver
44
45 %description
91b3f34 Make this work again
Marcus Boerger authored
46 PHP5 is a powerful apache module that adds scripting and database connection
47 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
48 for suExec and stand alone php scripts too.
49
50 %prep
51 %setup -q -n TARDIR
52 #mkdir manual; cd manual && tar xzf $RPM_SOURCE_DIR/php3-manual.tar.gz
53 ./buildconf
54
55 %build
56 # first the standalone (why can't you build both at once?)
57 # need to run this under sh or it breaks
58
59 sh ./configure --prefix=/usr \
91b3f34 Make this work again
Marcus Boerger authored
60 --with-config-file-path=/etc \
61 --enable-cli \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
62 --enable-force-cgi-redirect \
63 --enable-safe-mode \
64 --with-exec-dir=/usr/bin \
91b3f34 Make this work again
Marcus Boerger authored
65 --with-mysql \
66 --with-zlib \
5c8035e This file needed an update..
foobar authored
67 --enable-xml \
68 --enable-wddx
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
69
70 make
91b3f34 Make this work again
Marcus Boerger authored
71 mv sapi/cgi/php php.keepme
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
72
73 # then the apache module
91b3f34 Make this work again
Marcus Boerger authored
74 test -f config.cache && rm -f config.cache
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
75 sh ./configure --prefix=/usr \
76 --with-apxs=/usr/sbin/apxs \
91b3f34 Make this work again
Marcus Boerger authored
77 --enable-cli \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
78 --enable-versioning \
91b3f34 Make this work again
Marcus Boerger authored
79 --with-config-file-path=/etc \
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
80 --enable-safe-mode \
81 --with-exec-dir=/usr/bin \
91b3f34 Make this work again
Marcus Boerger authored
82 --with-mysql \
83 --with-zlib \
5c8035e This file needed an update..
foobar authored
84 --enable-xml \
85 --enable-wddx
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
86
87 make clean
88 make
89 # restore cgi version
91b3f34 Make this work again
Marcus Boerger authored
90 mv php.keepme sapi/cgi/php
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
91b3f34 Make this work again
Marcus Boerger authored
94 mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache
95 install -m 0755 .libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/apache
96 mkdir -p $RPM_BUILD_ROOT%{_bindir}
97 install -m 0755 sapi/cli/php $RPM_BUILD_ROOT%{_bindir}
98 install -m 0755 sapi/cgi/php $RPM_BUILD_ROOT%{_bindir}/php_cgi
99 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
100 install -m 0755 sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1
101 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
102 install -m 0755 php.ini-recommended $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %changelog
91b3f34 Make this work again
Marcus Boerger authored
108 * Thu Oct 31 2003 Marcus Boerger <helly@php.net>
109 - Update version to 5.
110 - Remove unsure external requirements.
111 - Remove non existing directories
112 - Fix targets.
113 - Install both CLI and CGI.
114 - Install manpage.
115 - Install ini.
116
ea2a3bd - Fix a path and remove --with-imap
Derick Rethans authored
117 * Mon Mar 04 2002 Arjen Lentz <agl@bitbike.com>
118 - Fix path and remove --with-imap due to conflicts with kerberos.
119
5c8035e This file needed an update..
foobar authored
120 * Fri Jun 29 2001 Jani Taskinen <sniper@iki.fi>
121 - Removed some useless configure options. Made the tar names correct.
122
564f979 Small fix: Description still referred to package as PHP3.
Joey Smith authored
123 * Sun Apr 30 2000 Joey Smith <joey@samaritan.com>
124 - Small fix: Description still referred to package as PHP3.
125
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
126 * Wed Jul 21 1999 Sam Liddicott <sam@campbellsci.co.uk>
127 - added php4b1 and modified cgi building rules so it doesn't break module
128
129 * Wed Mar 17 1999 Sam Liddicott <sam@campbellsci.co.uk>
130 - Stuffed in 3.0.7 source tar and added "php" as a build destination
131
132 * Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
133 - rebuild for apache 1.3.3
134
135 * Thu Oct 08 1998 Preston Brown <pbrown@redhat.com>
136 - updated to 3.0.5, fixes nasty bugs in 3.0.4.
137
138 * Sun Sep 27 1998 Cristian Gafton <gafton@redhat.com>
139 - updated to 3.0.4 and recompiled for apache 1.3.2
140
141 * Thu Sep 03 1998 Preston Brown <pbrown@redhat.com>
142 - improvements; builds with apache-devel package installed.
143
144 * Tue Sep 01 1998 Preston Brown <pbrown@redhat.com>
145 - Made initial cut for PHP3.
146
147 %files
91b3f34 Make this work again
Marcus Boerger authored
148 %defattr(-,root,root)
149 %{_libdir}/apache/libphp5.so
150 %{_bindir}/php
151 %{_bindir}/php_cgi
152 %{_mandir}/man1/php.1*
153 %{_sysconfdir}/php.ini
154
155 %doc TODO CODING_STANDARDS CREDITS ChangeLog LICENSE NEWS
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
156 EOF
157
158 RPMDIR=/usr/src/redhat/RPMS
159 SPECDIR=/usr/src/redhat/SPECS
160 SRCDIR=/usr/src/redhat/SOURCES
161
162 (
163 make clean
91b3f34 Make this work again
Marcus Boerger authored
164 find . -name config.cache -exec rm -f '{}' \;
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
165 cd ..
166 tar czvf ${SRCDIR}/${TAR} $TARDIR )
167
168 cp -a $SPEC $SPECDIR/${SPEC}
169 #cp -a *.patch $SRCDIR
170 cd $SRCDIR
91b3f34 Make this work again
Marcus Boerger authored
171 #chown -R root.root ${TAR}
4b6a032 Added makerpm by Samuel Liddicott <sam@campbellsci.co.uk>
Stig Bakken authored
172 cd $SPECDIR
173 rpm -ba -v ${SPEC}
Something went wrong with that request. Please try again.