]> git.pld-linux.org Git - packages/php-pecl-zstd.git/blame - php-pecl-zstd.spec
XFAIL tests failing on x32
[packages/php-pecl-zstd.git] / php-pecl-zstd.spec
CommitLineData
260423e2
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
043b5a62 4%bcond_without tests_online # build without online tests
260423e2 5
720a7792
ER
6%if 0%{?_pld_builder:1}
7%undefine with_tests_online
8%endif
9
260423e2
ER
10%define php_name php%{?php_suffix}
11%define modname zstd
12Summary: %{modname} - Zstandard extension
13Name: %{php_name}-pecl-%{modname}
14Version: 0.8.0
15Release: 1
16License: PHP 3.01
17Group: Development/Languages/PHP
18Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
19# Source0-md5: 6ca4a5f81a2acb47d9ae4fa1d2440434
20URL: https://pecl.php.net/package/zstd/
21BuildRequires: %{php_name}-cli
22BuildRequires: %{php_name}-devel
23BuildRequires: rpmbuild(macros) >= 1.666
c66b7e56 24BuildRequires: zstd-devel
36ee533e 25%if %{with tests}
b2a79601 26BuildRequires: %{php_name}-openssl
36ee533e
ER
27BuildRequires: %{php_name}-pcre
28%endif
260423e2
ER
29%{?requires_php_extension}
30Provides: php(%{modname}) = %{version}
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34PHP extension for compression and decompression with Zstandard
35library.
36
37%prep
38%setup -qc
39mv %{modname}-%{version}/* .
c66b7e56 40rm -r zstd
260423e2 41
36ee533e
ER
42cat <<'EOF' > run-tests.sh
43#!/bin/sh
44export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
45exec %{__make} test \
46 PHP_EXECUTABLE=%{__php} \
2c573e84 47 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="openssl" \
36ee533e
ER
48 RUN_TESTS_SETTINGS="-q $*"
49EOF
50chmod +x run-tests.sh
51
eaab609c
ER
52xfail() {
53 local t=$1
54 test -f $t
55 cat >> $t <<-EOF
56
57 --XFAIL--
58 Skip
59 EOF
60}
61
62while read line; do
63 t=${line##*\[}; t=${t%\]}
64 xfail $t
65done << 'EOF'
66zstd_compress(): compress level [tests/008.phpt]
d9f32f45
ER
67%ifarch x32
68zstd_compress(): basic functionality [tests/001.phpt]
69zstd_compress(): variation [tests/003.phpt]
70namespace: Zstd\compress()/uncompress() [tests/007.phpt]
71zstd_compress(): compress level [tests/009.phpt]
72%endif
eaab609c
ER
73EOF
74
260423e2
ER
75%build
76phpize
c66b7e56
ER
77%configure \
78 --with-libzstd
260423e2
ER
79%{__make}
80
81# simple module load test
82%{__php} -n -q \
83 -d extension_dir=modules \
84 -d extension=%{modname}.so \
85 -m > modules.log
86grep %{modname} modules.log
87
36ee533e 88%if %{with tests}
043b5a62 89%{!?tests_online:SKIP_ONLINE_TESTS=1} \
36ee533e
ER
90./run-tests.sh --show-diff
91%endif
92
260423e2
ER
93%install
94rm -rf $RPM_BUILD_ROOT
95%{__make} install \
96 EXTENSION_DIR=%{php_extensiondir} \
97 INSTALL_ROOT=$RPM_BUILD_ROOT
98
99install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
100cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
101; Enable %{modname} extension module
102extension=%{modname}.so
103EOF
104
f13d7196
ER
105# no -devel yet
106%{__rm} $RPM_BUILD_ROOT%{php_includedir}/ext/zstd/php_zstd.h
107
260423e2
ER
108%clean
109rm -rf $RPM_BUILD_ROOT
110
111%post
112%php_webserver_restart
113
114%postun
115if [ "$1" = 0 ]; then
116 %php_webserver_restart
117fi
118
119%files
120%defattr(644,root,root,755)
c66b7e56 121%doc README.md
260423e2
ER
122%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
123%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.119812 seconds and 4 git commands to generate.