Blame php-xcache.spec

7d0f27e
%global ext_name     xcache
7d0f27e
%global with_zts     0%{?__ztsphp:1}
7d0f27e
7d0f27e
Summary:       Fast, stable PHP opcode cacher
7d0f27e
Name:          php-xcache
65227a0
Version:       3.0.1
e215c97
Release:       2%{?dist}
7d0f27e
License:       BSD
7d0f27e
Group:         Development/Languages
7d0f27e
URL:           http://xcache.lighttpd.net/
7d0f27e
7d0f27e
Source0:       http://xcache.lighttpd.net/pub/Releases/%{version}/%{ext_name}-%{version}.tar.gz
7d0f27e
Source1:       xcache-httpd.conf
7d0f27e
7d0f27e
# Relocation of configuration files to /etc/xcache
7d0f27e
Patch0:        xcache-config.patch
7d0f27e
7d0f27e
BuildRequires: php-devel
7d0f27e
7d0f27e
Requires:      php(zend-abi) = %{php_zend_api}
7d0f27e
Requires:      php(api) = %{php_core_api}
7d0f27e
7d0f27e
# Only one opcode cache can be installed
7d0f27e
Conflicts:     php-pecl-apc
7d0f27e
Conflicts:     php-eaccelerator
7d0f27e
7d0f27e
# Filter private shared object
7d0f27e
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
7d0f27e
%{?filter_setup}
7d0f27e
7d0f27e
7d0f27e
%description
7d0f27e
XCache is a fast, stable  PHP opcode cacher that has been tested and is now
7d0f27e
running on production servers under high load. 
7d0f27e
7d0f27e
It is tested (on linux) and supported on all of the latest PHP release. 
7d0f27e
ThreadSafe is also perfectly supported. 
7d0f27e
7d0f27e
It overcomes a lot of problems that has been with other competing opcachers
7d0f27e
such as being able to be used with new  PHP versions. 
7d0f27e
7d0f27e
7d0f27e
%package -n xcache-admin
7d0f27e
Summary:       XCache Administration
7d0f27e
Group:         Development/Languages
7d0f27e
Requires:      mod_php, httpd
7d0f27e
Requires:      %{name} = %{version}-%{release}
7d0f27e
BuildArch:     noarch
7d0f27e
7d0f27e
%description -n xcache-admin
7d0f27e
This package provides the XCache Administration web application,
7d0f27e
with Apache configuration, on http://localhost/xcache
7d0f27e
7d0f27e
This requires to configure, in XCache configuration file (xcache.ini):
7d0f27e
- xcache.admin.user
7d0f27e
- xcache.admin.pass
7d0f27e
- xcache.coveragedump_directory
7d0f27e
7d0f27e
7d0f27e
%prep
7d0f27e
%setup -q -c 
7d0f27e
7d0f27e
# rename source folder
7d0f27e
mv %{ext_name}-%{version} nts
7d0f27e
7d0f27e
cd nts
7d0f27e
%patch0 -p1
7d0f27e
7d0f27e
# Sanity check, really often broken
7d0f27e
extver=$(sed -n '/define XCACHE_VERSION/{s/.* "//;s/".*$//;p}' xcache.h)
7d0f27e
if test "x${extver}" != "x%{version}"; then
7d0f27e
   : Error: Upstream extension version is ${extver}, expecting %{version}.
7d0f27e
   exit 1
7d0f27e
fi
7d0f27e
cd ..
7d0f27e
7d0f27e
%if %{with_zts}
7d0f27e
# duplicate for ZTS build
7d0f27e
cp -pr nts zts
7d0f27e
%endif
7d0f27e
7d0f27e
7d0f27e
%build
7d0f27e
# Without --enable-xcache-assembler, --enable-xcache-encoder, --enable-xcache-decoder
7d0f27e
# This seems not yet implemented
7d0f27e
7d0f27e
cd nts
7d0f27e
%{_bindir}/phpize
7d0f27e
%configure \
7d0f27e
    --enable-xcache \
7d0f27e
    --enable-xcache-constant \
7d0f27e
    --enable-xcache-optimizer \
7d0f27e
    --enable-xcache-coverager \
7d0f27e
    --with-php-config=%{_bindir}/php-config
7d0f27e
make %{?_smp_mflags}
7d0f27e
7d0f27e
%if %{with_zts}
7d0f27e
cd ../zts
7d0f27e
%{_bindir}/zts-phpize
7d0f27e
%configure \
7d0f27e
    --enable-xcache \
7d0f27e
    --enable-xcache-constant \
7d0f27e
    --enable-xcache-optimizer \
7d0f27e
    --enable-xcache-coverager \
7d0f27e
    --with-php-config=%{_bindir}/zts-php-config
