]> git.pld-linux.org Git - packages/php-pecl-apcu_bc.git/blame - php-pecl-apcu_bc.spec
ext-pcre for tests on php72
[packages/php-pecl-apcu_bc.git] / php-pecl-apcu_bc.spec
CommitLineData
83684d57
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
ff2179ce
ER
5%define php_name php%{?php_suffix}
6%define modname apcu_bc
7Summary: APCu Backwards Compatibility Module
8Name: %{php_name}-pecl-%{modname}
9Version: 1.0.3
10Release: 1
11License: PHP 3.01
12Group: Development/Languages/PHP
13Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
14# Source0-md5: 2ba61ea2cf887814e702e25ad7f1a5e1
15URL: https://pecl.php.net/package/apcu_bc
83684d57 16BuildRequires: %{php_name}-cli
ff2179ce
ER
17BuildRequires: %{php_name}-devel >= 4:7.0.0
18BuildRequires: %{php_name}-pecl-apcu-devel
19BuildRequires: rpmbuild(macros) >= 1.666
83684d57 20%if %{with tests}
2ee0403b 21BuildRequires: %{php_name}-pcre
83684d57
ER
22BuildRequires: %{php_name}-pecl-apcu
23%endif
ff2179ce
ER
24%{?requires_php_extension}
25Requires: %{php_name}-pecl-apcu
26Provides: php(apcu) = %{version}
27Provides: php(apcu_bc) = %{version}
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%description
31This module provides a backwards APC compatible API using APCu.
32
33%prep
34%setup -qc
35mv %{modname}-%{version}/* .
36
83684d57
ER
37cat <<'EOF' > run-tests.sh
38#!/bin/sh
39export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
40exec %{__make} test \
41 PHP_EXECUTABLE=%{__php} \
2ee0403b 42 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre apcu" \
83684d57
ER
43 RUN_TESTS_SETTINGS="-q $*"
44EOF
45chmod +x run-tests.sh
46
ff2179ce
ER
47%build
48phpize
49%configure
50%{__make}
51
83684d57
ER
52# simple module load test
53%{__php} -n -q \
54 -d extension_dir=modules \
55 -d extension=%{php_extensiondir}/apcu.so \
56 -d extension=apc.so \
57 -m > modules.log
58grep apc modules.log
59
60%if %{with tests}
61./run-tests.sh --show-diff
62%endif
63
ff2179ce
ER
64%install
65rm -rf $RPM_BUILD_ROOT
66%{__make} install \
67 EXTENSION_DIR=%{php_extensiondir} \
68 INSTALL_ROOT=$RPM_BUILD_ROOT
69
70# ext filename not important, rename for simplicity
71mv $RPM_BUILD_ROOT%{php_extensiondir}/{apc,%{modname}}.so
72
73install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
74cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
75; Enable %{modname} extension module
76extension=%{modname}.so
77EOF
78
79%clean
80rm -rf $RPM_BUILD_ROOT
81
82%post
83%php_webserver_restart
84
85%postun
86if [ "$1" = 0 ]; then
87 %php_webserver_restart
88fi
89
90%files
91%defattr(644,root,root,755)
92%doc README.md
93%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
94%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.131801 seconds and 4 git commands to generate.