]>
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 |
9d1b1092 | 6 | Release: 3 |
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 | |
9d1b1092 ER |
14 | Patch0: ini.patch |
15 | BuildRequires: php-devel >= 4:5.2.17-8 | |
e9d7bfa1 | 16 | BuildRequires: rpmbuild(macros) >= 1.344 |
99ae26ca | 17 | BuildRequires: sed >= 4.0 |
22775bf0 | 18 | %{?requires_zend_extension} |
e9d7bfa1 | 19 | Requires: php-common >= 4:5.0.4 |
82f5b15c ER |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
21 | ||
e89262a8 | 22 | %define _webapps /etc/webapps |
e35cf769 | 23 | %define _webapp %{modname} |
e89262a8 ER |
24 | %define _sysconfdir %{_webapps}/%{_webapp} |
25 | %define _appdir %{_datadir}/%{_webapp} | |
26 | ||
82f5b15c | 27 | %description |
99ae26ca ER |
28 | XCache is a fast, stable PHP opcode cacher that has been tested and is |
29 | now running on production servers under high load. | |
82f5b15c | 30 | |
b3c5667f JR |
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. | |
822de9e6 | 34 | |
e35cf769 ER |
35 | %package web |
36 | Summary: WEB interface for xCache | |
37 | Group: Libraries | |
eeb07124 | 38 | Requires: %{name} = %{version}-%{release} |
e35cf769 ER |
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 | ||
82f5b15c | 48 | %prep |
e35cf769 | 49 | %setup -q -n %{modname}-%{version} |
9d1b1092 ER |
50 | %patch0 -p1 |
51 | %{__sed} -i.bak -e ' | |
52 | s,@extensiondir@,%{php_extensiondir}, | |
82f5b15c ER |
53 | ' xcache.ini |
54 | ||
2405d2a6 ER |
55 | %build |
56 | phpize | |
57 | %configure \ | |
58 | --enable-xcache \ | |
59 | --enable-xcache-optimizer \ | |
60 | --enable-xcache-coverager | |
718c7b68 | 61 | %{__make} |
2405d2a6 | 62 | |
82f5b15c ER |
63 | %install |
64 | rm -rf $RPM_BUILD_ROOT | |
e89262a8 | 65 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_sysconfdir}} |
82f5b15c ER |
66 | |
67 | %{__make} install \ | |
68 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
69 | ||
2405d2a6 | 70 | # The cache directory where pre-compiled files will reside |
e35cf769 | 71 | install -d $RPM_BUILD_ROOT/var/cache/php-%{modname} |
e89262a8 | 72 | install -d $RPM_BUILD_ROOT%{_appdir} |
2405d2a6 ER |
73 | |
74 | # Drop in the bit of configuration | |
eeb07124 | 75 | cp -p xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
d62ebf8e | 76 | cp -a admin/* $RPM_BUILD_ROOT%{_appdir} |
e89262a8 | 77 | |
eeb07124 ER |
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 | |
82f5b15c ER |
81 | |
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %post | |
e9d7bfa1 | 86 | %php_webserver_restart |
82f5b15c ER |
87 | |
88 | %postun | |
89 | if [ "$1" = 0 ]; then | |
e9d7bfa1 | 90 | %php_webserver_restart |
82f5b15c ER |
91 | fi |
92 | ||
e35cf769 | 93 | %triggerin web -- apache1 < 1.3.37-3, apache1-base |
e89262a8 ER |
94 | %webapp_register apache %{_webapp} |
95 | ||
e35cf769 | 96 | %triggerun web -- apache1 < 1.3.37-3, apache1-base |
e89262a8 ER |
97 | %webapp_unregister apache %{_webapp} |
98 | ||
e35cf769 | 99 | %triggerin web -- apache < 2.2.0, apache-base |
e89262a8 ER |
100 | %webapp_register httpd %{_webapp} |
101 | ||
e35cf769 | 102 | %triggerun web -- apache < 2.2.0, apache-base |
e89262a8 ER |
103 | %webapp_unregister httpd %{_webapp} |
104 | ||
e35cf769 | 105 | %triggerin web -- lighttpd |
8eff491a ER |
106 | %webapp_register lighttpd %{_webapp} |
107 | ||
e35cf769 | 108 | %triggerun web -- lighttpd |
8eff491a ER |
109 | %webapp_unregister lighttpd %{_webapp} |
110 | ||
82f5b15c ER |
111 | %files |
112 | %defattr(644,root,root,755) | |
113 | %doc AUTHORS README THANKS | |
e35cf769 ER |
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) | |
44fec13e | 122 | %dir %attr(750,root,http) %{_sysconfdir} |
e89262a8 ER |
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 | |
44fec13e | 125 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf |
e89262a8 | 126 | %{_appdir} |