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