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