]>
Commit | Line | Data |
---|---|---|
0854e400 ER |
1 | %define apxs /usr/sbin/apxs1 |
2 | Summary: Support for the PHP via FastCGI protocol for Apache webserver | |
3 | Name: apache1-php-fcgi | |
4 | Version: 5.2.6 | |
5 | Release: 1 | |
6 | License: GPL | |
7 | Group: Applications/WWW | |
8 | BuildRequires: apache1-devel >= 1.3.39 | |
9 | BuildRequires: rpmbuild(macros) >= 1.268 | |
10 | Requires: apache1-mod_fastcgi | |
11 | Requires: php-fcgi >= 4:%{version} | |
12 | Requires: php-fcgi-init | |
13 | Provides: webserver(php) = %{version} | |
14 | BuildArch: noarch | |
15 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
16 | ||
17 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
18 | %define fcgiapp /usr/bin/php.fcgi | |
19 | ||
20 | %description | |
21 | This virtual package provides support for the PHP via FastCGI | |
22 | protocol. | |
23 | ||
24 | %prep | |
25 | %setup -qcT | |
26 | ||
27 | cat <<'EOF' > apache.conf | |
28 | # setup via fastcgi to run php5 | |
29 | <IfModule mod_fastcgi.c> | |
30 | # the server name is bogus actually, to satisfy mod_fastcgi | |
31 | FastCgiExternalServer %{fcgiapp} -socket /var/run/php/fcgi.sock | |
32 | ScriptAlias /php-fcgi %{fcgiapp} | |
33 | <Location "/php-fcgi"> | |
34 | SetHandler fastcgi-script | |
35 | Allow from all | |
36 | </Location> | |
37 | ||
38 | Action application/x-httpd-php-fcgi /php-fcgi | |
39 | </IfModule> | |
40 | ||
41 | # To register handler for .php in your config context: | |
42 | #<IfModule mod_fastcgi.c> | |
43 | # AddType application/x-httpd-php-fcgi .php | |
44 | #</IfModule> | |
45 | EOF | |
46 | ||
47 | %install | |
48 | rm -rf $RPM_BUILD_ROOT | |
49 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d | |
50 | cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_php-fcgi.conf | |
51 | ||
52 | %clean | |
53 | rm -rf $RPM_BUILD_ROOT | |
54 | ||
55 | %post | |
56 | %service -q apache restart | |
57 | ||
58 | %postun | |
59 | if [ "$1" = "0" ]; then | |
60 | %service -q apache restart | |
61 | fi | |
62 | ||
63 | %files | |
64 | %defattr(644,root,root,755) | |
65 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_php-fcgi.conf |