# For ART-build %define with_atomicscl %{?_with_atomicscl: 1} %{?!_with_atomicscl: 0} %if %{with_atomicscl} %global scl atomic-php52 %define _scl_prefix /opt/atomic #%_scl_root %endif %if 0%{?scl:1} %scl_package php %else %global pkg_name %{name} %global _root_sysconfdir %{_sysconfdir} %global _root_bindir %{_bindir} %global _root_sbindir %{_sbindir} %global _root_includedir %{_includedir} %global _root_libdir %{_libdir} %global _root_prefix %{_prefix} %if 0%{?rhel} < 6 %global _root_initddir /etc %else %global _root_initddir %{_initddir} %endif %endif %global php_apiver %((echo 0; %{_scl_root}/usr/bin/php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1) %global php_extdir %(%{_scl_root}/usr/bin/php-config --extension-dir 2>/dev/null || echo "undefined") %global php_version %(%{_scl_root}/usr/bin/php-config --version 2>/dev/null || echo 0) %global apache 48 %define module_version 0.9.6.1 Summary: PHP accelerator, optimizer, encoder and dynamic content cacher Name: %{?scl_prefix}php-eaccelerator Version: %{php_version}_%{module_version} # Added because EPEL did this. It wasnt my idea, sorry! Epoch: 1 Release: 3.git42067ac License: GPLv2 and Zend Group: Development/Languages URL: http://eaccelerator.sourceforge.net/ Packager: Scott R. Shinn Vendor: Atomic Rocket Turtle, http://www.atomicrocketturtle.com Source0: http://dl.sf.net/eaccelerator/eaccelerator-eaccelerator-42067ac.tar.gz Source1: php-eaccelerator.cron Patch1: eaccelerator-nophpversioncheck.patch Patch2: fix1.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root #Requires: %{?scl_prefix}php-common%{?_isa} = %{php_version} #Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} #Requires: %{?scl_prefix}php(api) = %{php_core_api} #Provides: %{?scl_prefix}php-zend_extension #Conflicts: %{?scl_prefix}php-mmcache BuildRequires: %{?scl_prefix}php-devel # Required by phpize BuildRequires: autoconf, automake, libtool, gcc-c++, libxml2-devel, libxml2 %description eAccelerator is a further development of the MMCache PHP Accelerator & Encoder. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated. %prep %setup -n eaccelerator-eaccelerator-42067ac #%patch1 -p1 -b .nophpversioncheck #%patch2 -p1 -b .fix1 # Change paths in the example config, other values are changed by a patch %{__sed} -i 's|/usr/lib/php4/|%{php_extdir}/|g; s|/tmp/eaccelerator|%{_scl_root}%{_var}/cache/php-eaccelerator|g' \ eaccelerator.ini %build # Workaround for broken phpize on 64 bits #%{__cat} %{_bindir}/phpize | sed 's|/lib/|/%{_lib}/|g' > phpize && sh phpize %{_scl_root}/usr/bin/phpize %configure \ --without-eaccelerator-use-inode \ --with-php-config=%{_scl_root}/usr/bin/php-config # Dont ever use this. It makes the daemon segfault like crazy. hit damon # --with-eaccelerator-doc-comment-inclusion # Set fcntl based semaphores to avoid ipc based locking issues %{__perl} -pi -e 's|.*(MM_SEM_[A-Z]+).*|/* #undef $1 */|g' config.h %{__perl} -pi -e 's|.*(MM_SEM_FCNTL).*|#define $1 1|g' config.h # Compile! %{__make} %{?_smp_mflags} %install %{__rm} -rf %{buildroot} %{__make} install INSTALL_ROOT=%{buildroot} # The cache directory where pre-compiled files will reside %{__mkdir_p} %{buildroot}%{_localstatedir}/cache/php-eaccelerator # Drop in the bit of configuration %{__install} -D -m 0644 eaccelerator.ini \ %{buildroot}%{_sysconfdir}/php.d/eaccelerator.ini # Cache removal cron job %{__install} -D -m 0755 -p %{SOURCE1} \ %{buildroot}%{_sysconfdir}/cron.daily/php-eaccelerator %clean %{__rm} -rf %{buildroot} %preun # Upon last removal (not update), clean all cache files if [ $1 -eq 0 ]; then %{__rm} -rf %{_var}/cache/php-eaccelerator/* &>/dev/null || : fi %post # We don't want to require "httpd" in case PHP is used with some other web # server or without any, but we do want the owner of this directory to default # to apache for a working "out of the box" experience on the most common setup. # # We can't store numeric ownerships in %%files and have it work, so "fix" here, # but only change the ownership if it's the current user (which is root), which # allows users to manually change ownership and not have it change back. # Create the ghost'ed directory with default ownership and mode if [ ! -d %{_var}/cache/php-eaccelerator ]; then %{__mkdir_p} %{_var}/cache/php-eaccelerator %{__chown} %{apache}.%{apache} %{_var}/cache/php-eaccelerator %{__chmod} 0750 %{_var}/cache/php-eaccelerator fi %check # only check if build extension can be loaded %{_bindir}/php \ -n -q -d extension_dir=modules \ -d extension=eaccelerator.so \ --modules | grep eAccelerator %files %defattr(-, root, root, 0755) %doc AUTHORS ChangeLog COPYING NEWS README* %doc eaccelerator.ini *.php %{_sysconfdir}/cron.daily/php-eaccelerator %config(noreplace) %{_sysconfdir}/php.d/eaccelerator.ini %{php_extdir}/eaccelerator.so %attr(0770,apache,apache)%ghost %{_scl_root}%{_var}/cache/php-eaccelerator/ %changelog * Thu Aug 1 2013 Scott R. Shinn - Update to git42067c for PHP 5.4 * Sun Sep 5 2010 Scott R. Shinn - Update to 0.9.6.1 * Sat Mar 13 2010 Scott R. Shinn - doc-comment-inclusion is an amazingly stupid idea. Hit people that recommend it. * Thu Mar 11 2010 Scott R. Shinn - Add cron job to clean old files - add --with-eaccelerator-doc-comment-inclusion * Mon Dec 15 2008 Scott R. Shinn - relink against 5.2.8 * Tue Jun 3 2008 Scott R. Shinn - relink against 5.2.6 * Mon Dec 10 2007 Scott R. Shinn - update to 0.9.5.2 * Mon Aug 20 2007 Scott R. Shinn - update to 0.9.5.1 * Tue Jul 12 2005 Matthias Saou 4.x.x_0.9.3-4 - 3405/thias - Force SEM to FCNTL as the IPC version is buggy on SMP systems at least. * Fri Jul 1 2005 Matthias Saou 4.x.x_0.9.3-1 - Include buffer overflow patch from zoeloelip. * Tue Jun 21 2005 Matthias Saou 4.x.x_0.9.3-0 - Update to 0.9.3, bugfix release. * Tue Jan 11 2005 Matthias Saou 4.x.x_0.9.2a-0 - Initial RPM release based on the php-mmcache spec file.