summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-10-31 09:10:28 +0100
committerRemi Collet <fedora@famillecollet.com>2012-10-31 09:10:28 +0100
commit08e0fe2bb7fe872dc78699b0388f505c182bf310 (patch)
treea845e660a9def6d55217c875a0f2205e35030f5e
parentaa3fee9a1d144c7d9a9ddc72bdb1a91be0fab03b (diff)
php-xcache version 3.0.0 (fedora review spec)
-rw-r--r--php-xcache.spec117
-rw-r--r--xcache-conf.patch19
-rw-r--r--xcache-config.patch59
-rw-r--r--xcache-coverager.conf17
-rw-r--r--xcache-httpd.conf (renamed from xcache-admin.conf)4
5 files changed, 122 insertions, 94 deletions
diff --git a/php-xcache.spec b/php-xcache.spec
index 349ac5f..2f23a9c 100644
--- a/php-xcache.spec
+++ b/php-xcache.spec
@@ -3,18 +3,17 @@
Summary: Fast, stable PHP opcode cacher
Name: php-xcache
-Version: 2.0.1
-Release: 4%{?dist}
+Version: 3.0.0
+Release: 1%{?dist}
License: BSD
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
+Source1: xcache-httpd.conf
-# Specific RPM extension PATH
-Patch0: %{ext_name}-conf.patch
+# Relocation of configuration files to /etc/xcache
+Patch0: xcache-config.patch
BuildRequires: php-devel
@@ -22,7 +21,8 @@ Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
# Only one opcode cache
-Conflicts: php-pecl-apc, php-eaccelerator
+Conflicts: php-pecl-apc
+Conflicts: php-eaccelerator
# Filter private shared object
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
@@ -49,25 +49,12 @@ BuildArch: noarch
%description -n xcache-admin
This package provides the XCache Administration web application,
-with Apache configuration, on http://localhost/xcache-admin
+with Apache configuration, on http://localhost/xcache
-This requires to configure xcache.admin.user and xcache.admin.pass options
-in XCache configuration file (xcache.ini).
-
-
-%package -n xcache-coverager
-Summary: XCache PHP Code Coverage Viewer
-Group: Development/Languages
-Requires: mod_php, httpd
-Requires: %{name} = %{version}-%{release}
-BuildArch: noarch
-
-%description -n xcache-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).
+This requires to configure, in XCache configuration file (xcache.ini):
+- xcache.admin.user
+- xcache.admin.pass
+- xcache.coveragedump_directory
%prep
@@ -76,28 +63,25 @@ configuration file (xcache.ini).
# rename source folder
mv %{ext_name}-%{version} nts
+cd nts
+%patch0 -p1
+
+# fix version
+sed -e '/XCACHE_VERSION/s/-dev//' -i xcache.h
+
# Sanity check, really often broken
-extver=$(sed -n '/define XCACHE_VERSION/{s/.* "//;s/".*$//;p}' nts/xcache.h)
+extver=$(sed -n '/define XCACHE_VERSION/{s/.* "//;s/".*$//;p}' xcache.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}.
exit 1
fi
+cd ..
%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
# Without --enable-xcache-assembler, --enable-xcache-encoder, --enable-xcache-decoder
@@ -138,28 +122,47 @@ install -D -m 644 zts/%{ext_name}.ini %{buildroot}%{php_ztsinidir}/%{ext_name}.i
%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 -d -m 755 %{buildroot}%{_datadir}
+cp -pr nts/htdocs %{buildroot}%{_datadir}/xcache
+install -d -m 755 %{buildroot}%{_sysconfdir}/xcache/cacher
+install -d -m 755 %{buildroot}%{_sysconfdir}/xcache/coverager
+mv %{buildroot}%{_datadir}/xcache/config.example.php \
+ %{buildroot}%{_sysconfdir}/xcache
+mv %{buildroot}%{_datadir}/xcache/cacher/config.example.php \
+ %{buildroot}%{_sysconfdir}/xcache/cacher
+mv %{buildroot}%{_datadir}/xcache/coverager/config.example.php \
+ %{buildroot}%{_sysconfdir}/xcache/coverager
-# 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
+install -D -m 644 -p %{SOURCE1} \
+ %{buildroot}%{_sysconfdir}/httpd/conf.d/xcache.conf
%check
+cd nts
+
# simple module load test
php --no-php-ini \
- --define zend_extension=%{buildroot}%{php_extdir}/%{ext_name}.so \
+ --define extension_dir=%{buildroot}%{php_extdir}/\
+ --define extension=%{ext_name}.so \
--modules | grep XCache
+# upstream unit tests
+TEST_PHP_EXECUTABLE=%{_bindir}/php \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+php run-tests.php -n -c xcache-test.ini tests
+
%if %{with_zts}
+cd ../zts
%{__ztsphp} --no-php-ini \
- --define zend_extension=%{buildroot}%{php_ztsextdir}/%{ext_name}.so \
+ --define extension_dir=%{buildroot}%{php_ztsextdir}/\
+ --define extension=%{ext_name}.so \
--modules | grep XCache
+
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__ztsphp} run-tests.php -n -c xcache-test.ini tests
%endif
@@ -169,22 +172,24 @@ php --no-php-ini \
%{php_extdir}/%{ext_name}.so
%if %{with_zts}
-%{php_ztsextdir}/%{ext_name}.so
%config(noreplace) %{php_ztsinidir}/%{ext_name}.ini
+%{php_ztsextdir}/%{ext_name}.so
%endif
%files -n xcache-admin
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/xcache-admin.conf
-%dir %{_datadir}/xcache
-%{_datadir}/xcache/admin
-
-%files -n xcache-coverager
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/xcache-coverager.conf
-%dir %{_datadir}/xcache
-%{_datadir}/xcache/coverager
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/xcache.conf
+%{_datadir}/xcache
+# No real configuration files, only sample files
+%{_sysconfdir}/xcache
%changelog
+* Wed Oct 31 2012 Remi Collet <remi@fedoraproject.org> - 3.0.0-1
+- new major version
+- drop xcache-coverager subpackage
+- xcache-admin now provides cacher, coverager and diagnosis
+- run unit tests provided by upstream
+
* Sat Oct 27 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-4
- drop php prefix from sub packages
- clean EL-5 stuff
diff --git a/xcache-conf.patch b/xcache-conf.patch
deleted file mode 100644
index c708a12..0000000
--- a/xcache-conf.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- xcache.ini.upstream 2012-09-09 07:56:44.000000000 +0200
-+++ xcache.ini 2012-09-09 07:59:12.000000000 +0200
-@@ -1,15 +1,8 @@
--;; this is an example, it won't work unless properly configured into php.ini
- [xcache-common]
- ;; WARNING: zend_extension* = *xcache* MUST be the first(above) of all zend_extension*=*
- ;; using extension=xcache.so is not recommended
-
--;; non-windows example
--;; update xxx accordingly
--zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
--;; windows example:
--zend_extension_ts = c:/php/extensions/php_xcache.dll
--;; for newer PHP, _ts is removed, use the following line instead
--zend_extension = c:/php/extensions/php_xcache.dll
-+zend_extension = @EXTDIR@/xcache.so
-
- [xcache.admin]
- xcache.admin.enable_auth = On
diff --git a/xcache-config.patch b/xcache-config.patch
new file mode 100644
index 0000000..0523870
--- /dev/null
+++ b/xcache-config.patch
@@ -0,0 +1,59 @@
+diff -ru xcache-3.0.0/htdocs.old/cacher/config.example.php xcache-3.0.0/htdocs/cacher/config.example.php
+--- xcache-3.0.0/htdocs.old/cacher/config.example.php 2012-08-01 18:49:57.000000000 +0200
++++ xcache-3.0.0/htdocs/cacher/config.example.php 2012-10-31 08:35:32.000000000 +0100
+@@ -5,10 +5,10 @@
+ // 1. copy config.example.php config.php; edit config.php
+ // 2. upgrading your config.php when config.example.php were upgraded
+ // XCache will load
+-// 1. ../config.default.php
+-// 2. ./config.default.php
+-// 3. ../config.php
+-// 4. ./config.php
++// 1. /usr/share/xcache/config.default.php
++// 2. /usr/share/xcache/cacher/config.default.php
++// 3. /etc/xcache/config.php
++// 4. /etc/xcache/cacher/config.php
+
+ // width of graph for free or usage blocks
+ $config['percent_graph_width'] = 120;
+Seulement dans xcache-3.0.0/htdocs/cacher: config.example.php~
+diff -ru xcache-3.0.0/htdocs.old/common/common.php xcache-3.0.0/htdocs/common/common.php
+--- xcache-3.0.0/htdocs.old/common/common.php 2012-08-01 18:49:59.000000000 +0200
++++ xcache-3.0.0/htdocs/common/common.php 2012-10-31 08:32:34.000000000 +0100
+@@ -252,11 +252,13 @@
+ include "./config.default.php";
+ }
+ include "../config.default.php";
+-if (file_exists("../config.php")) {
+- include "../config.php";
++
++$mod=basename(getcwd());
++if (file_exists("/etc/xcache/config.php")) {
++ include "/etc/xcache/config.php";
+ }
+-if (file_exists("./config.php")) {
+- include "./config.php";
++if (file_exists("/etc/xcache/$mod/config.php")) {
++ include "/etc/xcache/$mod/config.php";
+ }
+
+ $strings = array();
+diff -ru xcache-3.0.0/htdocs.old/coverager/config.example.php xcache-3.0.0/htdocs/coverager/config.example.php
+--- xcache-3.0.0/htdocs.old/coverager/config.example.php 2012-10-10 14:01:55.000000000 +0200
++++ xcache-3.0.0/htdocs/coverager/config.example.php 2012-10-31 08:35:34.000000000 +0100
+@@ -5,10 +5,10 @@
+ // 1. copy config.example.php config.php; edit config.php
+ // 2. upgrading your config.php when config.example.php were upgraded
+ // XCache will load
+-// 1. ../config.default.php
+-// 2. ./config.default.php
+-// 3. ../config.php
+-// 4. ./config.php
++// 1. /usr/share/xcache/config.default.php
++// 2. /usr/share/xcache/coverager/config.default.php
++// 3. /etc/xcache/config.php
++// 4. /etc/xcache/coverager/config.php
+
+ // $config['include_paths'] = array("/www/my-php-project/");
+ // $config['exclude_paths'] = array("/www/my-php-project/tmp/");
+Seulement dans xcache-3.0.0/htdocs/coverager: config.example.php~
diff --git a/xcache-coverager.conf b/xcache-coverager.conf
deleted file mode 100644
index 27c6c7b..0000000
--- a/xcache-coverager.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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>
-
diff --git a/xcache-admin.conf b/xcache-httpd.conf
index eac67f5..388381b 100644
--- a/xcache-admin.conf
+++ b/xcache-httpd.conf
@@ -1,7 +1,7 @@
# Configure XCache Administration
-Alias /xcache-admin /usr/share/xcache/admin
+Alias /xcache /usr/share/xcache
-<Directory /usr/share/xcache/admin>
+<Directory /usr/share/xcache>
<IfModule mod_authz_core.c>
# Apache 2.4
Require local