]> git.pld-linux.org Git - packages/php-pecl-ds.git/blame - php-pecl-ds.spec
- rel 4
[packages/php-pecl-ds.git] / php-pecl-ds.spec
CommitLineData
228ceb1c
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
5%define php_name php%{?php_suffix}
6%define modname ds
7Summary: Data Structures
8Name: %{php_name}-pecl-%{modname}
9Version: 1.2.8
9f82ebde 10Release: 4
228ceb1c
ER
11License: MIT
12Group: Development/Languages/PHP
13Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
14# Source0-md5: be49f6819ff5049cd623a008243da999
15URL: https://pecl.php.net/package/ds/
16BuildRequires: %{php_name}-cli
17BuildRequires: %{php_name}-devel >= 4:7.0
18BuildRequires: %{php_name}-json
cb52586e 19BuildRequires: %{php_name}-pcre
228ceb1c
ER
20BuildRequires: %{php_name}-spl
21BuildRequires: rpmbuild(macros) >= 1.666
22%if %{with tests}
23%endif
24%{?requires_php_extension}
25Requires: %{php_name}-json
26Requires: %{php_name}-spl
27Provides: php(%{modname}) = %{version}
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%description
31Data Structures for PHP 7.
32
33%prep
34%setup -qc
35mv %{modname}-%{version}/* .
36
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} \
cb52586e 42 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl json" \
228ceb1c
ER
43 RUN_TESTS_SETTINGS="-q $*"
44EOF
45chmod +x run-tests.sh
46
47%build
48phpize
49%configure
50%{__make}
51
52# simple module load test
53%{__php} -n -q \
54 -d extension_dir=modules \
cb52586e 55 -d extension=%{php_extensiondir}/pcre.so \
228ceb1c
ER
56 -d extension=%{php_extensiondir}/spl.so \
57 -d extension=%{php_extensiondir}/json.so \
58 -d extension=%{modname}.so \
59 -m > modules.log
60grep %{modname} modules.log
61
62%if %{with tests}
63./run-tests.sh --show-diff
64%endif
65
66%install
67rm -rf $RPM_BUILD_ROOT
68install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
69install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
70
71%{__make} install \
72 EXTENSION_DIR=%{php_extensiondir} \
73 INSTALL_ROOT=$RPM_BUILD_ROOT
74
75install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
438d3855 76cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/json_%{modname}.ini
228ceb1c
ER
77; Enable %{modname} extension module
78extension=%{modname}.so
79EOF
80
81%clean
82rm -rf $RPM_BUILD_ROOT
83
84%post
85%php_webserver_restart
86
87%postun
88if [ "$1" = 0 ]; then
89 %php_webserver_restart
90fi
91
92%files
93%defattr(644,root,root,755)
94%doc LICENSE
438d3855 95%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/*%{modname}.ini
228ceb1c 96%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.079719 seconds and 4 git commands to generate.