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