]> git.pld-linux.org Git - packages/php-pecl-zstd.git/blame - php-pecl-zstd.spec
Build using system zstd-devel
[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
260423e2
ER
20%{?requires_php_extension}
21Provides: php(%{modname}) = %{version}
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24%description
25PHP extension for compression and decompression with Zstandard
26library.
27
28%prep
29%setup -qc
30mv %{modname}-%{version}/* .
c66b7e56 31rm -r zstd
260423e2
ER
32
33%build
34phpize
c66b7e56
ER
35%configure \
36 --with-libzstd
260423e2
ER
37%{__make}
38
39# simple module load test
40%{__php} -n -q \
41 -d extension_dir=modules \
42 -d extension=%{modname}.so \
43 -m > modules.log
44grep %{modname} modules.log
45
46%install
47rm -rf $RPM_BUILD_ROOT
48%{__make} install \
49 EXTENSION_DIR=%{php_extensiondir} \
50 INSTALL_ROOT=$RPM_BUILD_ROOT
51
52install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
53cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
54; Enable %{modname} extension module
55extension=%{modname}.so
56EOF
57
58%clean
59rm -rf $RPM_BUILD_ROOT
60
61%post
62%php_webserver_restart
63
64%postun
65if [ "$1" = 0 ]; then
66 %php_webserver_restart
67fi
68
69%files
70%defattr(644,root,root,755)
c66b7e56 71%doc README.md
260423e2
ER
72%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
73%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.75004 seconds and 4 git commands to generate.