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