]> git.pld-linux.org Git - packages/php-xcache.git/blob - php-xcache.spec
- use php(core) as dependency to require php version
[packages/php-xcache.git] / php-xcache.spec
1 %define         modname xcache
2 Summary:        %{modname} - PHP opcode cacher
3 Summary(pl.UTF-8):      %{modname} - buforowanie opcodów PHP
4 Name:           php-%{modname}
5 Version:        2.0.1
6 Release:        4
7 License:        BSD
8 Group:          Development/Languages/PHP
9 URL:            http://xcache.lighttpd.net/
10 Source0:        http://xcache.lighttpd.net/pub/Releases/%{version}/xcache-%{version}.tar.bz2
11 # Source0-md5:  d3bc9645dc1b084c1eb45cfc4d8e9ccc
12 Source1:        %{modname}-apache.conf
13 Source2:        %{modname}-lighttpd.conf
14 Patch0:         ini.patch
15 BuildRequires:  php-devel >= 4:5.2.17-8
16 BuildRequires:  rpmbuild(macros) >= 1.344
17 BuildRequires:  sed >= 4.0
18 %{?requires_zend_extension}
19 Requires:       php(core) >= 5.0.4
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %define         _webapps        /etc/webapps
23 %define         _webapp         %{modname}
24 %define         _sysconfdir     %{_webapps}/%{_webapp}
25 %define         _appdir         %{_datadir}/%{_webapp}
26
27 %description
28 XCache is a fast, stable PHP opcode cacher that has been tested and is
29 now running on production servers under high load.
30
31 %description -l pl.UTF-8
32 XCache to szybkie, stabilne buforowanie opcodów PHP, przetestowane i
33 działające na produkcyjnych serwerach o dużym obciążeniu.
34
35 %package web
36 Summary:        WEB interface for xCache
37 Group:          Libraries
38 Requires:       %{name} = %{version}-%{release}
39 Requires:       webapps
40 Requires:       webserver(php) >= 5.0
41
42 %description web
43 Via this web interface script you can manage and view statistics of
44 xCache.
45
46 More information you can find at %{url}.
47
48 %prep
49 %setup -q -n %{modname}-%{version}
50 %patch0 -p1
51 %{__sed} -i.bak -e '
52         s,@extensiondir@,%{php_extensiondir},
53 ' xcache.ini
54
55 %build
56 phpize
57 %configure \
58         --enable-xcache \
59         --enable-xcache-optimizer \
60         --enable-xcache-coverager
61 %{__make}
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_sysconfdir}}
66
67 %{__make} install \
68         INSTALL_ROOT=$RPM_BUILD_ROOT
69
70 # The cache directory where pre-compiled files will reside
71 install -d $RPM_BUILD_ROOT/var/cache/php-%{modname}
72 install -d $RPM_BUILD_ROOT%{_appdir}
73
74 # Drop in the bit of configuration
75 cp -p xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
76 cp -a admin/* $RPM_BUILD_ROOT%{_appdir}
77
78 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
79 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
80 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %post
86 %php_webserver_restart
87
88 %postun
89 if [ "$1" = 0 ]; then
90         %php_webserver_restart
91 fi
92
93 %triggerin web -- apache1 < 1.3.37-3, apache1-base
94 %webapp_register apache %{_webapp}
95
96 %triggerun web -- apache1 < 1.3.37-3, apache1-base
97 %webapp_unregister apache %{_webapp}
98
99 %triggerin web -- apache < 2.2.0, apache-base
100 %webapp_register httpd %{_webapp}
101
102 %triggerun web -- apache < 2.2.0, apache-base
103 %webapp_unregister httpd %{_webapp}
104
105 %triggerin web -- lighttpd
106 %webapp_register lighttpd %{_webapp}
107
108 %triggerun web -- lighttpd
109 %webapp_unregister lighttpd %{_webapp}
110
111 %files
112 %defattr(644,root,root,755)
113 %doc AUTHORS README THANKS
114 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
115 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
116
117 # XXX: what for this dir is used?
118 %dir %attr(775,root,http) /var/cache/php-xcache
119
120 %files web
121 %defattr(644,root,root,755)
122 %dir %attr(750,root,http) %{_sysconfdir}
123 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
124 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
125 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
126 %{_appdir}
This page took 0.032024 seconds and 4 git commands to generate.