]> git.pld-linux.org Git - packages/php-xcache.git/blobdiff - php-xcache.spec
- use php(core) as dependency to require php version
[packages/php-xcache.git] / php-xcache.spec
index d1f2295e14f7fe28576160549bbe4705b0d167b8..28ed49df00f1ff163867a17dbf24b93bb55caa9c 100644 (file)
-%define                _modname        xcache
-%define                _sysconfdir     /etc/php
-%define                extensionsdir   %(php-config --extension-dir 2>/dev/null)
-Summary:       %{_modname} - PHP opcode cacher
-Name:          php-%{_modname}
-Version:       1.0
-Release:       0.4
+%define                modname xcache
+Summary:       %{modname} - PHP opcode cacher
+Summary(pl.UTF-8):     %{modname} - buforowanie opcodów PHP
+Name:          php-%{modname}
+Version:       2.0.1
+Release:       4
 License:       BSD
 Group:         Development/Languages/PHP
-URL:           http://trac.lighttpd.net/xcache/
-Source0:       http://210.51.190.228/pub/XCache/Releases/xcache-%{version}.tar.gz
-# Source0-md5: a4e2ff36f16b096f24d3edd9b6ab411b
-BuildRequires: php-devel >= 3:5.0
-BuildRequires: rpmbuild(macros) >= 1.254
+URL:           http://xcache.lighttpd.net/
+Source0:       http://xcache.lighttpd.net/pub/Releases/%{version}/xcache-%{version}.tar.bz2
+# Source0-md5: d3bc9645dc1b084c1eb45cfc4d8e9ccc
+Source1:       %{modname}-apache.conf
+Source2:       %{modname}-lighttpd.conf
+Patch0:                ini.patch
+BuildRequires: php-devel >= 4:5.2.17-8
+BuildRequires: rpmbuild(macros) >= 1.344
 BuildRequires: sed >= 4.0
 %{?requires_zend_extension}
-Requires:      %{_sysconfdir}/conf.d
+Requires:      php(core) >= 5.0.4
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                _webapps        /etc/webapps
+%define                _webapp         %{modname}
+%define                _sysconfdir     %{_webapps}/%{_webapp}
+%define                _appdir         %{_datadir}/%{_webapp}
+
 %description
 XCache is a fast, stable PHP opcode cacher that has been tested and is
 now running on production servers under high load.
 
+%description -l pl.UTF-8
+XCache to szybkie, stabilne buforowanie opcodów PHP, przetestowane i
+działające na produkcyjnych serwerach o dużym obciążeniu.
+
+%package web
+Summary:       WEB interface for xCache
+Group:         Libraries
+Requires:      %{name} = %{version}-%{release}
+Requires:      webapps
+Requires:      webserver(php) >= 5.0
+
+%description web
+Via this web interface script you can manage and view statistics of
+xCache.
+
+More information you can find at %{url}.
+
 %prep
-%setup -q -n xcache
+%setup -q -n %{modname}-%{version}
+%patch0 -p1
+%{__sed} -i.bak -e '
+       s,@extensiondir@,%{php_extensiondir},
+' xcache.ini
 
 %build
 phpize
-%configure
+%configure \
+       --enable-xcache \
+       --enable-xcache-optimizer \
+       --enable-xcache-coverager
 %{__make}
-%{__sed} -i -e '
-       s,zend_extension =.*,zend_extension = %{extensionsdir}/xcache.so,
-       s,zend_extension_ts = .*,zend_extension_ts = %{extensionsdir}/xcache.so,
-' xcache.ini
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
+install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{_sysconfdir}}
 
 %{__make} install \
        INSTALL_ROOT=$RPM_BUILD_ROOT
 
-install xcache.ini $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_modname}.ini
+# The cache directory where pre-compiled files will reside
+install -d $RPM_BUILD_ROOT/var/cache/php-%{modname}
+install -d $RPM_BUILD_ROOT%{_appdir}
+
+# Drop in the bit of configuration
+cp -p xcache.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
+cp -a admin/* $RPM_BUILD_ROOT%{_appdir}
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
+%php_webserver_restart
 
 %postun
 if [ "$1" = 0 ]; then
-       [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
-       [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
+       %php_webserver_restart
 fi
 
+%triggerin web -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun web -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin web -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun web -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerin web -- lighttpd
+%webapp_register lighttpd %{_webapp}
+
+%triggerun web -- lighttpd
+%webapp_unregister lighttpd %{_webapp}
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS README THANKS
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{_modname}.ini
-%attr(755,root,root) %{extensionsdir}/%{_modname}.so
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
+%attr(755,root,root) %{php_extensiondir}/%{modname}.so
+
+# XXX: what for this dir is used?
+%dir %attr(775,root,http) /var/cache/php-xcache
+
+%files web
+%defattr(644,root,root,755)
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%{_appdir}
This page took 0.144201 seconds and 4 git commands to generate.