head	1.8;
access;
symbols;
locks; strict;
comment	@-- @;


1.8
date	2007.06.22.11.02.15;	author rse;	state dead;
branches;
next	1.7;
commitid	Z5FSE1qba3VhKTms;

1.7
date	2007.06.06.12.34.20;	author rse;	state Exp;
branches;
next	1.6;
commitid	3ylVY4FjskBPLQks;

1.6
date	2007.06.06.11.06.07;	author rse;	state Exp;
branches;
next	1.5;
commitid	WNwGWCrW5tWyhQks;

1.5
date	2007.06.02.11.11.48;	author rse;	state Exp;
branches;
next	1.4;
commitid	xh77Lz1FYu2vrkks;

1.4
date	2007.06.01.09.53.31;	author thl;	state Exp;
branches;
next	1.3;
commitid	hYubFJtT7rCD2cks;

1.3
date	2007.05.31.13.23.00;	author thl;	state Exp;
branches;
next	1.2;
commitid	qxFROf6SFZYte5ks;

1.2
date	2007.05.30.17.27.37;	author rse;	state Exp;
branches;
next	1.1;
commitid	aJPYHL1mGEgoCYjs;

1.1
date	2007.05.30.10.15.07;	author rse;	state Exp;
branches;
next	;
commitid	IVSJKgweXhZ1eWjs;


desc
@@


1.8
log
@new OpenPKG world order: upgrade from Apache 1.3 to 2.2 (part 3/3: remove obsolete packages)
@
text
@##
##  apache2-php.spec -- OpenPKG RPM Package Specification
##  Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
##  Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##

#   package versions
%define       V_php                     5.2.3
%define       V_php_suhosin_p           5.2.3-0.9.6.2
%define       V_php_suhosin_e           0.9.20
%define       V_php_hardened            5.1.6-0.4.15

#   package information
Name:         apache2-php
Summary:      Apache Extension: PHP Scripting Language
URL:          http://www.php.net/
Vendor:       The PHP Project
Packager:     OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class:        EVAL
Group:        Web
License:      PHP
Version:      %{V_php}
Release:      20070606

#   package options
%option       with_suhosin              no
%option       with_hardened             no
%option       with_bc                   no
%option       with_bdb                  no
%option       with_bzip2                no
%option       with_calendar             no
%option       with_curl                 no
%option       with_debug                no
%option       with_dom                  no
%option       with_exif                 no
%option       with_fastcgi              no
%option       with_freetype             no
%option       with_ftp                  no
%option       with_gd                   no
%option       with_gdbm                 no
%option       with_gettext              no
%option       with_iconv                no
%option       with_imap                 no
%option       with_imap_annotate        no
%option       with_mbregex              no
%option       with_mbstring             no
%option       with_mcrypt               no
%option       with_mhash                no
%option       with_mm                   no
%option       with_mysql                no
%option       with_oci8                 no
%option       with_odbc                 no
%option       with_openldap             no
%option       with_openldapsasl         no
%option       with_pcre                 no
%option       with_pear                 no
%option       with_pgsql                no
%option       with_sendmail             no
%option       with_simplexml            no
%option       with_snmp                 no
%option       with_sqlite               no
%option       with_ssl                  no
%option       with_versioning           no
%option       with_wddx                 no
%option       with_xml                  no
%option       with_xslt                 no
%option       with_zlib                 no

#   fixing implicit extension dependencies and correlations
%if "%{with_pear}" == "yes"
%undefine     with_xml
%define       with_xml           yes
%undefine     with_pcre
%define       with_pcre          yes
%endif
%if "%{with_freetype}" == "yes"
%undefine     with_gd
%define       with_gd            yes
%endif
%if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes"
%undefine     with_zlib
%define       with_zlib          yes
%endif
%if "%{with_pgsql}" == "yes"
%undefine     with_ssl
%define       with_ssl           yes
%endif
%if "%{with_suhosin}" == "yes" && "%{with_hardened}" == "yes"
%undefine     with_hardened
%define       with_hardened      no
%endif

