diff options
author | Remi Collet <fedora@famillecollet.com> | 2012-09-21 18:20:51 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2012-09-21 18:20:51 +0200 |
commit | 53033755cd8295008cf464c83372d3cf8b7ba5d4 (patch) | |
tree | 080e602d58337f4c5503cca996dae8d8c3561d64 | |
parent | f1915c3dde4cb2d537b707ed6f999a28912be01f (diff) |
php-xcache: add admin and coverager sub-package
-rw-r--r-- | php-xcache.spec | 84 | ||||
-rw-r--r-- | xcache-admin.conf | 17 | ||||
-rw-r--r-- | xcache-coverager.conf | 17 |
3 files changed, 113 insertions, 5 deletions
diff --git a/php-xcache.spec b/php-xcache.spec index 9af0256..afc913f 100644 --- a/php-xcache.spec +++ b/php-xcache.spec @@ -1,14 +1,17 @@ %global ext_name xcache +%global with_zts 0%{?__ztsphp:1} Summary: Fast, stable PHP opcode cacher Name: php-xcache Version: 2.0.1 -Release: 1%{?dist} +Release: 2%{?dist} License: PHP Group: Development/Languages URL: http://xcache.lighttpd.net/ Source0: http://xcache.lighttpd.net/pub/Releases/%{version}/%{ext_name}-%{version}.tar.gz +Source1: xcache-admin.conf +Source2: xcache-coverager.conf # Specific RPM extension PATH Patch0: %{ext_name}-conf.patch @@ -44,6 +47,40 @@ It overcomes a lot of problems that has been with other competing opcachers such as being able to be used with new PHP versions. +%package admin +Summary: XCache Administration +Group: Development/Languages +Requires: mod_php, httpd +Requires: %{name} = %{version}-%{release} +%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 +BuildArch: noarch +%endif + +%description admin +This package provides the XCache Administration web application, +with Apache configuration, on http://localhost/xcache-admin + +This requires to configure xcache.admin.user and xcache.admin.pass options +in XCache configuration file (xcache.ini). + + +%package coverager +Summary: XCache PHP Code Coverage Viewer +Group: Development/Languages +Requires: mod_php, httpd +Requires: %{name} = %{version}-%{release} +%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 +BuildArch: noarch +%endif + +%description coverager +This package provides the XCache PHP Code Coverage Viewer web application, +with Apache configuration, on http://localhost/xcache-coverager + +This requires to configure xcache.coveragedump_directory option in XCache +configuration file (xcache.ini). + + %prep %setup -q -c @@ -57,16 +94,20 @@ if test "x${extver}" != "x%{version}"; then exit 1 fi +%if %{with_zts} # duplicate for ZTS build cp -pr nts zts +%endif cd nts %patch0 -p0 -b .upstream sed -e 's:@EXTDIR@:%{php_extdir}:' -i %{ext_name}.ini +%if %{with_zts} cd ../zts %patch0 -p0 -b .upstream sed -e 's:@EXTDIR@:%{php_ztsextdir}:' -i %{ext_name}.ini +%endif %build @@ -83,6 +124,7 @@ cd nts --with-php-config=%{_bindir}/php-config make %{?_smp_mflags} +%if %{with_zts} cd ../zts %{_bindir}/zts-phpize %configure \ @@ -92,17 +134,32 @@ cd ../zts --enable-xcache-coverager \ --with-php-config=%{_bindir}/zts-php-config make %{?_smp_mflags} +%endif %install rm -rf %{buildroot} # Install the NTS stuff make -C nts install INSTALL_ROOT=%{buildroot} -install -D -m 644 nts/%{ext_name}.ini %{buildroot}%{php_inidir}/%{ext_name}.ini +install -D -m 644 nts/%{ext_name}.ini %{buildroot}%{_sysconfdir}/php.d/%{ext_name}.ini +%if %{with_zts} # Install the ZTS stuff make -C zts install INSTALL_ROOT=%{buildroot} install -D -m 644 zts/%{ext_name}.ini %{buildroot}%{php_ztsinidir}/%{ext_name}.ini +%endif + +# Install the admin stuff +install -d -m 755 %{buildroot}%{_datadir}/xcache/admin +install -p -m 644 nts/admin/* %{buildroot}%{_datadir}/xcache/admin +install -D -m 644 -p %{SOURCE1} \ + %{buildroot}%{_sysconfdir}/httpd/conf.d/xcache-admin.conf + +# Install the coverager stuff +install -d -m 755 %{buildroot}%{_datadir}/xcache/coverager +install -p -m 644 nts/coverager/* %{buildroot}%{_datadir}/xcache/coverager +install -D -m 644 -p %{SOURCE2} \ + %{buildroot}%{_sysconfdir}/httpd/conf.d/xcache-coverager.conf %check @@ -111,9 +168,11 @@ php --no-php-ini \ --define zend_extension=%{buildroot}%{php_extdir}/%{ext_name}.so \ --modules | grep XCache +%if %{with_zts} %{__ztsphp} --no-php-ini \ --define zend_extension=%{buildroot}%{php_ztsextdir}/%{ext_name}.so \ --modules | grep XCache +%endif %clean @@ -123,16 +182,31 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc nts/{AUTHORS,ChangeLog,COPYING,README,THANKS} -%doc nts/admin -%doc nts/coverager -%config(noreplace) %{php_inidir}/%{ext_name}.ini +%config(noreplace) %{_sysconfdir}/php.d/%{ext_name}.ini %{php_extdir}/%{ext_name}.so +%if %{with_zts} %{php_ztsextdir}/%{ext_name}.so %config(noreplace) %{php_ztsinidir}/%{ext_name}.ini +%endif + +%files admin +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/httpd/conf.d/xcache-admin.conf +%dir %{_datadir}/xcache +%{_datadir}/xcache/admin + +%files coverager +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/httpd/conf.d/xcache-coverager.conf +%dir %{_datadir}/xcache +%{_datadir}/xcache/coverager %changelog +* Fri Sep 21 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-2 +- add admin and coverager sub-package + * Sun Sep 9 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-1 - initial package diff --git a/xcache-admin.conf b/xcache-admin.conf new file mode 100644 index 0000000..eac67f5 --- /dev/null +++ b/xcache-admin.conf @@ -0,0 +1,17 @@ +# Configure XCache Administration +Alias /xcache-admin /usr/share/xcache/admin + +<Directory /usr/share/xcache/admin> + <IfModule mod_authz_core.c> + # Apache 2.4 + Require local + </IfModule> + <IfModule !mod_authz_core.c> + # Apache 2.2 + Order Deny,Allow + Deny from All + Allow from 127.0.0.1 + Allow from ::1 + </IfModule> +</Directory> + diff --git a/xcache-coverager.conf b/xcache-coverager.conf new file mode 100644 index 0000000..27c6c7b --- /dev/null +++ b/xcache-coverager.conf @@ -0,0 +1,17 @@ +# Configure XCache PHP Code Coverage Viewer +Alias /xcache-coverager /usr/share/xcache/coverager + +<Directory /usr/share/xcache/coverager> + <IfModule mod_authz_core.c> + # Apache 2.4 + Require local + </IfModule> + <IfModule !mod_authz_core.c> + # Apache 2.2 + Order Deny,Allow + Deny from All + Allow from 127.0.0.1 + Allow from ::1 + </IfModule> +</Directory> + |