]> git.pld-linux.org Git - packages/php-pecl-zstd.git/blame - php-pecl-zstd.spec
tests/streams_6.php requires openssl for https stream
[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} \
42 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="" \
43 RUN_TESTS_SETTINGS="-q $*"
44EOF
45chmod +x run-tests.sh
46
260423e2
ER
47%build
48phpize
c66b7e56
ER
49%configure \
50 --with-libzstd
260423e2
ER
51%{__make}
52
53# simple module load test
54%{__php} -n -q \
55 -d extension_dir=modules \
56 -d extension=%{modname}.so \
57 -m > modules.log
58grep %{modname} modules.log
59
36ee533e
ER
60%if %{with tests}
61./run-tests.sh --show-diff
62%endif
63
260423e2
ER
64%install
65rm -rf $RPM_BUILD_ROOT
66%{__make} install \
67 EXTENSION_DIR=%{php_extensiondir} \
68 INSTALL_ROOT=$RPM_BUILD_ROOT
69
70install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
71cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
72; Enable %{modname} extension module
73extension=%{modname}.so
74EOF
75
f13d7196
ER
76# no -devel yet
77%{__rm} $RPM_BUILD_ROOT%{php_includedir}/ext/zstd/php_zstd.h
78
260423e2
ER
79%clean
80rm -rf $RPM_BUILD_ROOT
81
82%post
83%php_webserver_restart
84
85%postun
86if [ "$1" = 0 ]; then
87 %php_webserver_restart
88fi
89
90%files
91%defattr(644,root,root,755)
c66b7e56 92%doc README.md
260423e2
ER
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.073984 seconds and 4 git commands to generate.