1 |
#Module-Specific definitions |
2 |
%define mod_name mod_php |
3 |
%define mod_conf 70_%{mod_name}.conf |
4 |
%define mod_so %{mod_name}5.so |
5 |
%define extname apache2handler |
6 |
|
7 |
%define epoch 3 |
8 |
%define major 5 |
9 |
%define libname %mklibname php5_common %{major} |
10 |
%define apache_version 2.2.8 |
11 |
%define php_version %{version} |
12 |
|
13 |
Summary: The PHP5 HTML-embedded scripting language for use with apache |
14 |
Name: apache-%{mod_name} |
15 |
Version: 5.3.5 |
16 |
Release: %mkrel 1 |
17 |
Group: System/Servers |
18 |
License: PHP License |
19 |
URL: http://www.php.net/ |
20 |
Source1: %{mod_conf} |
21 |
Requires(pre): rpm-helper |
22 |
Requires(postun): rpm-helper |
23 |
Requires: %{libname} >= %{epoch}:%{php_version} |
24 |
Requires: apache-base >= %{apache_version} |
25 |
Requires: apache-conf >= %{apache_version} |
26 |
Requires: apache-modules >= %{apache_version} |
27 |
Requires: apache-mpm >= %{apache_version} |
28 |
Requires: php-ctype >= %{epoch}:%{php_version} |
29 |
Requires: php-filter >= %{epoch}:%{php_version} |
30 |
Requires: php-ftp >= %{epoch}:%{php_version} |
31 |
Requires: php-gettext >= %{epoch}:%{php_version} |
32 |
Requires: php-hash >= %{epoch}:%{php_version} |
33 |
Requires: php-ini >= %{php_version} |
34 |
Requires: php-json >= %{epoch}:%{php_version} |
35 |
Requires: php-openssl >= %{epoch}:%{version} |
36 |
Requires: php-pcre >= %{epoch}:%{php_version} |
37 |
Requires: php-posix >= %{epoch}:%{php_version} |
38 |
Requires: php-session >= %{epoch}:%{php_version} |
39 |
Suggests: php-suhosin >= 0.9.29 |
40 |
Requires: php-sysvsem >= %{epoch}:%{php_version} |
41 |
Requires: php-sysvshm >= %{epoch}:%{php_version} |
42 |
Requires: php-tokenizer >= %{epoch}:%{php_version} |
43 |
Requires: php-xmlreader >= %{epoch}:%{php_version} |
44 |
Requires: php-xmlwriter >= %{epoch}:%{php_version} |
45 |
Requires: php-zlib >= %{epoch}:%{php_version} |
46 |
Requires: php-xml >= %{epoch}:%{version} |
47 |
BuildRequires: apache-devel >= %{apache_version} |
48 |
BuildRequires: php-devel >= %{epoch}:%{php_version} |
49 |
BuildRequires: dos2unix |
50 |
Provides: php mod_php |
51 |
Obsoletes: php mod_php |
52 |
Conflicts: apache-mpm-worker >= %{apache_version} |
53 |
Conflicts: apache-mpm-event >= %{apache_version} |
54 |
Requires: php-timezonedb >= 3:2009.10 |
55 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
56 |
Epoch: %{epoch} |
57 |
|
58 |
%description |
59 |
PHP5 is an HTML-embedded scripting language. PHP5 attempts to make it easy for |
60 |
developers to write dynamically generated web pages. PHP5 also offers built-in |
61 |
database integration for several commercial and non-commercial database |
62 |
management systems, so writing a database-enabled web page with PHP5 is fairly |
63 |
simple. The most common use of PHP coding is probably as a replacement for CGI |
64 |
scripts. The %{name} module enables the apache web server to understand and |
65 |
process the embedded PHP language in web pages. |
66 |
|
67 |
This package contains PHP version 5. You'll also need to install the apache web |
68 |
server. |
69 |
|
70 |
%prep |
71 |
|
72 |
%setup -c -T |
73 |
cp -dpR %{_usrsrc}/php-devel/sapi/%{extname}/* . |
74 |
cp %{_usrsrc}/php-devel/internal_functions.c . |
75 |
cp %{_includedir}/php/ext/date/lib/timelib_config.h . |
76 |
|
77 |
# strip away annoying ^M |
78 |
find -type f -exec dos2unix -U {} \; |
79 |
|
80 |
cp %{SOURCE1} %{mod_conf} |
81 |
|
82 |
%build |
83 |
|
84 |
%{_sbindir}/apxs \ |
85 |
`php-config --includes` \ |
86 |
`apr-1-config --link-ld --libs` \ |
87 |
`xml2-config --cflags` \ |
88 |
-I%{_usrsrc}/php-devel \ |
89 |
-I. -lphp5_common \ |
90 |
-c mod_php5.c sapi_apache2.c apache_config.c \ |
91 |
php_functions.c internal_functions.c |
92 |
|
93 |
%install |
94 |
rm -rf %{buildroot} |
95 |
|
96 |
install -d %{buildroot}%{_libdir}/apache-extramodules |
97 |
install -d %{buildroot}%{_sysconfdir}/httpd/modules.d |
98 |
|
99 |
install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache-extramodules/ |
100 |
install -m0644 %{mod_conf} %{buildroot}%{_sysconfdir}/httpd/modules.d/%{mod_conf} |
101 |
|
102 |
%post |
103 |
if [ -f %{_var}/lock/subsys/httpd ]; then |
104 |
%{_initrddir}/httpd restart 1>&2; |
105 |
fi |
106 |
|
107 |
%postun |
108 |
if [ "$1" = "0" ]; then |
109 |
if [ -f %{_var}/lock/subsys/httpd ]; then |
110 |
%{_initrddir}/httpd restart 1>&2 |
111 |
fi |
112 |
fi |
113 |
|
114 |
%clean |
115 |
rm -rf %{buildroot} |
116 |
|
117 |
%files |
118 |
%defattr(-,root,root) |
119 |
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/modules.d/%{mod_conf} |
120 |
%attr(0755,root,root) %{_libdir}/apache-extramodules/%{mod_so} |
121 |
|
122 |
|