%define snap 20020722 %{expand:%%define version %(php -v 2>/dev/null)} %define phpdir %{_libdir}/php %define phpsource /usr/src/php-devel %define release 0.%{snap}.2mdk Summary: Alternative PHP Cache Name: php-apc Version: %{version} Release: %{release} Group: System/Servers URL: http://apc.communityconnect.com/ License: QPL Source0: apc-cvs.tar.bz2 Source1: apc.ini.bz2 Prereq: php-common = %{version} Requires: php-common = %{version} BuildRequires: php-devel = %{version} BuildRequires: perl BuildRoot: %{_tmppath}/%{name}-root Conflicts: php-afterburner %description APC was conceived of to provide a way of boosting the performance of PHP on heavily loaded sites by providing a way for scripts to be cached in a compiled state, so that the overhead of parsing and compiling can be almost completely eliminated. There are commercial products which provide this functionality, but they are neither open-source nor free. Our goal was to level the playing field by providing an implementation that allows greater flexibility and is universally accessible. We also wanted the cache to provide visibility into it's own workings and those of PHP, so time was invested in providing internal diagnostic tools which allow for cache diagnostics and maintenance. Thus arrived APC. Since we were committed to developing a product which can easily grow with new version of PHP, we implemented it as a zend extension, allowing it to either be compiled into PHP or added post facto as a drop in module. As with PHP, it is available completely free for commercial and non-commercial use, under the same terms as PHP itself. APC has been tested under PHP 4.0.3, 4.0.3pl1 and 4.0.4. It currently compiles under Linux and FreeBSD. Patches for ports to other OSs/ PHP versions are welcome. To activate it, append the /etc/apc.ini to your /etc/php.ini file. %prep [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %setup -q -n apc %build # yes i do know ./configure could work... %{phpsource}/buildext apc "php_apc.c apc_iface.c apc_cache.c apc_serialize.c \ apc_rwlock.c apc_sma.c apc_shm.c apc_sem.c apc_lib.c apc_crc32.c apc_fcntl.c \ apc_cache_mm.c apc_nametable.c apc_util.c apc_list.c zend_no_zend.c" "-DCOMPILE_DL_APC" %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} install -d %{buildroot}%{_sysconfdir} install -d %{buildroot}%{phpdir}/extensions install -d %{buildroot}%{_docdir} install -d %{buildroot}/var/cache/apc bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/apc.ini install -m755 apc.so %{buildroot}%{phpdir}/extensions/ cat > README.%{name} <<EOF The php-apc package contains a dynamic shared object (DSO) for PHP4. To activate it, append the /etc/apc.ini to your /etc/php.ini file. (cat /etc/apc.ini >> /etc/php.ini) EOF %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files %defattr(-,root,root) %doc README* BUGS CHANGELOG FAQ GORY_DETAILS INSTALL NOTICE extras/apcinfo.php %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/apc.ini %{phpdir}/extensions/apc.so %dir %attr(0700,apache,apache) /var/cache/apc %changelog * Sat Sep 21 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.2.3-0.20020722.2mdk - added the %{_sysconfdir}/apc.ini file which has to be appended to the %{_sysconfdir}/php.ini file - can't use %%post or %%preun (yet) - Conflicts: php-afterburner - added the cache dir * Fri Sep 20 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.2.3-0.20020722.1mdk - initial cooker contrib