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