#   list of sources
Source0:      http://static.php.net/www.php.net/distributions/php-%{V_php}.tar.gz
Source1:      http://www.hardened-php.net/suhosin/_media/suhosin-%{V_php_suhosin_e}.tgz
Source2:      php.ini
Source3:      php.conf
Patch0:       http://www.hardened-php.net/hardening-patch-%{V_php_hardened}.patch.gz
Patch1:       http://www.hardened-php.net/suhosin/_media/suhosin-patch-%{V_php_suhosin_p}.patch.gz
Patch2:       http://projects.pardus.de/kolab/browser/ebuilds-2.1/dev-lang/php/files/php-5.2.2-kolab.patch?format=raw

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 20050615, gcc, flex, bison
PreReq:       OpenPKG, openpkg >= 20050615, MTA
BuildPreReq:  apache2
PreReq:       apache2
%if "%{with_suhosin}" == "yes"
BuildPreReq:  autoconf
%endif
%if "%{with_sqlite}" == "yes"
BuildPreReq:  sqlite
PreReq:       sqlite
%endif
%if "%{with_mysql}" == "yes"
BuildPreReq:  mysql
PreReq:       mysql
%endif
%if "%{with_pgsql}" == "yes"
BuildPreReq:  postgresql
PreReq:       postgresql
%endif
%if "%{with_gd}" == "yes"
BuildPreReq:  gd >= 2.0.20, jpeg, png
PreReq:       gd >= 2.0.20, jpeg, png
%endif
%if "%{with_bdb}" == "yes"
BuildPreReq:  db
PreReq:       db
%endif
%if "%{with_zlib}" == "yes"
BuildPreReq:  zlib
PreReq:       zlib
%endif
%if "%{with_bzip2}" == "yes"
BuildPreReq:  bzip2
PreReq:       bzip2
%endif
%if "%{with_ssl}" == "yes"
BuildPreReq:  openssl
PreReq:       openssl
%endif
%if "%{with_openldap}" == "yes"
BuildPreReq:  openldap
PreReq:       openldap
%if "%{with_openldapsasl}" == "yes"
BuildPreReq:  openldap::with_sasl = yes
PreReq:       openldap::with_sasl = yes
%else
BuildPreReq:  openldap::with_sasl = no
PreReq:       openldap::with_sasl = no
%endif
%endif
%if "%{with_mm}" == "yes"
BuildPreReq:  mm
PreReq:       mm
%endif
%if "%{with_pcre}" == "yes"
BuildPreReq:  pcre
PreReq:       pcre
%endif
%if "%{with_freetype}" == "yes"
BuildPreReq:  freetype
PreReq:       freetype
%endif
%if "%{with_gettext}" == "yes"
BuildPreReq:  gettext, libiconv
PreReq:       gettext, libiconv
%endif
%if "%{with_iconv}" == "yes"
BuildPreReq:  libiconv
PreReq:       libiconv
%endif
%if "%{with_imap}" == "yes"
BuildPreReq:  imap, openssl
PreReq:       imap, openssl
%endif
%if "%{with_imap_annotate}" == "yes"
BuildPreReq:  imap::with_annotate = yes
PreReq:       imap::with_annotate = yes
%endif
%if "%{with_xml}" == "yes"
BuildPreReq:  libxml
PreReq:       libxml
%endif
%if "%{with_xslt}" == "yes"
BuildPreReq:  libxslt
PreReq:       libxslt
%endif
%if "%{with_dom}" == "yes"
BuildPreReq:  libxml, libxslt
PreReq:       libxml, libxslt
%endif
%if "%{with_curl}" == "yes"
BuildPreReq:  curl
PreReq:       curl
%endif
%if "%{with_mhash}" == "yes"
BuildPreReq:  mhash
PreReq:       mhash
%endif
%if "%{with_mcrypt}" == "yes"
BuildPreReq:  libmcrypt
PreReq:       libmcrypt
%endif
%if "%{with_gdbm}" == "yes"
BuildPreReq:  gdbm, gdbm::with_ndbm = yes
PreReq:       gdbm, gdbm::with_ndbm = yes
%endif
%if "%{with_oci8}" == "yes"
BuildPreReq:  oracle
PreReq:       oracle
%endif
%if "%{with_snmp}" == "yes"
BuildPreReq:  snmp
PreReq:       snmp
%endif
%if "%{with_odbc}" == "yes"
BuildPreReq:  unixodbc
PreReq:       unixodbc
%endif
%if "%{with_sendmail}" == "yes"
BuildPreReq:  MTA
PreReq:       MTA
%endif
%if "%{with_simplexml}" == "yes"
BuildPreReq:  libxml
PreReq:       libxml
%endif
AutoReq:      no
AutoReqProv:  no