7d0f27e
make %{?_smp_mflags}
7d0f27e
%endif
7d0f27e
7d0f27e
7d0f27e
%install
7d0f27e
# Install the NTS stuff
7d0f27e
make -C nts install INSTALL_ROOT=%{buildroot}
7d0f27e
install -D -m 644 nts/%{ext_name}.ini %{buildroot}%{_sysconfdir}/php.d/%{ext_name}.ini
7d0f27e
7d0f27e
%if %{with_zts}
7d0f27e
# Install the ZTS stuff
7d0f27e
make -C zts install INSTALL_ROOT=%{buildroot}
7d0f27e
install -D -m 644 zts/%{ext_name}.ini %{buildroot}%{php_ztsinidir}/%{ext_name}.ini
7d0f27e
%endif
7d0f27e
7d0f27e
# Install the admin stuff
7d0f27e
install -d -m 755 %{buildroot}%{_datadir}
7d0f27e
cp -pr nts/htdocs %{buildroot}%{_datadir}/xcache
7d0f27e
install -d -m 755 %{buildroot}%{_sysconfdir}/xcache/cacher
7d0f27e
install -d -m 755 %{buildroot}%{_sysconfdir}/xcache/coverager
7d0f27e
mv %{buildroot}%{_datadir}/xcache/config.example.php \
7d0f27e
   %{buildroot}%{_sysconfdir}/xcache
7d0f27e
mv %{buildroot}%{_datadir}/xcache/cacher/config.example.php \
7d0f27e
   %{buildroot}%{_sysconfdir}/xcache/cacher
7d0f27e
mv %{buildroot}%{_datadir}/xcache/coverager/config.example.php \
7d0f27e
   %{buildroot}%{_sysconfdir}/xcache/coverager
7d0f27e
7d0f27e
install -D -m 644 -p %{SOURCE1} \
7d0f27e
        %{buildroot}%{_sysconfdir}/httpd/conf.d/xcache.conf
7d0f27e
7d0f27e
7d0f27e
%check
7d0f27e
cd nts
7d0f27e
7d0f27e
# simple module load test
7d0f27e
php --no-php-ini \
7d0f27e
    --define extension_dir=%{buildroot}%{php_extdir}/\
7d0f27e
    --define extension=%{ext_name}.so \
7d0f27e
    --modules | grep XCache
7d0f27e
7d0f27e
# upstream unit tests
7d0f27e
TEST_PHP_EXECUTABLE=%{_bindir}/php \
7d0f27e
NO_INTERACTION=1 \
7d0f27e
REPORT_EXIT_STATUS=1 \
7d0f27e
php run-tests.php -n -c xcache-test.ini tests
7d0f27e
7d0f27e
%if %{with_zts}
7d0f27e
cd ../zts
7d0f27e
%{__ztsphp} --no-php-ini \
7d0f27e
    --define extension_dir=%{buildroot}%{php_ztsextdir}/\
7d0f27e
    --define extension=%{ext_name}.so \
7d0f27e
    --modules | grep XCache
7d0f27e
7d0f27e
TEST_PHP_EXECUTABLE=%{__ztsphp} \
7d0f27e
NO_INTERACTION=1 \
7d0f27e
REPORT_EXIT_STATUS=1 \
7d0f27e
%{__ztsphp} run-tests.php -n -c xcache-test.ini tests
7d0f27e
%endif
7d0f27e
7d0f27e
7d0f27e
%files
7d0f27e
%doc nts/{AUTHORS,ChangeLog,COPYING,README,THANKS}
7d0f27e
%config(noreplace) %{_sysconfdir}/php.d/%{ext_name}.ini
7d0f27e
%{php_extdir}/%{ext_name}.so
7d0f27e
7d0f27e
%if %{with_zts}
7d0f27e
%config(noreplace) %{php_ztsinidir}/%{ext_name}.ini
7d0f27e
%{php_ztsextdir}/%{ext_name}.so
7d0f27e
%endif
7d0f27e
7d0f27e
%files -n xcache-admin
7d0f27e
%config(noreplace) %{_sysconfdir}/httpd/conf.d/xcache.conf
7d0f27e
%{_datadir}/xcache
7d0f27e
# No real configuration files, only sample files
7d0f27e
%{_sysconfdir}/xcache
7d0f27e
7d0f27e
7d0f27e
%changelog
e215c97
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-2
e215c97
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
e215c97
65227a0
* Thu Jan 17 2013 Remi Collet <remi@fedoraproject.org> - 3.0.1-1
65227a0
- bugfixes version
65227a0
7d0f27e
* Sat Nov 22 2012 Remi Collet <remi@fedoraproject.org> - 3.0.0-1.1
7d0f27e
- upstream have fixed the sources (review #859504)
7d0f27e
7d0f27e
* Wed Oct 31 2012 Remi Collet <remi@fedoraproject.org> - 3.0.0-1
7d0f27e
- new major version
7d0f27e
- drop xcache-coverager subpackage
7d0f27e
- xcache-admin now provides cacher, coverager and diagnosis
7d0f27e
- run unit tests provided by upstream
7d0f27e
7d0f27e
* Sat Oct 27 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-4
7d0f27e
- drop php prefix from sub packages
7d0f27e
- clean EL-5 stuff
7d0f27e
7d0f27e
* Fri Sep 21 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-3
7d0f27e
- prepare for review with EL-5 stuff
7d0f27e
7d0f27e
* Fri Sep 21 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-2
7d0f27e
- add admin and coverager sub-package
7d0f27e
7d0f27e
* Sun Sep  9 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-1
7d0f27e
- initial package
7d0f27e