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