%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.

    This is the Command Line Interface (CLI) and Common Gateway
    Interface (CGI) version of PHP, intended for use in the "shebang"
    line ("#!%{l_prefix}/bin/php") of stand-alone PHP based programs
    and for use in the "shebang" line ("#!%{l_prefix}/cgi/php") of
    stand-alone webserver-independent CGI scripts.

%track
    prog apache2-php = {
        version   = %{V_php}
        url       = http://www.php.net/downloads.php
        regex     = php-(5.\d+\.\d+)\.tar\.gz
    }
    prog apache2-php:hardened = {
        version   = %{V_php_hardened}
        url       = http://www.hardened-php.net/downloads.13.html
        regex     = hardening-patch-(5\.\d+\.\d+-\d+(\.\d+)+)\.patch\.gz
    }
    prog apache2-php:suhosin-patch = {
        version   = %{V_php_suhosin_p}
        url       = http://www.hardened-php.net/suhosin/download.html
        regex     = suhosin-patch-(5\.\d+\.\d+-\d+(\.\d+)+)\.patch\.gz
    }
    prog apache2-php:suhosin-ext = {
        version   = %{V_php_suhosin_e}
        url       = http://www.hardened-php.net/suhosin/download.html
        regex     = suhosin-(\d+(\.\d+)+)\.tgz
    }

%prep
    %setup -q -n php-%{V_php}
%if "%{with_hardened}" == "yes"
    %patch -p1 -P 0
%endif
%if "%{with_suhosin}" == "yes"
    %setup -q -n php-%{V_php} -T -D -a 1
    %patch -p1 -P 1
    mv suhosin-%{V_php_suhosin_e} ext/suhosin
    rm -f package.xml
    export PHP_AUTOCONF=autoconf-213
    ./buildconf --copy --force
    $PHP_AUTOCONF
%endif
    %{l_shtool} subst \
        -e 's;-i -a -n php5;-i -n php5;' \
        configure
    %{l_shtool} subst \
        -e 's;\(/include\)/freetype2;\1;' \
        configure \
        ext/gd/config.m4
%if "%{with_imap_annotate}" == "yes"
    sed <%{PATCH2} -e '/php-5.2.1\/ext\/imap\/php_imap.c.orig/,/^[^\+]/d' | %{l_patch} -p1
%endif

%build
    #   configure package
    case "%{l_platform -t}" in
        *-sunos5.10 ) cflags="%{l_cflags}"    ;;
        *           ) cflags="%{l_cflags -O}" ;;
    esac
    cppflags="%{l_cppflags}"
    ldflags="%{l_ldflags}"
    libs=""
%if "%{with_gdbm}" == "yes"
    libs="$libs -lndbm -lgdbm"
%endif
%if "%{with_gd}" == "yes"
    libs="$libs -lpng -lz"
%endif
%if "%{with_gettext}" == "yes"
    libs="$libs -liconv"
%endif
%if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes"
    libs="$libs -lsasl2"
%endif
%if "%{with_imap}" == "yes"
    libs="$libs -lssl -lcrypto"
%endif
%if "%{with_bdb}" == "yes"
    libs="$libs -ldb"
%endif
%if "%{with_pgsql}" == "yes"
    libs="$libs `pg_config --libs`"
%endif
%if "%{with_oci8}" == "yes"
    ORACLE_HOME="`%{l_rc} --query oracle_home`"
    export ORACLE_HOME
