michael@503: ## michael@503: ## apache-php.spec -- OpenPKG RPM Package Specification michael@503: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@503: ## michael@503: ## Permission to use, copy, modify, and distribute this software for michael@503: ## any purpose with or without fee is hereby granted, provided that michael@503: ## the above copyright notice and this permission notice appear in all michael@503: ## copies. michael@503: ## michael@503: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@503: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@503: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@503: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@503: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@503: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@503: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@503: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@503: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@503: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@503: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@503: ## SUCH DAMAGE. michael@503: ## michael@503: michael@503: # package information michael@503: Name: apache-php michael@503: Summary: Apache Extension: PHP Scripting Language michael@503: URL: http://www.php.net/ michael@503: Vendor: The PHP Project michael@503: Packager: OpenPKG Foundation e.V. michael@503: Distribution: OpenPKG Community michael@503: Class: BASE michael@503: Group: Web michael@503: License: PHP michael@749: Version: 5.4.8 michael@504: Release: 20120800 michael@503: michael@503: # package options michael@503: %option with_bc no michael@503: %option with_bdb no michael@503: %option with_bzip2 no michael@503: %option with_calendar no michael@503: %option with_ctype no michael@503: %option with_curl no michael@503: %option with_debug no michael@503: %option with_dom no michael@503: %option with_exif no michael@503: %option with_freetype no michael@503: %option with_ftp no michael@503: %option with_gd no michael@503: %option with_gdbm no michael@503: %option with_gettext no michael@503: %option with_iconv no michael@503: %option with_imap no michael@503: %option with_json no michael@503: %option with_tokenizer no michael@503: %option with_mbregex no michael@503: %option with_mbstring no michael@503: %option with_mcrypt no michael@503: %option with_mhash no michael@503: %option with_mm no michael@503: %option with_mysql no michael@503: %option with_mysqlnd no michael@503: %option with_oci8 no michael@503: %option with_odbc no michael@503: %option with_openldap no michael@503: %option with_openldapsasl no michael@503: %option with_pear no michael@503: %option with_pgsql no michael@503: %option with_posix no michael@503: %option with_sendmail no michael@503: %option with_session no michael@503: %option with_simplexml no michael@503: %option with_snmp no michael@503: %option with_soap no michael@503: %option with_sqlite no michael@503: %option with_ssl no michael@503: %option with_tidy no michael@503: %option with_versioning no michael@503: %option with_wddx no michael@503: %option with_xml no michael@749: %option with_xmlwriter no michael@503: %option with_xslt no michael@503: %option with_zlib no michael@503: %option with_zip no michael@503: michael@503: # fixing implicit extension dependencies and correlations michael@503: %if "%{with_mm}" == "yes" michael@503: %undefine with_session michael@503: %define with_session yes michael@503: %endif michael@503: %if "%{with_pear}" == "yes" michael@503: %undefine with_xml michael@503: %define with_xml yes michael@503: %endif michael@503: %if "%{with_freetype}" == "yes" michael@503: %undefine with_gd michael@503: %define with_gd yes michael@503: %endif michael@503: %if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes" || "%{with_zip}" == "yes" michael@503: %undefine with_zlib michael@503: %define with_zlib yes michael@503: %endif michael@503: %if "%{with_xslt}" == "yes" michael@503: %undefine with_dom michael@503: %define with_dom yes michael@503: %endif michael@503: %if "%{with_dom}" == "yes" michael@503: %undefine with_xml michael@503: %define with_xml yes michael@503: %endif michael@503: %if "%{with_soap}" == "yes" michael@503: %undefine with_xml michael@503: %define with_xml yes michael@503: %endif michael@503: %if "%{with_pgsql}" == "yes" michael@503: %undefine with_ssl michael@503: %define with_ssl yes michael@503: %endif michael@503: michael@503: # list of sources michael@503: Source0: http://static.php.net/www.php.net/distributions/php-%{version}.tar.bz2 michael@503: Source1: apache-php.ini michael@503: Source2: apache-php.conf michael@503: Patch0: apache-php.patch michael@503: michael@503: # build information michael@671: BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, flex, bison michael@671: PreReq: OpenPKG, openpkg >= 20100101 michael@503: BuildPreReq: apache michael@503: PreReq: apache michael@503: BuildPreReq: pcre michael@503: PreReq: pcre michael@503: %if "%{with_sqlite}" == "yes" michael@503: BuildPreReq: sqlite michael@503: PreReq: sqlite michael@503: %endif michael@503: %if "%{with_mysql}" == "yes" michael@503: BuildPreReq: mysql michael@503: PreReq: mysql michael@503: %endif michael@503: %if "%{with_pgsql}" == "yes" michael@503: BuildPreReq: postgresql michael@503: PreReq: postgresql michael@503: %endif michael@503: %if "%{with_gd}" == "yes" michael@503: BuildPreReq: gd >= 2.0.20, jpeg, png michael@503: PreReq: gd >= 2.0.20, jpeg, png michael@503: %endif michael@503: %if "%{with_bdb}" == "yes" michael@503: BuildPreReq: db michael@503: PreReq: db michael@503: %endif michael@503: %if "%{with_zlib}" == "yes" michael@503: BuildPreReq: zlib michael@503: PreReq: zlib michael@503: %endif michael@503: %if "%{with_bzip2}" == "yes" michael@503: BuildPreReq: bzip2 michael@503: PreReq: bzip2 michael@503: %endif michael@503: %if "%{with_ssl}" == "yes" michael@503: BuildPreReq: openssl michael@503: PreReq: openssl michael@503: %endif michael@503: %if "%{with_openldap}" == "yes" michael@503: BuildPreReq: openldap michael@503: PreReq: openldap michael@503: %if "%{with_openldapsasl}" == "yes" michael@503: BuildPreReq: openldap::with_sasl = yes michael@503: PreReq: openldap::with_sasl = yes michael@503: %else michael@503: BuildPreReq: openldap::with_sasl = no michael@503: PreReq: openldap::with_sasl = no michael@503: %endif michael@503: %endif michael@503: %if "%{with_mm}" == "yes" michael@503: BuildPreReq: mm michael@503: PreReq: mm michael@503: %endif michael@503: %if "%{with_freetype}" == "yes" michael@503: BuildPreReq: freetype michael@503: PreReq: freetype michael@503: %endif michael@503: %if "%{with_gettext}" == "yes" michael@503: BuildPreReq: gettext, libiconv michael@503: PreReq: gettext, libiconv michael@503: %endif michael@503: %if "%{with_iconv}" == "yes" michael@503: BuildPreReq: libiconv michael@503: PreReq: libiconv michael@503: %endif michael@503: %if "%{with_imap}" == "yes" michael@503: BuildPreReq: imap, openssl michael@503: PreReq: imap, openssl michael@503: %endif michael@503: %if "%{with_xml}" == "yes" michael@503: BuildPreReq: libxml michael@503: PreReq: libxml michael@503: %endif michael@749: %if "%{with_xmlwriter}" == "yes" michael@749: %undefine with_xml michael@749: %define with_xml yes michael@749: %endif michael@503: %if "%{with_xslt}" == "yes" michael@503: BuildPreReq: libxslt michael@503: PreReq: libxslt michael@503: %endif michael@503: %if "%{with_dom}" == "yes" michael@503: BuildPreReq: libxml, libxslt michael@503: PreReq: libxml, libxslt michael@503: %endif michael@503: %if "%{with_curl}" == "yes" michael@503: BuildPreReq: curl michael@503: PreReq: curl michael@503: %endif michael@503: %if "%{with_mhash}" == "yes" michael@503: BuildPreReq: mhash michael@503: PreReq: mhash michael@503: %endif michael@503: %if "%{with_mcrypt}" == "yes" michael@503: BuildPreReq: libmcrypt michael@503: PreReq: libmcrypt michael@503: %endif michael@503: %if "%{with_gdbm}" == "yes" michael@503: BuildPreReq: gdbm, gdbm::with_ndbm = yes michael@503: PreReq: gdbm, gdbm::with_ndbm = yes michael@503: %endif michael@503: %if "%{with_oci8}" == "yes" michael@503: BuildPreReq: oracle michael@503: PreReq: oracle michael@503: %endif michael@503: %if "%{with_snmp}" == "yes" michael@503: BuildPreReq: snmp michael@503: PreReq: snmp michael@503: %endif michael@503: %if "%{with_odbc}" == "yes" michael@503: BuildPreReq: unixodbc michael@503: PreReq: unixodbc michael@503: %endif michael@503: %if "%{with_sendmail}" == "yes" michael@503: BuildPreReq: MTA michael@503: PreReq: MTA michael@503: %endif michael@503: %if "%{with_simplexml}" == "yes" michael@503: BuildPreReq: libxml michael@503: PreReq: libxml michael@503: %endif michael@503: %if "%{with_tidy}" == "yes" michael@503: BuildPreReq: tidy michael@503: PreReq: tidy michael@503: %endif michael@503: michael@503: %description michael@503: PHP is an HTML-embedded scripting language. Much of its syntax is michael@503: borrowed from C, Java and Perl with a couple of unique PHP-specific michael@503: features thrown in. The goal of the language is to allow web michael@503: developers to write dynamically generated pages quickly. michael@503: michael@503: This package provides a Dynamic Shared Object (DSO) for the Apache michael@503: HTTP 2.2 web server. In general speaking, this module is also known michael@503: as mod_php. michael@503: michael@503: %track michael@503: prog apache-php = { michael@503: version = %{version} michael@503: url = http://www.php.net/downloads.php michael@503: regex = php-(5\.\d+\.\d+)\.tar\.(bz2|gz) michael@503: } michael@503: michael@503: %prep michael@503: %setup -q -n php-%{version} michael@503: %{l_shtool} subst \ michael@503: -e 's;-i -a -n php5;-i -n php5;' \ michael@503: configure michael@503: %{l_shtool} subst \ michael@503: -e 's;\(/include\)/freetype2;\1;' \ michael@503: configure \ michael@503: ext/gd/config.m4 michael@503: %patch -p0 michael@503: michael@503: %build michael@503: # configure package michael@503: case "%{l_platform -t}" in michael@503: *-sunos5.10 ) cflags="%{l_cflags}" ;; michael@503: * ) cflags="%{l_cflags -O}" ;; michael@503: esac michael@503: cppflags="%{l_cppflags}" michael@503: ldflags="%{l_ldflags}" michael@503: libs="" michael@503: %if "%{with_gdbm}" == "yes" michael@503: libs="$libs -lndbm -lgdbm" michael@503: %endif michael@503: %if "%{with_gd}" == "yes" michael@503: libs="$libs -lpng -lz" michael@503: %endif michael@503: %if "%{with_gettext}" == "yes" michael@503: libs="$libs -liconv" michael@503: %endif michael@503: %if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes" michael@503: libs="$libs -lsasl2" michael@503: %endif michael@503: %if "%{with_imap}" == "yes" michael@503: libs="$libs -lssl -lcrypto" michael@503: %endif michael@503: %if "%{with_bdb}" == "yes" michael@503: libs="$libs -ldb" michael@503: %endif michael@503: %if "%{with_pgsql}" == "yes" michael@503: libs="$libs `pg_config --libs`" michael@503: %endif michael@503: %if "%{with_oci8}" == "yes" michael@503: ORACLE_HOME="`%{l_rc} --query oracle_home`" michael@503: export ORACLE_HOME michael@503: %endif michael@503: CC="%{l_cc}" \ michael@503: CFLAGS="$cflags" \ michael@503: CPPFLAGS="$cppflags" \ michael@503: LDFLAGS="$ldflags" \ michael@503: LIBS="$libs" \ michael@503: %if "%{with_sendmail}" == "yes" michael@503: PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \ michael@503: %else michael@503: PROG_SENDMAIL="`%{l_shtool} path false`" \ michael@503: %endif michael@503: ./configure \ michael@503: --prefix=%{l_prefix} \ michael@503: --sysconfdir=%{l_prefix}/etc/apache \ michael@503: --with-config-file-path=%{l_prefix}/etc/apache \ michael@503: --libdir=%{l_prefix}/lib/php \ michael@503: --disable-all \ michael@503: --enable-pdo \ michael@503: --enable-filter \ michael@503: --with-pcre-regex=%{l_prefix} \ michael@503: %if "%{with_calendar}" == "yes" michael@503: --enable-calendar \ michael@503: %endif michael@503: %if "%{with_sqlite}" == "yes" michael@503: --with-sqlite3=%{l_prefix} \ michael@503: --with-pdo-sqlite=%{l_prefix} \ michael@503: %else michael@503: --without-pdo-sqlite \ michael@503: %endif michael@503: %if "%{with_mysql}" == "yes" || "%{with_mysqlnd}" == "yes" michael@503: %if "%{with_mysqlnd}" == "yes" michael@503: --with-mysql=mysqlnd \ michael@503: --with-pdo-mysql=mysqlnd \ michael@503: %else michael@503: --with-mysql=%{l_prefix} \ michael@503: --with-pdo-mysql=%{l_prefix} \ michael@503: %endif michael@503: --with-mysqli=mysqlnd \ michael@503: --with-mysql-sock=%{l_prefix}/var/mysql/mysql.sock \ michael@503: %else michael@503: --without-mysql \ michael@503: --without-pdo-mysql \ michael@503: %endif michael@503: %if "%{with_pgsql}" == "yes" michael@503: --with-pgsql=%{l_prefix} \ michael@503: --with-pdo-pgsql=%{l_prefix} \ michael@503: %else michael@503: --without-pgsql \ michael@503: %endif michael@503: %if "%{with_posix}" == "yes" michael@503: --enable-posix \ michael@503: %endif michael@503: %if "%{with_gd}" == "yes" michael@503: --with-gd=yes \ michael@503: --with-jpeg-dir=%{l_prefix} \ michael@503: --with-png-dir=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_freetype}" == "yes" michael@503: --enable-gd-native-ttf \ michael@503: --with-freetype-dir=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_bdb}" == "yes" michael@503: --with-db4=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_debug}" == "yes" michael@503: --enable-debug \ michael@503: %else michael@503: --disable-debug \ michael@503: %endif michael@503: %if "%{with_zlib}" == "yes" michael@503: --with-zlib=%{l_prefix} \ michael@503: --with-zlib-dir=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_bzip2}" == "yes" michael@503: --with-bz2=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_ssl}" == "yes" || "%{with_openldap}" == "yes" michael@503: --with-openssl=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_openldap}" == "yes" michael@503: --with-ldap=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_session}" == "yes" michael@503: --enable-session \ michael@503: %endif michael@503: %if "%{with_mm}" == "yes" michael@503: --with-mm=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_ftp}" == "yes" michael@503: --enable-ftp \ michael@503: %endif michael@503: %if "%{with_oci8}" == "yes" michael@503: --with-oci8 \ michael@503: %endif michael@503: %if "%{with_gettext}" == "yes" michael@503: --with-gettext=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_imap}" == "yes" michael@503: --with-imap=%{l_prefix} \ michael@503: --with-imap-ssl=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_json}" == "yes" michael@503: --enable-json \ michael@503: %else michael@503: --disable-json \ michael@503: %endif michael@503: %if "%{with_tokenizer}" == "yes" michael@503: --enable-tokenizer \ michael@503: %else michael@503: --disable-tokenizer \ michael@503: %endif michael@503: %if "%{with_xml}" == "yes" michael@503: --enable-xml \ michael@503: --enable-xmlreader \ michael@503: --enable-libxml \ michael@503: --with-libxml-dir=%{l_prefix} \ michael@503: %else michael@503: --disable-xml \ michael@503: %endif michael@503: %if "%{with_xslt}" == "yes" michael@503: --with-xsl=%{l_prefix} \ michael@503: %else michael@503: --without-xsl \ michael@503: %endif michael@503: %if "%{with_dom}" == "yes" michael@503: --enable-dom \ michael@503: %else michael@503: --disable-dom \ michael@503: %endif michael@503: %if "%{with_wddx}" == "yes" michael@503: --enable-wddx \ michael@503: %endif michael@503: %if "%{with_soap}" == "yes" michael@503: --enable-soap \ michael@503: %endif michael@503: %if "%{with_bc}" == "yes" michael@503: --enable-bcmath \ michael@503: %endif michael@503: %if "%{with_mhash}" == "yes" michael@503: --with-mhash=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_mcrypt}" == "yes" michael@503: --with-mcrypt=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_ctype}" == "yes" michael@503: --enable-ctype \ michael@503: %endif michael@503: %if "%{with_curl}" == "yes" michael@503: --with-curl=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_gdbm}" == "yes" michael@503: --with-gdbm=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_versioning}" == "yes" michael@503: --enable-versioning \ michael@503: %endif michael@503: %if "%{with_pear}" == "yes" michael@503: --with-pear=%{l_prefix}/lib/php \ michael@503: %else michael@503: --without-pear \ michael@503: %endif michael@503: %if "%{with_simplexml}" == "yes" michael@503: --enable-simplexml \ michael@503: --enable-libxml \ michael@503: --with-libxml-dir=%{l_prefix} \ michael@503: %else michael@503: --disable-simplexml \ michael@503: %endif michael@503: %if "%{with_snmp}" == "yes" michael@503: --with-snmp=%{l_prefix} \ michael@503: --with-openssl-dir=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_odbc}" == "yes" michael@503: --with-unixODBC=%{l_prefix} \ michael@503: --with-pdo-odbc=unixODBC,%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_mbregex}" == "yes" michael@503: --enable-mbregex \ michael@503: %endif michael@503: %if "%{with_mbstring}" == "yes" michael@503: --enable-mbstring \ michael@503: %endif michael@503: %if "%{with_exif}" == "yes" michael@503: --with-exif \ michael@503: %endif michael@503: %if "%{with_iconv}" == "yes" michael@503: --with-iconv=%{l_prefix} \ michael@503: %endif michael@503: %if "%{with_tidy}" == "yes" michael@503: --with-tidy=%{l_prefix} \ michael@503: %else michael@503: --without-tidy \ michael@503: %endif michael@503: %if "%{with_zip}" == "yes" michael@503: --enable-zip \ michael@503: %endif michael@749: %if "%{with_xmlwriter}" == "yes" michael@749: --enable-xmlwriter \ michael@749: %endif michael@503: --with-apxs2=%{l_prefix}/sbin/apxs \ michael@503: --disable-cli \ michael@503: --disable-cgi michael@503: michael@503: # build package michael@504: %{l_make} %{l_mflags -O} michael@503: michael@503: %install michael@503: # install package michael@503: %{l_make} %{l_mflags} install-sapi INSTALL_ROOT=$RPM_BUILD_ROOT michael@503: mv $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/libphp5.so \ michael@503: $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/mod_php.so michael@503: michael@503: # install default configuration file michael@503: %{l_shtool} mkdir -f -p -m 755 \ michael@503: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d michael@503: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@503: %{SOURCE apache-php.ini} \ michael@503: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ michael@503: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@503: %{SOURCE apache-php.conf} \ michael@503: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/ michael@503: michael@503: # create session storage directory michael@503: %if "%{with_session}" == "yes" michael@731: %{l_shtool} mkdir -f -p -m 775 \ michael@503: $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache-php.session michael@503: %endif michael@503: michael@503: # determine installation files michael@503: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ michael@503: %if "%{with_session}" == "yes" michael@731: '%attr(0770,%{l_rusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache-php.session' \ michael@503: %endif michael@503: '%config %{l_prefix}/etc/apache/apache-php.ini' \ michael@503: '%config %{l_prefix}/etc/apache/apache.d/apache-php.conf' michael@503: michael@503: %files -f files michael@503: michael@503: %clean michael@503: michael@503: %post michael@503: # after upgrade, restart service michael@503: [ $1 -eq 2 ] || exit 0 michael@503: eval `%{l_rc} apache status 2>/dev/null` michael@503: [ ".$apache_active" = .yes ] && %{l_rc} apache restart michael@503: exit 0 michael@503: