summaryrefslogtreecommitdiffstats
path: root/php-xcache.spec
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 /php-xcache.spec
parentaa3fee9a1d144c7d9a9ddc72bdb1a91be0fab03b (diff)
php-xcache version 3.0.0 (fedora review spec)
Diffstat (limited to 'php-xcache.spec')
-rw-r--r--php-xcache.spec117
1 files changed, 61 insertions, 56 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