]>
Commit | Line | Data |
---|---|---|
82f5b15c | 1 | %define _modname xcache |
82f5b15c | 2 | Summary: %{_modname} - PHP opcode cacher |
fd6082ef | 3 | Summary(pl.UTF-8): %{_modname} - buforowanie opcodów PHP |
82f5b15c | 4 | Name: php-%{_modname} |
1db758bf | 5 | Version: 1.2.1 |
e89262a8 | 6 | Release: 2 |
82f5b15c ER |
7 | License: BSD |
8 | Group: Development/Languages/PHP | |
2405d2a6 | 9 | URL: http://xcache.lighttpd.net/ |
1db758bf ER |
10 | Source0: http://xcache.lighttpd.net/pub/Releases/1.2.1/xcache-%{version}.tar.bz2 |
11 | # Source0-md5: 42133468871c573c397b8375dc8c19b6 | |
2405d2a6 | 12 | BuildRequires: php-devel >= 3:5.1 |
e9d7bfa1 | 13 | BuildRequires: rpmbuild(macros) >= 1.344 |
99ae26ca | 14 | BuildRequires: sed >= 4.0 |
22775bf0 | 15 | %{?requires_zend_extension} |
e9d7bfa1 | 16 | Requires: php-common >= 4:5.0.4 |
82f5b15c ER |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
18 | ||
e89262a8 ER |
19 | %define _webapps /etc/webapps |
20 | %define _webapp xcache | |
21 | %define _sysconfdir %{_webapps}/%{_webapp} | |
22 | %define _appdir %{_datadir}/%{_webapp} | |
23 | ||
82f5b15c | 24 | %description |
99ae26ca ER |
25 | XCache is a fast, stable PHP opcode cacher that has been tested and is |
26 | now running on production servers under high load. | |
82f5b15c | 27 | |
b3c5667f JR |
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. | |
822de9e6 | 31 | |
82f5b15c | 32 | %prep |
1db758bf | 33 | %setup -q -n xcache-%{version} |
82f5b15c | 34 | %{__sed} -i -e ' |
e9d7bfa1 ER |
35 | s,zend_extension =.*,zend_extension = %{php_extensiondir}/xcache.so, |
36 | s,zend_extension_ts = .*,zend_extension_ts = %{php_extensiondir}/xcache.so, | |
82f5b15c ER |
37 | ' xcache.ini |
38 | ||
e89262a8 ER |
39 | cat > apache.conf <<'EOF' |
40 | Alias /xcache %{_appdir} | |
41 | <Directory %{_appdir}> | |
030c0f9c | 42 | Allow from 127.0.0.1 |
e89262a8 ER |
43 | </Directory> |
44 | EOF | |
45 | ||
2405d2a6 ER |
46 | %build |
47 | phpize | |
48 | %configure \ | |
49 | --enable-xcache \ | |
50 | --enable-xcache-optimizer \ | |
51 | --enable-xcache-coverager | |
718c7b68 | 52 | %{__make} |
2405d2a6 | 53 | |
82f5b15c ER |
54 | %install |
55 | rm -rf $RPM_BUILD_ROOT | |
e89262a8 | 56 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_sysconfdir}} |
82f5b15c ER |
57 | |
58 | %{__make} install \ | |
59 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
60 | ||
2405d2a6 ER |
61 | # The cache directory where pre-compiled files will reside |
62 | install -d $RPM_BUILD_ROOT/var/cache/php-xcache | |
e89262a8 | 63 | install -d $RPM_BUILD_ROOT%{_appdir} |
2405d2a6 ER |
64 | |
65 | # Drop in the bit of configuration | |
e9d7bfa1 | 66 | install xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{_modname}.ini |
e89262a8 ER |
67 | install admin/* $RPM_BUILD_ROOT%{_appdir} |
68 | ||
69 | install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
70 | install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
82f5b15c ER |
71 | |
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %post | |
e9d7bfa1 | 76 | %php_webserver_restart |
82f5b15c ER |
77 | |
78 | %postun | |
79 | if [ "$1" = 0 ]; then | |
e9d7bfa1 | 80 | %php_webserver_restart |
82f5b15c ER |
81 | fi |
82 | ||
e89262a8 ER |
83 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
84 | %webapp_register apache %{_webapp} | |
85 | ||
86 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
87 | %webapp_unregister apache %{_webapp} | |
88 | ||
89 | %triggerin -- apache < 2.2.0, apache-base | |
90 | %webapp_register httpd %{_webapp} | |
91 | ||
92 | %triggerun -- apache < 2.2.0, apache-base | |
93 | %webapp_unregister httpd %{_webapp} | |
94 | ||
82f5b15c ER |
95 | %files |
96 | %defattr(644,root,root,755) | |
97 | %doc AUTHORS README THANKS | |
e89262a8 ER |
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 | |
e9d7bfa1 ER |
100 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{_modname}.ini |
101 | %attr(755,root,root) %{php_extensiondir}/%{_modname}.so | |
e89262a8 | 102 | %{_appdir} |
2405d2a6 | 103 | %dir %attr(775,root,http) /var/cache/php-xcache |