]> git.pld-linux.org Git - packages/php-xcache.git/blob - php-xcache.spec
up to 3.1.0, php 5.5 support
[packages/php-xcache.git] / php-xcache.spec
1 # TODO
2 # - verify %lang codes
3 %define         php_name        php%{?php_suffix}
4 %define         modname xcache
5 Summary:        %{modname} - PHP opcode cacher
6 Summary(pl.UTF-8):      %{modname} - buforowanie opcodów PHP
7 Name:           %{php_name}-%{modname}
8 Version:        3.1.0
9 Release:        1
10 License:        BSD
11 Group:          Development/Languages/PHP
12 Source0:        http://xcache.lighttpd.net/pub/Releases/%{version}/xcache-%{version}.tar.bz2
13 # Source0-md5:  e5816d47d52be200b959bf69a673ff74
14 Source1:        %{modname}-apache.conf
15 Source2:        %{modname}-lighttpd.conf
16 Patch0:         config.patch
17 Patch1:         ini-settings.patch
18 URL:            http://xcache.lighttpd.net/
19 BuildRequires:  %{php_name}-devel >= 4:5.2.17-8
20 BuildRequires:  rpmbuild(macros) >= 1.344
21 BuildRequires:  sed >= 4.0
22 %{?requires_zend_extension}
23 Requires:       php(core) >= 5.0.4
24 Requires(triggerpostun):        sed >= 4.0
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _webapps        /etc/webapps
28 %define         _webapp         %{modname}
29 %define         _sysconfdir     %{_webapps}/%{_webapp}
30 %define         _appdir         %{_datadir}/%{_webapp}
31
32 %description
33 XCache is a fast, stable PHP opcode cacher that has been tested and is
34 now running on production servers under high load.
35
36 %description -l pl.UTF-8
37 XCache to szybkie, stabilne buforowanie opcodów PHP, przetestowane i
38 działające na produkcyjnych serwerach o dużym obciążeniu.
39
40 %package web
41 Summary:        WEB interface for xCache
42 Group:          Libraries
43 Requires:       %{name} = %{version}-%{release}
44 Requires:       webapps
45 Requires:       webserver(access)
46 Requires:       webserver(php) >= 5.0
47 %if "%{_rpmversion}" >= "5"
48 BuildArch:      noarch
49 %endif
50
51 %description web
52 Via this web interface script you can manage and view statistics of
53 xCache.
54
55 More information you can find at %{url}.
56
57 %prep
58 %setup -q -n %{modname}-%{version}
59 %patch0 -p1
60 %patch1 -p1
61 %{__sed} -i.bak -e '
62         s,@extensiondir@,%{php_extensiondir},
63 ' xcache.ini
64
65 mv htdocs/config{.default,}.php
66 mv htdocs/config.example.php config.example.php
67 mv htdocs/cacher/config{.default,}.php
68 mv htdocs/cacher/config.example.php cacher.config.example.php
69 mv htdocs/coverager/config{.default,}.php
70 mv htdocs/coverager/config.example.php coverager.config.example.php
71
72 %{__rm} htdocs/common/lang/*.po
73 %{__rm} htdocs/coverager/lang/*.po
74 %{__rm} htdocs/cacher/lang/*.po
75
76 # wtf?
77 %{__rm} htdocs/diagnosis/lang/zh-tranditional.php
78
79 %build
80 phpize
81 %configure \
82         --enable-xcache \
83         --enable-xcache-optimizer \
84         --enable-xcache-coverager
85 %{__make}
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89 %{__make} install \
90         INSTALL_ROOT=$RPM_BUILD_ROOT
91
92 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
93 cp -p xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
94
95 # The cache directory where pre-compiled files will reside
96 install -d $RPM_BUILD_ROOT/var/cache/php-%{modname}
97
98 # web app
99 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
100 cp -a htdocs/* $RPM_BUILD_ROOT%{_appdir}
101 %{__rm} $RPM_BUILD_ROOT%{_appdir}/diagnosis/lang/*.po
102
103 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/config.php
104 mv $RPM_BUILD_ROOT{%{_appdir}/cacher/config.php,%{_sysconfdir}/cacher.config.php}
105 mv $RPM_BUILD_ROOT{%{_appdir}/coverager/config.php,%{_sysconfdir}/coverager.config.php}
106 ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
107 ln -s %{_sysconfdir}/cacher.config.php $RPM_BUILD_ROOT%{_appdir}/cacher/config.php
108 ln -s %{_sysconfdir}/coverager.config.php $RPM_BUILD_ROOT%{_appdir}/coverager/config.php
109 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
110 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
111 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %post
117 %php_webserver_restart
118
119 %postun
120 if [ "$1" = 0 ]; then
121         %php_webserver_restart
122 fi
123
124 %triggerpostun -- %{name} < 3.0.0-0.8
125 %{__sed} -i -e 's,zend_extension,extension,' %{php_sysconfdir}/conf.d/%{modname}.ini
126
127 %triggerin web -- apache1 < 1.3.37-3, apache1-base
128 %webapp_register apache %{_webapp}
129
130 %triggerun web -- apache1 < 1.3.37-3, apache1-base
131 %webapp_unregister apache %{_webapp}
132
133 %triggerin web -- apache < 2.2.0, apache-base
134 %webapp_register httpd %{_webapp}
135
136 %triggerun web -- apache < 2.2.0, apache-base
137 %webapp_unregister httpd %{_webapp}
138
139 %triggerin web -- lighttpd
140 %webapp_register lighttpd %{_webapp}
141
142 %triggerun web -- lighttpd
143 %webapp_unregister lighttpd %{_webapp}
144
145 %files
146 %defattr(644,root,root,755)
147 %doc AUTHORS README THANKS
148 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
149 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
150
151 # XXX: what for this dir is used?
152 %dir %attr(775,root,http) /var/cache/php-xcache
153
154 %files web
155 %defattr(644,root,root,755)
156 %doc config*.example.php
157 %dir %attr(750,root,http) %{_sysconfdir}
158 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
159 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
160 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
161 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
162 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cacher.config.php
163 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/coverager.config.php
164 %dir %{_appdir}
165 %{_appdir}/*.php
166
167 %dir %{_appdir}/common
168 %{_appdir}/common/*.css
169 %{_appdir}/common/*.js
170 %{_appdir}/common/*.php
171 %{_appdir}/common/*.png
172 %dir %{_appdir}/common/lang
173 %{_appdir}/common/lang/en.php
174 %lang(cn) %{_appdir}/common/lang/zh-simplified.php
175 %lang(cn) %{_appdir}/common/lang/zh-traditional.php
176
177 %dir %{_appdir}/cacher
178 %{_appdir}/cacher/*.css
179 %{_appdir}/cacher/*.php
180 %{_appdir}/cacher/sub
181 %dir %{_appdir}/cacher/lang
182 %{_appdir}/cacher/lang/en.php
183 %lang(zh_CN) %{_appdir}/cacher/lang/zh-simplified.php
184 %lang(zh_CN) %{_appdir}/cacher/lang/zh-traditional.php
185
186 %dir %{_appdir}/coverager
187 %{_appdir}/coverager/*.css
188 %{_appdir}/coverager/*.php
189 %dir %{_appdir}/coverager/lang
190 %{_appdir}/coverager/lang/en.php
191 %lang(zh_CN) %{_appdir}/coverager/lang/zh-simplified.php
192 %lang(zh_CN) %{_appdir}/coverager/lang/zh-traditional.php
193
194 %dir %{_appdir}/diagnosis
195 %{_appdir}/diagnosis/*.css
196 %{_appdir}/diagnosis/*.php
197 %dir %{_appdir}/diagnosis/lang
198 %{_appdir}/diagnosis/lang/en.php
199 %lang(zh_CN) %{_appdir}/diagnosis/lang/zh-simplified.php
200 %lang(zh_CN) %{_appdir}/diagnosis/lang/zh-traditional.php
This page took 0.057864 seconds and 4 git commands to generate.