3 %bcond_without web # make web package
4 %bcond_without tests # build without tests
6 # on builders, build "web" only under php70
7 %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "70"
11 %define php_name php%{?php_suffix}
13 Summary: APCu - APC User Cache
14 Name: %{php_name}-pecl-%{modname}
18 Group: Development/Languages/PHP
19 Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
20 # Source0-md5: 0ef8be2ee8acb4dba5a66b247a254995
21 Source1: %{modname}.ini
25 URL: https://pecl.php.net/package/APCu/
26 BuildRequires: %{php_name}-devel >= 4:7.0.0
27 BuildRequires: %{php_name}-cli
28 BuildRequires: libtool
29 BuildRequires: rpmbuild(macros) >= 1.666
31 BuildRequires: %{php_name}-pcre
33 %{?requires_php_extension}
34 Provides: php(apcu) = %{version}
35 Obsoletes: php-pecl-apcu < 4.0.4-2
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 %define _webapps /etc/webapps
39 %define _webapp %{modname}
40 %define _sysconfdir %{_webapps}/%{_webapp}
41 %define _appdir %{_datadir}/%{_webapp}
44 APCu is userland caching: APC stripped of opcode caching in
45 preparation for the deployment of Zend Optimizer+ as the primary
46 solution to opcode caching in future versions of PHP.
48 APCu only supports userland caching (and dumping) of variables,
49 providing an upgrade path for the future. When O+ takes over, many
50 will be tempted to use 3rd party solutions to userland caching,
51 possibly even distributed solutions; this would be a grave error. The
52 tried and tested APC codebase provides far superior support for local
53 storage of PHP variables.
56 Summary: APCu developer files (header)
57 Group: Development/Libraries
58 Requires: %{php_name}-devel
59 # does not require base
62 These are the files needed to compile programs using Igbinary
64 %package -n apcu-panel
65 Summary: APCu control panel
66 Group: Applications/Networking
67 Requires: php(apcu) = %{version}
70 Requires: webserver(access)
71 Requires: webserver(php) >= 5.0
72 %if "%{_rpmversion}" >= "5"
76 %description -n apcu-panel
77 This package provides the APCu control panel, with Webserver
78 configuration, available on <http://localhost/apcu-panel/>
82 mv %{modname}-%{version}/* .
86 cat <<'EOF' > run-tests.sh
88 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
90 PHP_EXECUTABLE=%{__php} \
91 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre" \
92 RUN_TESTS_SETTINGS="-q $*"
100 --%{!?debug:dis}%{?debug:en}able-apcu-debug \
101 --enable-apcu-spinlocks \
105 # simple module load test
107 -d extension_dir=modules \
108 -d extension=%{php_extensiondir}/spl.so \
109 -d extension=%{modname}.so \
111 grep %{modname} modules.log
114 ./run-tests.sh --show-diff
118 rm -rf $RPM_BUILD_ROOT
120 EXTENSION_DIR=%{php_extensiondir} \
121 INSTALL_ROOT=$RPM_BUILD_ROOT
123 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
124 cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
126 # Install the Control Panel
128 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
129 cp -p apc.php $RPM_BUILD_ROOT%{_appdir}/index.php
130 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
131 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
132 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
136 rm -rf $RPM_BUILD_ROOT
139 %php_webserver_restart
142 if [ "$1" = 0 ]; then
143 %php_webserver_restart
146 %triggerin -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
147 %webapp_register apache %{_webapp}
149 %triggerun -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
150 %webapp_unregister apache %{_webapp}
152 %triggerin -n apcu-panel -- apache < 2.2.0, apache-base
153 %webapp_register httpd %{_webapp}
155 %triggerun -n apcu-panel -- apache < 2.2.0, apache-base
156 %webapp_unregister httpd %{_webapp}
159 %defattr(644,root,root,755)
160 %doc README.md NOTICE TECHNOTES.txt TODO INSTALL LICENSE
161 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
162 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
165 %defattr(644,root,root,755)
166 %{_includedir}/php/ext/%{modname}
170 %defattr(644,root,root,755)
171 %dir %attr(750,root,http) %{_sysconfdir}
172 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
173 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
174 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php