%define php_extdir /var/asl/%{_libdir}/php %{!?php_version:%define php_version %(/var/asl/usr/bin/php-config --version 2>/dev/null || echo 5.4.0)} %define module_version 0.9.6.1 Summary: PHP accelerator, optimizer, encoder and dynamic content cacher Name: asl-php-eaccelerator Version: %{php_version}_%{module_version} # Added because EPEL did this. It wasnt my idea, sorry! Release: 1 License: GPL Group: Development/Languages URL: http://eaccelerator.sourceforge.net/ Packager: Scott R. Shinn Vendor: Atomic Rocket Turtle, http://www.atomicrocketturtle.com Source: http://dl.sf.net/eaccelerator/eaccelerator-%{module_version}.tar.bz2 Patch1: eaccelerator-nophpversioncheck.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires: asl-php = %{php_version} BuildRequires: asl-php, asl-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-%{module_version} #%patch -p1 %patch1 -p1 -b .nophpversioncheck %build # HACK! (NOTE: need to fix this in the asl-php package) cp /var/asl/usr/bin/php-config . perl -p -i -e 's[include_dir=".*][include_dir="/var/asl/usr/include/php"]g' php-config perl -p -i -e 's[extension_dir=.*][extension_dir="/var/asl/usr/%{_lib}/php/modules"]g' php-config chmod +x php-config # Workaround for broken phpize on 64 bits (added php to the end for fc11) %{__cat} /var/asl/usr/bin/phpize \ | sed 's|/lib/|/%{_lib}/|g' \ | sed 's|phpdir="/usr|phpdir="/var/asl/usr|g' \ | sed 's|includedir=".*|includedir="/var/asl/usr/include/php"|' > phpize perl -p -i -e "s[^phpdir=.*][phpdir=/var/asl/usr/%{_lib}/php/build]g" phpize sh phpize %configure \ --with-php-config=./php-config # 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}/var/asl/cache/php-eaccelerator # Drop in the bit of configuration %{__mkdir_p} %{buildroot}/var/asl/%{_sysconfdir}/php.d %{__cat} > %{buildroot}/var/asl/%{_sysconfdir}/php.d/eaccelerator.ini << 'EOF' ; Enable eAccelerator extension module zend_extension = %{php_extdir}/modules/eaccelerator.so ; Options for the eAccelerator module eaccelerator.cache_dir = /var/asl/cache/php-eaccelerator eaccelerator.shm_size = 0 eaccelerator.enable = 1 eaccelerator.optimizer = 1 eaccelerator.check_mtime = 1 eaccelerator.filter = "" eaccelerator.shm_max = 0 eaccelerator.shm_ttl = 3600 eaccelerator.shm_prune_period = 0 eaccelerator.shm_only = 0 eaccelerator.compress = 1 eaccelerator.compress_level = 9 eaccelerator.keys = "shm_and_disk" eaccelerator.sessions = "shm_and_disk" eaccelerator.content = "shm_and_disk" eaccelerator.debug = 0 EOF %clean %{__rm} -rf %{buildroot} %files %defattr(-, root, root, 0755) %doc AUTHORS ChangeLog COPYING NEWS README* %doc eaccelerator.ini *.php %config(noreplace) /var/asl/%{_sysconfdir}/php.d/eaccelerator.ini /var/asl/usr/%{_lib}/php/modules/eaccelerator.so %attr(0750, tortix, tortix) /var/asl/cache/php-eaccelerator %changelog * Sun Oct 11 2009 Scott R. Shinn - Initial build for ASL-Web