]> git.pld-linux.org Git - packages/php-pecl-varnish.git/blame - php-pecl-varnish.spec
up to 1.2.1
[packages/php-pecl-varnish.git] / php-pecl-varnish.spec
CommitLineData
7069fbc9
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
5%define php_name php%{?php_suffix}
6%define modname varnish
7Summary: Varnish Cache bindings
8Name: %{php_name}-pecl-%{modname}
9b532b22 9Version: 1.2.1
7069fbc9
ER
10Release: 1
11License: BSD
12Group: Development/Languages/PHP
13Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
9b532b22 14# Source0-md5: fb8a483ac36bf749356462833cd0702f
7069fbc9
ER
15URL: http://pecl.php.net/package/varnish/
16%{?with_tests:BuildRequires: %{php_name}-cli}
17%{?with_tests:BuildRequires: %{php_name}-hash}
18BuildRequires: %{php_name}-devel
19BuildRequires: rpmbuild(macros) >= 1.666
20%{?requires_php_extension}
21Provides: php(varnish) = %{version}
22BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24%description
25Varnish Cache is an open source, state of the art web application
26accelerator.
27
28The extension makes it possible to interact with a running varnish
29instance through TCP socket or shared memory.
30
31%prep
32%setup -qc
33mv %{modname}-%{version}/* .
34
35%build
36phpize
37%configure
38%{__make}
39
40%if %{with tests}
41# simple module load test
42%{__php} -n -q \
43 -d extension_dir=modules \
44 -d extension=%{php_extensiondir}/hash.so \
45 -d extension=%{modname}.so \
46 -m > modules.log
47grep %{modname} modules.log
48
49export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
50%{__make} test \
51 PHP_EXECUTABLE=%{__php} \
52 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="hash"
53%endif
54
55%install
56rm -rf $RPM_BUILD_ROOT
57%{__make} install \
58 EXTENSION_DIR=%{php_extensiondir} \
59 INSTALL_ROOT=$RPM_BUILD_ROOT
60
61install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
62cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
63; Enable %{modname} extension module
64extension=%{modname}.so
65EOF
66
67%clean
68rm -rf $RPM_BUILD_ROOT
69
70%post
71%php_webserver_restart
72
73%postun
74if [ "$1" = 0 ]; then
75 %php_webserver_restart
76fi
77
78%files
79%defattr(644,root,root,755)
80%doc CREDITS LICENSE
81%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
82%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.075562 seconds and 4 git commands to generate.