]> git.pld-linux.org Git - packages/php-xcache.git/blob - php-xcache.spec
- webapps integration; rel 2
[packages/php-xcache.git] / php-xcache.spec
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:        2
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 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)
18
19 %define         _webapps        /etc/webapps
20 %define         _webapp         xcache
21 %define         _sysconfdir     %{_webapps}/%{_webapp}
22 %define         _appdir         %{_datadir}/%{_webapp}
23
24 %description
25 XCache is a fast, stable PHP opcode cacher that has been tested and is
26 now running on production servers under high load.
27
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.
31
32 %prep
33 %setup -q -n xcache-%{version}
34 %{__sed} -i -e '
35         s,zend_extension =.*,zend_extension = %{php_extensiondir}/xcache.so,
36         s,zend_extension_ts = .*,zend_extension_ts = %{php_extensiondir}/xcache.so,
37 ' xcache.ini
38
39 cat > apache.conf <<'EOF'
40 Alias /xcache %{_appdir}
41 <Directory %{_appdir}>
42         Allow from all
43 </Directory>
44 EOF
45
46 %build
47 phpize
48 %configure \
49         --enable-xcache \
50         --enable-xcache-optimizer \
51         --enable-xcache-coverager
52 %{__make}
53
54 %install
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_sysconfdir}}
57
58 %{__make} install \
59         INSTALL_ROOT=$RPM_BUILD_ROOT
60
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}
64
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}
68
69 install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
70 install apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
71
72 %clean
73 rm -rf $RPM_BUILD_ROOT
74
75 %post
76 %php_webserver_restart
77
78 %postun
79 if [ "$1" = 0 ]; then
80         %php_webserver_restart
81 fi
82
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
95 %files
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
102 %{_appdir}
103 %dir %attr(775,root,http) /var/cache/php-xcache
This page took 0.937562 seconds and 4 git commands to generate.