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