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