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