# 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 # 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: 4.3.4 Release: 3 License: The PHP license Group: Development/Languages URL: http://www.php.net/ BuildRoot: /var/tmp/%{name}-buildroot 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 # Below line will force a skip of the APXS install export INSTALL_IT="" make -e install %if %{apache_version} # Install the Apache module manually mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache install -m 755 libs/libphp4.so $RPM_BUILD_ROOT%{_libdir}/apache %endif # Install the config file mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} install -m 644 php.ini-dist $RPM_BUILD_ROOT%{_sysconfdir}/php.ini # Install the command line binary mkdir -p $RPM_BUILD_ROOT%{_bindir} install -m 755 sapi/cli/php $RPM_BUILD_ROOT%{_bindir} # Put the PEAR config file in the right place # TODO: does PEAR still find it? mv $RPM_BUILD_ROOT%{_prefix}/etc/pear.conf $RPM_BUILD_ROOT%{_sysconfdir} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %if %{apache_version} %{_libdir}/apache/libphp4.so %endif %{_bindir}/* %{_includedir}/php %{_libdir}/php %{_mandir}/* %config(noreplace) %{_sysconfdir}/php.ini %config %{_sysconfdir}/pear.conf %doc CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS README.* TODO TODO.BUILDv5 %changelog * Sun Sep 28 2003 Tim Jackson - Updated to 4.3.3; included pear.conf * Sat May 31 2003 Tim Jackson - Updated to 4.3.2; included CLI man page * Thu Mar 13 2003 Tim Jackson - Updated to 4.3.1 * Thu Jan 16 2003 Tim Jackson - Updated to 4.3.0 - Tidied up a lot, removed separate command line build * Wed Nov 27 2002 Tim Jackson - Updated to 4.3.0RC1 * Sat Sep 06 2002 Tim Jackson - Updated to 4.2.3 - Included option to change config file path for commandline and Apache versions * Mon Jul 22 2002 Tim Jackson - Updated to 4.2.2 * Sat May 18 2002 Tim Jackson - Updated to 4.2.1 * Thu Apr 25 2002 Tim Jackson - Updated to 4.2.0 - Added commandline_version option - Moved php.ini to /etc by default (makes more sense) * Sat Mar 9 2002 Tim Jackson - Updated to 4.1.2 * Thu Dec 27 2001 Tim Jackson - Updated to 4.1.1 * Sun Dec 23 2001 Tim Jackson - Updated to 4.1.0 - Moved php.ini into %config section - Substantially changed the way it installs (doesn't use APXS any more, since APXS was not installing into the BuildRoot) - Added %doc section * Wed Nov 28 2001 Tim Jackson - Initial packaging by Tim Jackson, includes command line and Apache module versions