# Set to 1 to build an Apache version %define apache_version 1 # The options you want to build PHP with %define config_options --with-mysql --with-zlib --with-dom --with-gdbm # Standard config options to build with %define standard_options --with-exec-dir=%{_bindir} --prefix=%{_prefix} --mandir=%{_mandir} --with-config-file-path=%{_sysconfdir} Summary: PHP: Hypertext Preprocessor Name: php Version: 5.0.0b2 Release: 1 License: The PHP license Group: Development/Languages URL: http://www.php.net/ Source: http://www.php.net/distributions/php-%{version}.tar.bz2 %if %{apache_version} Requires: apache BuildPrereq: apache-devel %endif Packager: Tim Jackson BuildRoot: /var/tmp/%{name}-buildroot %description PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly. %prep %setup -q %build %if %{apache_version} ./configure --with-apxs %{standard_options} %{config_options} %else ./configure %{standard_options} %{config_options} %endif make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT # Use the makefile, with some mods export INSTALL_ROOT=$RPM_BUILD_ROOT %if %{apache_version} # PHP expects to be able to fiddle with the Apache config mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf cp -p %{_sysconfdir}/httpd/conf/httpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf/ %endif make install # No thanks, we'll update the Apache config ourselves %if %{apache_version} rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/httpd %endif # Install the config file mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} install -m 644 php.ini-recommended $RPM_BUILD_ROOT%{_sysconfdir}/php.ini %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %if %{apache_version} %{_libdir}/apache/libphp5.so %endif %{_bindir}/* %{_includedir}/php %{_libdir}/php %{_mandir}/* %config(noreplace) %{_sysconfdir}/php.ini %config(noreplace) %{_prefix}%{_sysconfdir}/pear.conf %doc CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS README.* TODO* %changelog * Thu Oct 30 2003 Tim Jackson - New version for PHP 5