]>
Commit | Line | Data |
---|---|---|
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: 1.2.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/1.2.1/xcache-%{version}.tar.bz2 | |
11 | # Source0-md5: 42133468871c573c397b8375dc8c19b6 | |
12 | Source1: %{_modname}-apache.conf | |
13 | Source2: %{_modname}-lighttpd.conf | |
14 | BuildRequires: php-devel >= 3:5.1 | |
15 | BuildRequires: rpmbuild(macros) >= 1.344 | |
16 | BuildRequires: sed >= 4.0 | |
17 | %{?requires_zend_extension} | |
18 | Requires: php-common >= 4:5.0.4 | |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
20 | ||
21 | %define _webapps /etc/webapps | |
22 | %define _webapp %{_modname} | |
23 | %define _sysconfdir %{_webapps}/%{_webapp} | |
24 | %define _appdir %{_datadir}/%{_webapp} | |
25 | ||
26 | %description | |
27 | XCache is a fast, stable PHP opcode cacher that has been tested and is | |
28 | now running on production servers under high load. | |
29 | ||
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. | |
33 | ||
34 | %prep | |
35 | %setup -q -n %{_modname}-%{version} | |
36 | %{__sed} -i -e ' | |
37 | s,zend_extension =.*,zend_extension = %{php_extensiondir}/xcache.so, | |
38 | s,zend_extension_ts = .*,zend_extension_ts = %{php_extensiondir}/xcache.so, | |
39 | ' xcache.ini | |
40 | ||
41 | %build | |
42 | phpize | |
43 | %configure \ | |
44 | --enable-xcache \ | |
45 | --enable-xcache-optimizer \ | |
46 | --enable-xcache-coverager | |
47 | %{__make} | |
48 | ||
49 | %install | |
50 | rm -rf $RPM_BUILD_ROOT | |
51 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_sysconfdir}} | |
52 | ||
53 | %{__make} install \ | |
54 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
55 | ||
56 | # The cache directory where pre-compiled files will reside | |
57 | install -d $RPM_BUILD_ROOT/var/cache/php-%{_modname} | |
58 | install -d $RPM_BUILD_ROOT%{_appdir} | |
59 | ||
60 | # Drop in the bit of configuration | |
61 | install xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{_modname}.ini | |
62 | install admin/* $RPM_BUILD_ROOT%{_appdir} | |
63 | ||
64 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
65 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
66 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
67 | ||
68 | %clean | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %post | |
72 | %php_webserver_restart | |
73 | ||
74 | %postun | |
75 | if [ "$1" = 0 ]; then | |
76 | %php_webserver_restart | |
77 | fi | |
78 | ||
79 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
80 | %webapp_register apache %{_webapp} | |
81 | ||
82 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
83 | %webapp_unregister apache %{_webapp} | |
84 | ||
85 | %triggerin -- apache < 2.2.0, apache-base | |
86 | %webapp_register httpd %{_webapp} | |
87 | ||
88 | %triggerun -- apache < 2.2.0, apache-base | |
89 | %webapp_unregister httpd %{_webapp} | |
90 | ||
91 | %triggerin -- lighttpd | |
92 | %webapp_register lighttpd %{_webapp} | |
93 | ||
94 | %triggerun -- lighttpd | |
95 | %webapp_unregister lighttpd %{_webapp} | |
96 | ||
97 | %files | |
98 | %defattr(644,root,root,755) | |
99 | %doc AUTHORS README THANKS | |
100 | %dir %attr(750,root,http) %{_sysconfdir} | |
101 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
102 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
103 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
104 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{_modname}.ini | |
105 | %attr(755,root,root) %{php_extensiondir}/%{_modname}.so | |
106 | %{_appdir} | |
107 | %dir %attr(775,root,http) /var/cache/php-xcache |