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