1 %define _modname xcache
2 Summary: %{_modname} - PHP opcode cacher
3 Summary(pl.UTF-8): %{_modname} - buforowanie opcodów PHP
8 Group: Development/Languages/PHP
9 URL: http://xcache.lighttpd.net/
10 Source0: http://xcache.lighttpd.net/pub/Releases/1.2.1/xcache-%{version}.tar.bz2
11 # Source0-md5: 42133468871c573c397b8375dc8c19b6
12 BuildRequires: php-devel >= 3:5.1
13 BuildRequires: rpmbuild(macros) >= 1.344
14 BuildRequires: sed >= 4.0
15 %{?requires_zend_extension}
16 Requires: php-common >= 4:5.0.4
17 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19 %define _webapps /etc/webapps
20 %define _webapp xcache
21 %define _sysconfdir %{_webapps}/%{_webapp}
22 %define _appdir %{_datadir}/%{_webapp}
25 XCache is a fast, stable PHP opcode cacher that has been tested and is
26 now running on production servers under high load.
28 %description -l pl.UTF-8
29 XCache to szybkie, stabilne buforowanie opcodów PHP, przetestowane i
30 działające na produkcyjnych serwerach o dużym obciążeniu.
33 %setup -q -n xcache-%{version}
35 s,zend_extension =.*,zend_extension = %{php_extensiondir}/xcache.so,
36 s,zend_extension_ts = .*,zend_extension_ts = %{php_extensiondir}/xcache.so,
39 cat > apache.conf <<'EOF'
40 Alias /xcache %{_appdir}
41 <Directory %{_appdir}>
50 --enable-xcache-optimizer \
51 --enable-xcache-coverager
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_sysconfdir}}
59 INSTALL_ROOT=$RPM_BUILD_ROOT
61 # The cache directory where pre-compiled files will reside
62 install -d $RPM_BUILD_ROOT/var/cache/php-xcache
63 install -d $RPM_BUILD_ROOT%{_appdir}
65 # Drop in the bit of configuration
66 install xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{_modname}.ini
67 install admin/* $RPM_BUILD_ROOT%{_appdir}
69 install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
70 install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
73 rm -rf $RPM_BUILD_ROOT
76 %php_webserver_restart
80 %php_webserver_restart
83 %triggerin -- apache1 < 1.3.37-3, apache1-base
84 %webapp_register apache %{_webapp}
86 %triggerun -- apache1 < 1.3.37-3, apache1-base
87 %webapp_unregister apache %{_webapp}
89 %triggerin -- apache < 2.2.0, apache-base
90 %webapp_register httpd %{_webapp}
92 %triggerun -- apache < 2.2.0, apache-base
93 %webapp_unregister httpd %{_webapp}
96 %defattr(644,root,root,755)
97 %doc AUTHORS README THANKS
98 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
99 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
100 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{_modname}.ini
101 %attr(755,root,root) %{php_extensiondir}/%{_modname}.so
103 %dir %attr(775,root,http) /var/cache/php-xcache