3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname apcu_bc
7 Summary: APCu Backwards Compatibility Module
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Languages/PHP
13 Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5: 2ba61ea2cf887814e702e25ad7f1a5e1
15 URL: https://pecl.php.net/package/apcu_bc
16 BuildRequires: %{php_name}-cli
17 BuildRequires: %{php_name}-devel >= 4:7.0.0
18 BuildRequires: %{php_name}-pecl-apcu-devel
19 BuildRequires: rpmbuild(macros) >= 1.666
21 BuildRequires: %{php_name}-pcre
22 BuildRequires: %{php_name}-pecl-apcu
24 %{?requires_php_extension}
25 Requires: %{php_name}-pecl-apcu
26 Provides: php(apcu) = %{version}
27 Provides: php(apcu_bc) = %{version}
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 This module provides a backwards APC compatible API using APCu.
35 mv %{modname}-%{version}/* .
37 cat <<'EOF' > run-tests.sh
39 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
41 PHP_EXECUTABLE=%{__php} \
42 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre apcu" \
43 RUN_TESTS_SETTINGS="-q $*"
52 # simple module load test
54 -d extension_dir=modules \
55 -d extension=%{php_extensiondir}/apcu.so \
61 ./run-tests.sh --show-diff
65 rm -rf $RPM_BUILD_ROOT
67 EXTENSION_DIR=%{php_extensiondir} \
68 INSTALL_ROOT=$RPM_BUILD_ROOT
70 # ext filename not important, rename for simplicity
71 mv $RPM_BUILD_ROOT%{php_extensiondir}/{apc,%{modname}}.so
73 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
74 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
75 ; Enable %{modname} extension module
76 extension=%{modname}.so
80 rm -rf $RPM_BUILD_ROOT
83 %php_webserver_restart
87 %php_webserver_restart
91 %defattr(644,root,root,755)
93 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
94 %attr(755,root,root) %{php_extensiondir}/%{modname}.so