]> git.pld-linux.org Git - SPECS.git/blob - php-pecl-apcu_bc.spec
SPECS updated Sat 31 Jul 20:27:02 CEST 2021
[SPECS.git] / php-pecl-apcu_bc.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname apcu_bc
7 Summary:        APCu Backwards Compatibility Module
8 Name:           %{php_name}-pecl-%{modname}
9 Version:        1.0.3
10 Release:        1
11 License:        PHP 3.01
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
20 %if %{with tests}
21 BuildRequires:  %{php_name}-pcre
22 BuildRequires:  %{php_name}-pecl-apcu
23 %endif
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)
29
30 %description
31 This module provides a backwards APC compatible API using APCu.
32
33 %prep
34 %setup -qc
35 mv %{modname}-%{version}/* .
36
37 cat <<'EOF' > run-tests.sh
38 #!/bin/sh
39 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
40 exec %{__make} test \
41         PHP_EXECUTABLE=%{__php} \
42         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre apcu" \
43         RUN_TESTS_SETTINGS="-q $*"
44 EOF
45 chmod +x run-tests.sh
46
47 %build
48 phpize
49 %configure
50 %{__make}
51
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
58 grep apc modules.log
59
60 %if %{with tests}
61 ./run-tests.sh --show-diff
62 %endif
63
64 %install
65 rm -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
71 mv $RPM_BUILD_ROOT%{php_extensiondir}/{apc,%{modname}}.so
72
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
77 EOF
78
79 %clean
80 rm -rf $RPM_BUILD_ROOT
81
82 %post
83 %php_webserver_restart
84
85 %postun
86 if [ "$1" = 0 ]; then
87         %php_webserver_restart
88 fi
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.304682 seconds and 3 git commands to generate.