%define phpsource %{_prefix}/src/php-devel %{expand:%(cat /usr/src/php-devel/PHP_BUILD||(echo -e "error: failed build dependencies:\n php-devel >= 430 (4.3.0) is needed by this package." >/dev/stderr;kill -2 $PPID))} %define rversion 2.0 %define snap 20030218 %define release 0.%{snap}.1mdk %define realname apc (Alternative PHP Cache) %define modname apc %define dirname %{modname} %define soname %{modname}.so %define inifile 99_%{modname}.ini Summary: The %{realname} module for PHP Name: php-%{modname} Version: %{phpversion}_%{rversion} Release: %{release} Group: System/Servers URL: http://apc.communityconnect.com/ License: PHP License Source0: apc-%{snap}.tar.bz2 Source1: apc.ini.bz2 Requires: libphp_common%{libversion} Requires: php%{libversion} BuildRequires: php%{libversion}-devel BuildRoot: %{_tmppath}/%{name}-root Provides: ADVXpackage Conflicts: php-afterburner php-mmcache %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. NOTE!: %{name} has to be loaded last, very important! %prep %setup -q -n apc-%{snap} %build phpize aclocal %configure --with-apc %make # sort of make test... pushd test make ./apc_sma.t 128 2048 2> ../README.testrun.%{modname} popd mv modules/*.so . %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} mkdir -p %{buildroot}%{phpdir}/extensions mkdir -p %{buildroot}%{_sysconfdir}/php cat > README.%{modname} << EOF The %{name} package contains a dynamic shared object (DSO) for PHP. NOTE!: %{name} has to be loaded last, very important! There's also a apc-gui v1.0.3, but it does not work 100% and it seems unmaintained. But anyway check here if you want to hack it to work: http://apc.neuropeans.com/ EOF bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/php/%{inifile} install -m755 %{soname} %{buildroot}%{phpdir}/extensions/ %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files %defattr(-,root,root) %doc CHANGELOG INSTALL NOTICE README.%{modname} README.testrun.%{modname} %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/php/%{inifile} %{phpdir}/extensions/%{soname} %changelog * Tue Feb 18 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 4.3.1_2.0-0.20030218.1mdk - update from CVS - fix the php versioning * Mon Feb 17 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0-0.20030217.1mdk - update from CVS - updated S1 - run the brute force tests and save the results in docs dir * Sat Feb 15 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0-0.20030214.1mdk - brand new spanking version! - new license - updated S1 - conflicts with php-mmcache - misc spec file fixes * Wed Feb 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.1.0-0.20020722.7mdk - fix a silly bug in the tmpwatch invocation * Sun Jan 19 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.1.0-0.20020722.6mdk - really rebuilt against rebuilt buildrequires * Sat Jan 18 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.1.0-0.20020722.5mdk - rebuilt against rebuilt buildrequires * Mon Jan 13 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.1.0-0.20020722.4mdk - added a tmpwatch command so that the cache gets cleared if needed on a daily basis, otherwise bad things might happen if not enough space availible in /var/cache/apc ;) * Sun Jan 12 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.1.0-0.20020722.3mdk - fix S1 - install apcinfo.php into webspace (go to http://localhost/apcinfo.php) * Fri Jan 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.1.0-0.20020722.2mdk - built against php-4.3.0 - follow the spec file design as in main * Tue Nov 26 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.1.0-0.20020722.1mdk - fix version (duh!) - fix description - fix the README file - fix dir perms on /var/cache/apc * 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