%endif
    CC="%{l_cc}" \
    CFLAGS="$cflags" \
    CPPFLAGS="$cppflags" \
    LDFLAGS="$ldflags" \
    LIBS="$libs" \
%if "%{with_sendmail}" == "yes"
    PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \
%else
    PROG_SENDMAIL="`%{l_shtool} path false`" \
%endif
    ./configure \
        --prefix=%{l_prefix} \
        --sysconfdir=%{l_prefix}/etc/apache2 \
        --with-config-file-path=%{l_prefix}/etc/apache2 \
        --libdir=%{l_prefix}/lib/php \
        --disable-all \
        --enable-pdo \
%if "%{with_suhosin}" == "yes"
        --enable-suhosin \
%endif
%if "%{with_calendar}" == "yes"
        --enable-calendar \
%endif
        --without-sqlite \
%if "%{with_sqlite}" == "yes"
        --with-pdo-sqlite=%{l_prefix} \
%else
        --without-pdo-sqlite \
%endif
%if "%{with_mysql}" == "yes"
        --with-mysql=%{l_prefix} \
        --with-pdo-mysql=%{l_prefix} \
%else
        --without-mysql \
%endif
%if "%{with_pgsql}" == "yes"
        --with-pgsql=%{l_prefix} \
        --with-pdo-pgsql=%{l_prefix} \
%else
        --without-pgsql \
%endif
%if "%{with_gd}" == "yes"
        --with-gd=%{l_prefix} \
        --with-jpeg-dir=%{l_prefix} \
        --with-png-dir=%{l_prefix} \
%endif
%if "%{with_fastcgi}" == "yes"
         --enable-fastcgi \
%else
         --disable-fastcgi \
%endif
%if "%{with_freetype}" == "yes"
        --enable-gd-native-ttf \
        --with-freetype-dir=%{l_prefix} \
%endif
%if "%{with_bdb}" == "yes"
        --with-db4=%{l_prefix} \
%endif
%if "%{with_debug}" == "yes"
        --with-debug=yes \
%else
        --with-debug=no \
%endif
%if "%{with_zlib}" == "yes"
        --with-zlib=%{l_prefix} \
        --with-zlib-dir=%{l_prefix} \
%endif
%if "%{with_bzip2}" == "yes"
        --with-bz2=%{l_prefix} \
%endif
%if "%{with_ssl}" == "yes" || "%{with_openldap}" == "yes"
        --with-openssl=%{l_prefix} \
%endif
%if "%{with_openldap}" == "yes"
        --with-ldap=%{l_prefix} \
%endif
%if "%{with_mm}" == "yes"
        --with-mm=%{l_prefix} \
        --enable-session \
%endif
%if "%{with_pcre}" == "yes"
        --with-pcre-regex=%{l_prefix} \
%endif
%if "%{with_ftp}" == "yes"
        --enable-ftp \
%endif
%if "%{with_oci8}" == "yes"
        --with-oci8 \
%endif
%if "%{with_gettext}" == "yes"
        --with-gettext=%{l_prefix} \
%endif
%if "%{with_imap}" == "yes"
        --with-imap=%{l_prefix} \
        --with-imap-ssl=%{l_prefix} \
%endif
%if "%{with_xml}" == "yes"
        --enable-xml \
        --enable-libxml \
        --with-libxml-dir=%{l_prefix} \
%else
        --disable-xml \
%endif
%if "%{with_xslt}" == "yes"
        --with-xsl=%{l_prefix} \
%else
        --without-xsl \
%endif
%if "%{with_dom}" == "yes"
        --enable-dom \
        --with-libxml-dir=%{l_prefix} \
%else
        --disable-dom \
%endif
%if "%{with_wddx}" == "yes"
        --enable-wddx \
%endif
%if "%{with_bc}" == "yes"
        --enable-bcmath \
%endif
%if "%{with_mhash}" == "yes"
        --with-mhash=%{l_prefix} \
%endif
%if "%{with_mcrypt}" == "yes"
        --with-mcrypt=%{l_prefix} \
