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