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