]> git.pld-linux.org Git - packages/php-pecl-varnish.git/blob - php-pecl-varnish.spec
up to 1.2.1
[packages/php-pecl-varnish.git] / php-pecl-varnish.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname varnish
7 Summary:        Varnish Cache bindings
8 Name:           %{php_name}-pecl-%{modname}
9 Version:        1.2.1
10 Release:        1
11 License:        BSD
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)
23
24 %description
25 Varnish Cache is an open source, state of the art web application
26 accelerator.
27
28 The extension makes it possible to interact with a running varnish
29 instance through TCP socket or shared memory.
30
31 %prep
32 %setup -qc
33 mv %{modname}-%{version}/* .
34
35 %build
36 phpize
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
47 grep %{modname} modules.log
48
49 export 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
56 rm -rf $RPM_BUILD_ROOT
57 %{__make} install \
58         EXTENSION_DIR=%{php_extensiondir} \
59         INSTALL_ROOT=$RPM_BUILD_ROOT
60
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
65 EOF
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70 %post
71 %php_webserver_restart
72
73 %postun
74 if [ "$1" = 0 ]; then
75         %php_webserver_restart
76 fi
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.099187 seconds and 3 git commands to generate.