3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
8 Summary(pl.UTF-8): %{modname} -
9 Name: %{php_name}-pecl-%{modname}
13 Group: Development/Languages/PHP
14 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
16 URL: http://pecl.php.net/package/modname/
17 %{?with_tests:BuildRequires: %{php_name}-cli}
18 BuildRequires: %{php_name}-devel
19 BuildRequires: rpmbuild(macros) >= 1.666
20 %{?requires_php_extension}
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %description -l pl.UTF-8
29 mv %{modname}-%{version}/* .
37 # simple module load test
39 -d extension_dir=modules \
40 -d extension=%{modname}.so \
42 grep %{modname} modules.log
44 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
46 PHP_EXECUTABLE=%{__php}
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
52 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
53 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
56 EXTENSION_DIR=%{php_extensiondir} \
57 INSTALL_ROOT=$RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
60 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
61 ; Enable %{modname} extension module
62 extension=%{modname}.so
65 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
66 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
69 rm -rf $RPM_BUILD_ROOT
72 %php_webserver_restart
76 %php_webserver_restart
80 %defattr(644,root,root,755)
81 %doc CREDITS EXPERIMENTAL
82 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
83 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
84 %{_examplesdir}/%{name}-%{version}