]> git.pld-linux.org Git - packages/php-xcache.git/blame - php-xcache.spec
web is noarch package
[packages/php-xcache.git] / php-xcache.spec
CommitLineData
14119aa9
ER
1# TODO
2# - verify %lang codes
56da28d4 3%define php_name php%{?php_suffix}
e35cf769
ER
4%define modname xcache
5Summary: %{modname} - PHP opcode cacher
6Summary(pl.UTF-8): %{modname} - buforowanie opcodów PHP
56da28d4 7Name: %{php_name}-%{modname}
2cc89a13 8Version: 3.0.1
71c7be5e 9Release: 3
82f5b15c
ER
10License: BSD
11Group: Development/Languages/PHP
4d014367 12Source0: http://xcache.lighttpd.net/pub/Releases/%{version}/xcache-%{version}.tar.bz2
2cc89a13 13# Source0-md5: 45086010bc4f82f506c08be1c556941b
e35cf769
ER
14Source1: %{modname}-apache.conf
15Source2: %{modname}-lighttpd.conf
6620175c 16Patch0: config.patch
b82d8f99 17URL: http://xcache.lighttpd.net/
56da28d4 18BuildRequires: %{php_name}-devel >= 4:5.2.17-8
e9d7bfa1 19BuildRequires: rpmbuild(macros) >= 1.344
99ae26ca 20BuildRequires: sed >= 4.0
22775bf0 21%{?requires_zend_extension}
67844c73 22Requires: php(core) >= 5.0.4
484ea7e5 23Requires(triggerpostun): sed >= 4.0
82f5b15c
ER
24BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
e89262a8 26%define _webapps /etc/webapps
e35cf769 27%define _webapp %{modname}
e89262a8
ER
28%define _sysconfdir %{_webapps}/%{_webapp}
29%define _appdir %{_datadir}/%{_webapp}
30
82f5b15c 31%description
99ae26ca
ER
32XCache is a fast, stable PHP opcode cacher that has been tested and is
33now running on production servers under high load.
82f5b15c 34
b3c5667f
JR
35%description -l pl.UTF-8
36XCache to szybkie, stabilne buforowanie opcodów PHP, przetestowane i
37działające na produkcyjnych serwerach o dużym obciążeniu.
822de9e6 38
e35cf769
ER
39%package web
40Summary: WEB interface for xCache
41Group: Libraries
eeb07124 42Requires: %{name} = %{version}-%{release}
e35cf769 43Requires: webapps
71c7be5e 44Requires: webserver(access)
e35cf769 45Requires: webserver(php) >= 5.0
7624a6a5
ER
46%if "%{_rpmversion}" >= "5"
47BuildArch: noarch
48%endif
e35cf769
ER
49
50%description web
51Via this web interface script you can manage and view statistics of
52xCache.
53
54More information you can find at %{url}.
55
82f5b15c 56%prep
e35cf769 57%setup -q -n %{modname}-%{version}
9d1b1092
ER
58%patch0 -p1
59%{__sed} -i.bak -e '
60 s,@extensiondir@,%{php_extensiondir},
82f5b15c
ER
61' xcache.ini
62
14119aa9
ER
63mv htdocs/config{.default,}.php
64mv htdocs/config.example.php config.example.php
65mv htdocs/cacher/config{.default,}.php
66mv htdocs/cacher/config.example.php cacher.config.example.php
67mv htdocs/coverager/config{.default,}.php
68mv 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
709c0073 76
2405d2a6
ER
77%build
78phpize
79%configure \
80 --enable-xcache \
81 --enable-xcache-optimizer \
82 --enable-xcache-coverager
718c7b68 83%{__make}
2405d2a6 84
82f5b15c
ER
85%install
86rm -rf $RPM_BUILD_ROOT
82f5b15c
ER
87%{__make} install \
88 INSTALL_ROOT=$RPM_BUILD_ROOT
89
14119aa9
ER
90install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
91cp -p xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
92
2405d2a6 93# The cache directory where pre-compiled files will reside
e35cf769 94install -d $RPM_BUILD_ROOT/var/cache/php-%{modname}
2405d2a6 95
14119aa9
ER
96# web app
97install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
709c0073 98cp -a htdocs/* $RPM_BUILD_ROOT%{_appdir}
14119aa9
ER
99%{__rm} $RPM_BUILD_ROOT%{_appdir}/diagnosis/lang/*.po
100
101mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/config.php
102mv $RPM_BUILD_ROOT{%{_appdir}/cacher/config.php,%{_sysconfdir}/cacher.config.php}
103mv $RPM_BUILD_ROOT{%{_appdir}/coverager/config.php,%{_sysconfdir}/coverager.config.php}
104ln -s %{_sysconfdir}/config.php $RPM_BUILD_ROOT%{_appdir}/config.php
105ln -s %{_sysconfdir}/cacher.config.php $RPM_BUILD_ROOT%{_appdir}/cacher/config.php
106ln -s %{_sysconfdir}/coverager.config.php $RPM_BUILD_ROOT%{_appdir}/coverager/config.php
eeb07124 107cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
a8e7e7dd 108cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
eeb07124 109cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
82f5b15c
ER
110
111%clean
112rm -rf $RPM_BUILD_ROOT
113
114%post
e9d7bfa1 115%php_webserver_restart
82f5b15c
ER
116
117%postun
118if [ "$1" = 0 ]; then
e9d7bfa1 119 %php_webserver_restart
82f5b15c
ER
120fi
121
484ea7e5
ER
122%triggerpostun -- %{name} < 3.0.0-0.8
123%{__sed} -i -e 's,zend_extension,extension,' %{php_sysconfdir}/conf.d/%{modname}.ini
124
e35cf769 125%triggerin web -- apache1 < 1.3.37-3, apache1-base
e89262a8
ER
126%webapp_register apache %{_webapp}
127
e35cf769 128%triggerun web -- apache1 < 1.3.37-3, apache1-base
e89262a8
ER
129%webapp_unregister apache %{_webapp}
130
a8e7e7dd 131%triggerin web -- apache < 2.2.0, apache-base
e89262a8
ER
132%webapp_register httpd %{_webapp}
133
a8e7e7dd 134%triggerun web -- apache < 2.2.0, apache-base
e89262a8
ER
135%webapp_unregister httpd %{_webapp}
136
e35cf769 137%triggerin web -- lighttpd
8eff491a
ER
138%webapp_register lighttpd %{_webapp}
139
e35cf769 140%triggerun web -- lighttpd
8eff491a
ER
141%webapp_unregister lighttpd %{_webapp}
142
82f5b15c
ER
143%files
144%defattr(644,root,root,755)
145%doc AUTHORS README THANKS
e35cf769
ER
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)
14119aa9 154%doc config*.example.php
44fec13e 155%dir %attr(750,root,http) %{_sysconfdir}
e89262a8
ER
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
44fec13e 158%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
14119aa9
ER
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.084776 seconds and 4 git commands to generate.