3 %bcond_without web # make web package
5 # don't build for php53
6 %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "55"
10 %define php_name php%{?php_suffix}
12 Summary: APCu - APC User Cache
13 Name: %{php_name}-pecl-%{modname}
17 Group: Development/Languages/PHP
18 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
19 # Source0-md5: 9feb03d3e5217242a39244964f098b52
20 Source1: %{modname}.ini
24 URL: http://pecl.php.net/package/APCu/
25 BuildRequires: %{php_name}-devel >= 4:5.1.0
26 BuildRequires: libtool
27 BuildRequires: rpmbuild(macros) >= 1.666
28 %{?requires_php_extension}
29 Provides: php(apcu) = %{version}
30 Obsoletes: php-pecl-apcu < 4.0.4-2
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define _webapps /etc/webapps
34 %define _webapp %{modname}
35 %define _sysconfdir %{_webapps}/%{_webapp}
36 %define _appdir %{_datadir}/%{_webapp}
39 APCu is userland caching: APC stripped of opcode caching in
40 preparation for the deployment of Zend Optimizer+ as the primary
41 solution to opcode caching in future versions of PHP.
43 APCu only supports userland caching (and dumping) of variables,
44 providing an upgrade path for the future. When O+ takes over, many
45 will be tempted to use 3rd party solutions to userland caching,
46 possibly even distributed solutions; this would be a grave error. The
47 tried and tested APC codebase provides far superior support for local
48 storage of PHP variables.
50 %package -n apcu-panel
51 Summary: APCu control panel
52 Group: Applications/Networking
53 Requires: php(apcu) = %{version}
56 Requires: webserver(access)
57 Requires: webserver(php) >= 5.0
58 %if "%{_rpmversion}" >= "5"
62 %description -n apcu-panel
63 This package provides the APCu control panel, with Webserver
64 configuration, available on <http://localhost/apcu-panel/>
68 mv %{modname}-%{version}/* .
76 --%{!?debug:dis}%{?debug:en}able-apcu-debug \
77 --enable-apcu-spinlocks \
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT{%{php_extensiondir},%{php_sysconfdir}/conf.d}
84 install -p modules/apcu.so $RPM_BUILD_ROOT%{php_extensiondir}/%{modname}.so
85 cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
87 # Install the Control Panel
89 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
90 cp -p apc.php $RPM_BUILD_ROOT%{_appdir}/index.php
91 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
92 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
93 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
97 rm -rf $RPM_BUILD_ROOT
100 %php_webserver_restart
103 if [ "$1" = 0 ]; then
104 %php_webserver_restart
107 %triggerin -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
108 %webapp_register apache %{_webapp}
110 %triggerun -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
111 %webapp_unregister apache %{_webapp}
113 %triggerin -n apcu-panel -- apache < 2.2.0, apache-base
114 %webapp_register httpd %{_webapp}
116 %triggerun -n apcu-panel -- apache < 2.2.0, apache-base
117 %webapp_unregister httpd %{_webapp}
120 %defattr(644,root,root,755)
121 %doc README.md NOTICE TECHNOTES.txt TODO INSTALL LICENSE
122 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
123 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
127 %defattr(644,root,root,755)
128 %dir %attr(750,root,http) %{_sysconfdir}
129 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
130 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
131 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php