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