]>
Commit | Line | Data |
---|---|---|
1 | %define php_name php%{?php_suffix} | |
2 | %define modname apcu | |
3 | Summary: APCu - APC User Cache | |
4 | Name: %{php_name}-pecl-%{modname} | |
5 | Version: 4.0.4 | |
6 | Release: 2 | |
7 | License: PHP 3.01 | |
8 | Group: Development/Languages/PHP | |
9 | Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz | |
10 | # Source0-md5: a7696b1c351d9bd1592b7840701f5bf7 | |
11 | Source1: %{modname}.ini | |
12 | Source2: apache.conf | |
13 | Source3: config.php | |
14 | Patch0: config.patch | |
15 | URL: http://pecl.php.net/package/APCu/ | |
16 | BuildRequires: %{php_name}-devel >= 4:5.1.0 | |
17 | BuildRequires: rpmbuild(macros) >= 1.666 | |
18 | %{?requires_php_extension} | |
19 | Requires: php(core) >= 5.1.0 | |
20 | Provides: php(apcu) = %{version} | |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
23 | %define _webapps /etc/webapps | |
24 | %define _webapp %{modname} | |
25 | %define _sysconfdir %{_webapps}/%{_webapp} | |
26 | %define _appdir %{_datadir}/%{_webapp} | |
27 | ||
28 | %description | |
29 | APCu is userland caching: APC stripped of opcode caching in | |
30 | preparation for the deployment of Zend Optimizer+ as the primary | |
31 | solution to opcode caching in future versions of PHP. | |
32 | ||
33 | APCu only supports userland caching (and dumping) of variables, | |
34 | providing an upgrade path for the future. When O+ takes over, many | |
35 | will be tempted to use 3rd party solutions to userland caching, | |
36 | possibly even distributed solutions; this would be a grave error. The | |
37 | tried and tested APC codebase provides far superior support for local | |
38 | storage of PHP variables. | |
39 | ||
40 | %package -n apcu-panel | |
41 | Summary: APCu control panel | |
42 | Group: Applications/Networking | |
43 | Requires: %{name} = %{version}-%{release} | |
44 | Requires: php(gd) | |
45 | Requires: webapps | |
46 | Requires: webserver(access) | |
47 | Requires: webserver(php) >= 5.0 | |
48 | %if "%{_rpmversion}" >= "5" | |
49 | BuildArch: noarch | |
50 | %endif | |
51 | ||
52 | %description -n apcu-panel | |
53 | This package provides the APCu control panel, with Webserver | |
54 | configuration, available on <http://localhost/apcu-panel/> | |
55 | ||
56 | %prep | |
57 | %setup -qc | |
58 | mv %{modname}-%{version}/* . | |
59 | %patch0 -p1 | |
60 | cp -p %{SOURCE1} . | |
61 | ||
62 | %build | |
63 | phpize | |
64 | %configure \ | |
65 | --%{!?debug:dis}%{?debug:en}able-apcu-debug \ | |
66 | --enable-apcu-spinlocks \ | |
67 | --enable-apcu-mmap | |
68 | %{__make} | |
69 | ||
70 | %install | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | install -d $RPM_BUILD_ROOT{%{php_extensiondir},%{php_sysconfdir}/conf.d} | |
73 | install -p modules/apcu.so $RPM_BUILD_ROOT%{php_extensiondir}/%{modname}.so | |
74 | cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini | |
75 | ||
76 | # Install the Control Panel | |
77 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}} | |
78 | cp -p apc.php $RPM_BUILD_ROOT%{_appdir}/index.php | |
79 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
80 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
81 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config.php | |
82 | ||
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
86 | %post | |
87 | %php_webserver_restart | |
88 | ||
89 | %postun | |
90 | if [ "$1" = 0 ]; then | |
91 | %php_webserver_restart | |
92 | fi | |
93 | ||
94 | %triggerin -n apcu-panel -- apache1 < 1.3.37-3, apache1-base | |
95 | %webapp_register apache %{_webapp} | |
96 | ||
97 | %triggerun -n apcu-panel -- apache1 < 1.3.37-3, apache1-base | |
98 | %webapp_unregister apache %{_webapp} | |
99 | ||
100 | %triggerin -n apcu-panel -- apache < 2.2.0, apache-base | |
101 | %webapp_register httpd %{_webapp} | |
102 | ||
103 | %triggerun -n apcu-panel -- apache < 2.2.0, apache-base | |
104 | %webapp_unregister httpd %{_webapp} | |
105 | ||
106 | %files | |
107 | %defattr(644,root,root,755) | |
108 | %doc README.md NOTICE TECHNOTES.txt TODO INSTALL LICENSE | |
109 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
110 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so | |
111 | ||
112 | %files -n apcu-panel | |
113 | %defattr(644,root,root,755) | |
114 | %dir %attr(750,root,http) %{_sysconfdir} | |
115 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
116 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
117 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
118 | %{_appdir} |