%endif
%if "%{with_curl}" == "yes"
        --with-curl=%{l_prefix} \
%endif
%if "%{with_gdbm}" == "yes"
        --with-gdbm=%{l_prefix} \
%endif
%if "%{with_versioning}" == "yes"
        --enable-versioning \
%endif
%if "%{with_pear}" == "yes"
        --with-pear=%{l_prefix}/lib/php \
%else
        --without-pear \
%endif
%if "%{with_simplexml}" == "yes"
        --enable-simplexml \
        --enable-libxml \
        --with-libxml-dir=%{l_prefix} \
%else
        --disable-simplexml \
%endif
%if "%{with_snmp}" == "yes"
        --with-snmp=%{l_prefix} \
        --with-openssl-dir=%{l_prefix} \
%endif
%if "%{with_odbc}" == "yes"
        --with-unixODBC=%{l_prefix} \
        --with-pdo-odbc=unixODBC,%{l_prefix} \
%endif
%if "%{with_mbregex}" == "yes"
        --enable-mbregex \
%endif
%if "%{with_mbstring}" == "yes"
        --enable-mbstring \
%endif
%if "%{with_exif}" == "yes"
        --with-exif \
%endif
%if "%{with_iconv}" == "yes"
        --with-iconv=%{l_prefix} \
%endif
        --with-apxs2=%{l_prefix}/sbin/apxs \
        --disable-cli \
        --disable-cgi \
        --enable-force-cgi-redirect \
        --enable-discard-path \
        --enable-memory-limit

    #   build package
    %{l_make} %{l_mflags}

%install
    #   install package
    rm -rf $RPM_BUILD_ROOT
    %{l_make} %{l_mflags} install-sapi INSTALL_ROOT=$RPM_BUILD_ROOT

    #   install default configuration file
    %{l_shtool} mkdir -f -p -m 755 \
        $RPM_BUILD_ROOT%{l_prefix}/etc/apache2/apache2.d
    %{l_shtool} install -c -m 644 %{l_value -s -a} \
        %{SOURCE php.ini} $RPM_BUILD_ROOT%{l_prefix}/etc/apache2/
    %{l_shtool} install -c -m 644 %{l_value -s -a} \
        %{SOURCE php.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/apache2/apache2.d/

    #   determine installation files
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
        '%config %{l_prefix}/etc/apache2/php.ini' \
        '%config %{l_prefix}/etc/apache2/apache2.d/php.conf'

%files -f files

%clean
    rm -rf $RPM_BUILD_ROOT

%post
    #   after upgrade, restart service
    [ $1 -eq 2 ] || exit 0
    eval `%{l_rc} apache2 status 2>/dev/null`
    [ ".$apache2_active" = .yes ] && %{l_rc} apache2 restart
    exit 0

@


1.7
log
@cosmetics
@
text
@@


1.6
log
@restart Apache if PHP DSO is upgraded (by cs)
@
text
@d33 1
a33 1
Summary:      Personal HomePage (PHP)
d39 1
a39 1
Group:        Language
@


1.5
log
@modifying package: apache2-php-5.2.3 20070601 -> 20070602
@
text
@d42 1
a42 1
Release:      20070602
d546 7
@


1.4
log
@upgrading package: apache2-php 5.2.2 -> 5.2.3
@
text
@d27 1
a27 1
%define       V_php_suhosin_p           5.2.2-0.9.6.2
d42 1
a42 1
Release:      20070601
@


1.3
log
@IMAP METADATA Extension; packaging work motivated by the Kolab-Konsortium
@
text
@d26 1
a26 1
%define       V_php                     5.2.2
d42 1
a42 1
Release:      20070531
@


1.2
log
@fix tracking
@
text
@d42 1
a42 1
Release:      20070530
d63 1
d119 1
d198 4
d308 3
@


1.1
log
@first still untested cut for a PHP extension package for Apache 2
@
text
@d260 1
a260 1
    prog php = {
d265 1
a265 1
    prog php:hardened = {
d270 1
a270 1
    prog php:suhosin-patch = {
d275 1
a275 1
    prog php:suhosin-ext = {
@

