]> git.pld-linux.org Git - packages/php-pecl-apcu_bc.git/blob - php-pecl-apcu_bc.spec
68bc16c30966a4f7b86efa819c411737b329059a
[packages/php-pecl-apcu_bc.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}-pecl-apcu
22 %endif
23 %{?requires_php_extension}
24 Requires:       %{php_name}-pecl-apcu
25 Provides:       php(apcu) = %{version}
26 Provides:       php(apcu_bc) = %{version}
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 This module provides a backwards APC compatible API using APCu.
31
32 %prep
33 %setup -qc
34 mv %{modname}-%{version}/* .
35
36 cat <<'EOF' > run-tests.sh
37 #!/bin/sh
38 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
39 exec %{__make} test \
40         PHP_EXECUTABLE=%{__php} \
41         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="apcu" \
42         RUN_TESTS_SETTINGS="-q $*"
43 EOF
44 chmod +x run-tests.sh
45
46 %build
47 phpize
48 %configure
49 %{__make}
50
51 # simple module load test
52 %{__php} -n -q \
53         -d extension_dir=modules \
54         -d extension=%{php_extensiondir}/apcu.so \
55         -d extension=apc.so \
56         -m > modules.log
57 grep apc modules.log
58
59 %if %{with tests}
60 ./run-tests.sh --show-diff
61 %endif
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 %{__make} install \
66         EXTENSION_DIR=%{php_extensiondir} \
67         INSTALL_ROOT=$RPM_BUILD_ROOT
68
69 # ext filename not important, rename for simplicity
70 mv $RPM_BUILD_ROOT%{php_extensiondir}/{apc,%{modname}}.so
71
72 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
73 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
74 ; Enable %{modname} extension module
75 extension=%{modname}.so
76 EOF
77
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 %post
82 %php_webserver_restart
83
84 %postun
85 if [ "$1" = 0 ]; then
86         %php_webserver_restart
87 fi
88
89 %files
90 %defattr(644,root,root,755)
91 %doc README.md
92 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
93 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.058287 seconds and 2 git commands to generate.