3 %bcond_without web # make web package
5 # on builders, build "web" only under php70
6 %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "70"
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: https://pecl.php.net/get/%{modname}-%{version}.tgz
19 # Source0-md5: 0ef8be2ee8acb4dba5a66b247a254995
20 Source1: %{modname}.ini
24 URL: https://pecl.php.net/package/APCu/
25 BuildRequires: %{php_name}-devel >= 4:7.0.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.
51 Summary: APCu developer files (header)
52 Group: Development/Libraries
53 Requires: %{php_name}-devel
54 # does not require base
57 These are the files needed to compile programs using Igbinary
59 %package -n apcu-panel
60 Summary: APCu control panel
61 Group: Applications/Networking
62 Requires: php(apcu) = %{version}
65 Requires: webserver(access)
66 Requires: webserver(php) >= 5.0
67 %if "%{_rpmversion}" >= "5"
71 %description -n apcu-panel
72 This package provides the APCu control panel, with Webserver
73 configuration, available on <http://localhost/apcu-panel/>
77 mv %{modname}-%{version}/* .
85 --%{!?debug:dis}%{?debug:en}able-apcu-debug \
86 --enable-apcu-spinlocks \
91 rm -rf $RPM_BUILD_ROOT
93 EXTENSION_DIR=%{php_extensiondir} \
94 INSTALL_ROOT=$RPM_BUILD_ROOT
96 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
97 cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
99 # Install the Control Panel
101 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
102 cp -p apc.php $RPM_BUILD_ROOT%{_appdir}/index.php
103 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
104 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
105 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
109 rm -rf $RPM_BUILD_ROOT
112 %php_webserver_restart
115 if [ "$1" = 0 ]; then
116 %php_webserver_restart
119 %triggerin -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
120 %webapp_register apache %{_webapp}
122 %triggerun -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
123 %webapp_unregister apache %{_webapp}
125 %triggerin -n apcu-panel -- apache < 2.2.0, apache-base
126 %webapp_register httpd %{_webapp}
128 %triggerun -n apcu-panel -- apache < 2.2.0, apache-base
129 %webapp_unregister httpd %{_webapp}
132 %defattr(644,root,root,755)
133 %doc README.md NOTICE TECHNOTES.txt TODO INSTALL LICENSE
134 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
135 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
138 %defattr(644,root,root,755)
139 %{_includedir}/php/ext/%{modname}
143 %defattr(644,root,root,755)
144 %dir %attr(750,root,http) %{_sysconfdir}
145 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
146 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
147 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php