php-pecl-apcu/php-pecl-apcu.spec

342 lines
9.9 KiB
RPMSpec
Raw Normal View History

# spec file for php-pecl-apcu
#
2014-01-13 05:34:21 +00:00
# Copyright (c) 2013-2014 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/3.0/
#
# Please, preserve the changelog entries
#
%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
%{!?php_incldir: %global php_incldir %{_includedir}/php}
%{!?__pecl: %global __pecl %{_bindir}/pecl}
%{!?__php: %global __php %{_bindir}/php}
2013-07-15 14:46:40 +00:00
2013-07-01 14:16:41 +00:00
%global pecl_name apcu
%global with_zts 0%{?__ztsphp:1}
%if "%{php_version}" < "5.6"
%global ini_name %{pecl_name}.ini
%else
%global ini_name 40-%{pecl_name}.ini
%endif
2013-07-01 14:16:41 +00:00
Name: php-pecl-apcu
2013-07-01 14:16:41 +00:00
Summary: APC User Cache
2014-10-27 15:01:35 +00:00
Version: 4.0.7
Release: 2%{?dist}
2013-07-01 14:16:41 +00:00
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
Source1: %{pecl_name}.ini
Source2: %{pecl_name}-panel.conf
Source3: %{pecl_name}.conf.php
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/APCu
BuildRequires: php-devel
BuildRequires: php-pear
2013-07-01 14:59:32 +00:00
BuildRequires: pcre-devel
2013-07-01 14:16:41 +00:00
Requires(post): %{__pecl}
Requires(postun): %{__pecl}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
Obsoletes: php-apcu < 4.0.0-1
Provides: php-apcu = %{version}
Provides: php-apcu%{?_isa} = %{version}
Provides: php-pecl(apcu) = %{version}
Provides: php-pecl(apcu)%{?_isa} = %{version}
2014-01-13 05:34:21 +00:00
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
Conflicts: php-pecl-apc < 4
%else
Obsoletes: php-pecl-apc < 4
%endif
2013-07-01 14:16:41 +00:00
# Same provides than APC, this is a drop in replacement
Provides: php-apc = %{version}
Provides: php-apc%{?_isa} = %{version}
Provides: php-pecl-apc = %{version}
Provides: php-pecl-apc%{?_isa} = %{version}
Provides: php-pecl(APC) = %{version}
Provides: php-pecl(APC)%{?_isa} = %{version}
2013-07-01 14:16:41 +00:00
2014-06-13 09:29:41 +00:00
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
# Filter shared private
2013-07-01 14:16:41 +00:00
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
2014-01-13 05:34:21 +00:00
%endif
2013-07-01 14:16:41 +00:00
%description
APCu is userland caching: APC stripped of opcode caching in preparation
for the deployment of Zend OPcache as the primary solution to opcode
caching in future versions of PHP.
APCu has a revised and simplified codebase, by the time the PECL release
is available, every part of APCu being used will have received review and
where necessary or appropriate, changes.
Simplifying and documenting the API of APCu completely removes the barrier
to maintenance and development of APCu in the future, and additionally allows
us to make optimizations not possible previously because of APC's inherent
complexity.
APCu only supports userland caching (and dumping) of variables, providing an
upgrade path for the future. When O+ takes over, many will be tempted to use
3rd party solutions to userland caching, possibly even distributed solutions;
this would be a grave error. The tried and tested APC codebase provides far
superior support for local storage of PHP variables.
%package devel
Summary: APCu developer files (header)
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: php-devel%{?_isa}
2014-01-13 05:34:21 +00:00
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
Conflicts: php-pecl-apc-devel < 4
%else
Obsoletes: php-pecl-apc-devel < 4
%endif
Provides: php-pecl-apc-devel = %{version}-%{release}
Provides: php-pecl-apc-devel%{?_isa} = %{version}-%{release}
2013-07-01 14:16:41 +00:00
%description devel
These are the files needed to compile programs using APCu.
%package -n apcu-panel
2013-07-01 14:16:41 +00:00
Summary: APCu control panel
Group: Applications/Internet
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: mod_php
Requires: php-gd
Requires: httpd
2014-01-13 05:34:21 +00:00
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
Conflicts: apc-panel < 4
%else
Obsoletes: apc-panel < 4
%endif
Provides: apc-panel = %{version}-%{release}
2013-07-01 14:16:41 +00:00
%description -n apcu-panel
2013-07-01 14:16:41 +00:00
This package provides the APCu control panel, with Apache
configuration, available on http://localhost/apcu-panel/
%prep
%setup -qc
mv %{pecl_name}-%{version} NTS
2014-06-13 09:29:41 +00:00
cd NTS
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APCU_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}.
exit 1
fi
cd ..
2013-07-01 14:16:41 +00:00
%if %{with_zts}
# duplicate for ZTS build
cp -pr NTS ZTS
%endif
# Fix path to configuration file
sed -e s:apc.conf.php:%{_sysconfdir}/apcu-panel/conf.php:g \
-i NTS/apc.php
2013-07-01 14:16:41 +00:00
%build
cd NTS
%{_bindir}/phpize
%configure --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
%{_bindir}/zts-phpize
%configure --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
%endif
%install
# Install the NTS stuff
make -C NTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{SOURCE1} %{buildroot}%{php_inidir}/%{ini_name}
2013-07-01 14:16:41 +00:00
%if %{with_zts}
# Install the ZTS stuff
2013-07-01 14:16:41 +00:00
make -C ZTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{ini_name}
2013-07-01 14:16:41 +00:00
%endif
# Install the package XML file
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# Install the Control Panel
# Pages
2013-07-15 14:42:05 +00:00
install -D -m 644 -p NTS/apc.php \
%{buildroot}%{_datadir}/apcu-panel/index.php
2013-07-01 14:16:41 +00:00
# Apache config
install -D -m 644 -p %{SOURCE2} \
%{buildroot}%{_sysconfdir}/httpd/conf.d/apcu-panel.conf
2013-07-01 14:16:41 +00:00
# Panel config
install -D -m 644 -p %{SOURCE3} \
%{buildroot}%{_sysconfdir}/apcu-panel/conf.php
# Test & Documentation
cd NTS
for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
done
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
2013-07-01 14:16:41 +00:00
%check
cd NTS
# Check than both extensions are reported (BC mode)
%{_bindir}/php -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apcu'
%{_bindir}/php -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apc$'
# Upstream test suite for NTS extension
2013-07-01 14:16:41 +00:00
TEST_PHP_EXECUTABLE=%{_bindir}/php \
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{_bindir}/php -n run-tests.php
%if %{with_zts}
cd ../ZTS
%{__ztsphp} -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apcu'
%{__ztsphp} -n -d extension_dir=modules -d extension=apcu.so -m | grep 'apc$'
# Upstream test suite for ZTS extension
2013-07-01 14:16:41 +00:00
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php
%endif
%post
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%files
%doc %{pecl_docdir}/%{pecl_name}
2013-07-01 14:16:41 +00:00
%{pecl_xmldir}/%{name}.xml
2014-10-27 15:01:35 +00:00
%config(noreplace) %{php_inidir}/%{ini_name}
2013-07-01 14:16:41 +00:00
%{php_extdir}/%{pecl_name}.so
2014-10-27 15:01:35 +00:00
2013-07-01 14:16:41 +00:00
%if %{with_zts}
%{php_ztsextdir}/%{pecl_name}.so
%config(noreplace) %{php_ztsinidir}/%{ini_name}
2013-07-01 14:16:41 +00:00
%endif
2013-07-01 14:16:41 +00:00
%files devel
%doc %{pecl_testdir}/%{pecl_name}
2013-07-01 14:16:41 +00:00
%{php_incldir}/ext/%{pecl_name}
2014-10-27 15:01:35 +00:00
2013-07-01 14:16:41 +00:00
%if %{with_zts}
%{php_ztsincldir}/ext/%{pecl_name}
%endif
%files -n apcu-panel
2013-07-01 14:16:41 +00:00
# Need to restrict access, as it contains a clear password
%attr(550,apache,root) %dir %{_sysconfdir}/apcu-panel
%config(noreplace) %{_sysconfdir}/apcu-panel/conf.php
%config(noreplace) %{_sysconfdir}/httpd/conf.d/apcu-panel.conf
%{_datadir}/apcu-panel
2013-07-01 14:16:41 +00:00
%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2014-10-27 15:01:35 +00:00
* Mon Oct 27 2014 Remi Collet <remi@fedoraproject.org> - 4.0.7-1
- Update to 4.0.7
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Thu Jun 19 2014 Remi Collet <rcollet@redhat.com> - 4.0.6-2
- rebuild for https://fedoraproject.org/wiki/Changes/Php56
2014-06-13 09:29:41 +00:00
* Thu Jun 12 2014 Remi Collet <remi@fedoraproject.org> - 4.0.6-1
- Update to 4.0.6 (beta)
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed Apr 23 2014 Remi Collet <remi@fedoraproject.org> - 4.0.4-2
- add numerical prefix to extension configuration file
2014-03-03 07:02:30 +00:00
* Sat Mar 01 2014 Remi Collet <remi@fedoraproject.org> - 4.0.4-1
- Update to 4.0.4 (beta)
* Mon Jan 27 2014 Remi Collet <remi@fedoraproject.org> - 4.0.3-1
- Update to 4.0.3 (beta)
- install doc in pecl doc_dir
- install tests in pecl test_dir (in devel)
- cleanup SCL stuff
2014-01-13 05:34:21 +00:00
* Mon Jan 13 2014 Remi Collet <rcollet@redhat.com> - 4.0.2-3
- EPEL-7 build
* Mon Sep 16 2013 Remi Collet <rcollet@redhat.com> - 4.0.2-2
- fix perm on config dir
- improve SCL compatibility
- always provides php-pecl-apc-devel and apc-panel
2013-09-16 08:09:04 +00:00
* Mon Sep 16 2013 Remi Collet <remi@fedoraproject.org> - 4.0.2-1
- Update to 4.0.2
* Sat Jul 27 2013 Remi Collet <remi@fedoraproject.org> - 4.0.1-3
- restore APC serializers ABI (patch merged upstream)
2013-07-15 14:42:05 +00:00
* Mon Jul 15 2013 Remi Collet <rcollet@redhat.com> - 4.0.1-2
- adapt for SCL
2013-07-01 14:16:41 +00:00
* Tue Apr 30 2013 Remi Collet <remi@fedoraproject.org> - 4.0.1-1
- Update to 4.0.1
- add missing scriptlet
- fix Conflicts
* Thu Apr 25 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-2
- fix segfault when used from command line
* Wed Mar 27 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-1
- first pecl release
- rename from php-apcu to php-pecl-apcu
* Tue Mar 26 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.4.git4322fad
- new snapshot (test before release)
* Mon Mar 25 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.3.git647cb2b
- new snapshot with our pull request
- allow to run test suite simultaneously on 32/64 arch
- build warning free
* Mon Mar 25 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.2.git6d20302
- new snapshot with full APC compatibility
* Sat Mar 23 2013 Remi Collet <remi@fedoraproject.org> - 4.0.0-0.1.git44e8dd4
- initial package, version 4.0.0