3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname varnish
7 Summary: Varnish Cache bindings
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Languages/PHP
13 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5: fb8a483ac36bf749356462833cd0702f
15 URL: http://pecl.php.net/package/varnish/
16 %{?with_tests:BuildRequires: %{php_name}-cli}
17 %{?with_tests:BuildRequires: %{php_name}-hash}
18 BuildRequires: %{php_name}-devel
19 BuildRequires: rpmbuild(macros) >= 1.666
20 %{?requires_php_extension}
21 Provides: php(varnish) = %{version}
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 Varnish Cache is an open source, state of the art web application
28 The extension makes it possible to interact with a running varnish
29 instance through TCP socket or shared memory.
33 mv %{modname}-%{version}/* .
41 # simple module load test
43 -d extension_dir=modules \
44 -d extension=%{php_extensiondir}/hash.so \
45 -d extension=%{modname}.so \
47 grep %{modname} modules.log
49 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
51 PHP_EXECUTABLE=%{__php} \
52 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="hash"
56 rm -rf $RPM_BUILD_ROOT
58 EXTENSION_DIR=%{php_extensiondir} \
59 INSTALL_ROOT=$RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
62 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
63 ; Enable %{modname} extension module
64 extension=%{modname}.so
68 rm -rf $RPM_BUILD_ROOT
71 %php_webserver_restart
75 %php_webserver_restart
79 %defattr(644,root,root,755)
81 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
82 %attr(755,root,root) %{php_extensiondir}/%{modname}.so