Ticket #29849: php5extension.tcl.diff

File php5extension.tcl.diff, 2.1 KB (added by BjarneDMat, 13 years ago)
  • .tcl

    old new  
    1 # $Id: php5extension-1.0.tcl 79424 2011-06-13 08:03:13Z ryandesign@macports.org $
     1# $Id: php5extension-1.1.tcl 79424 2011-06-13 08:03:13Z ryandesign@macports.org $
    22#
    33# Copyright (c) 2009 The MacPorts Project
    44# All rights reserved.
     
    3434#
    3535# Usage:
    3636#
    37 #   PortGroup               php5extension 1.0
     37#   PortGroup               php5extension 1.1
    3838#   php5extension.setup     extension version source
    3939#
    4040# where extension is the name of the extension (e.g. APC), version is its
     
    7070proc php5extension.setup {extensions version {source ""}} {
    7171    global php5extension.build_dirs php5extension.extensions php5extension.ini php5extension.inidir php5extension.source
    7272    global destroot
    73    
     73
    7474    # Use "set" to preserve the list structure.
    7575    set php5extension.extensions ${extensions}
    7676   
     77    global  php5extension.iniFile
     78    set     php5extension.iniFile ${destroot}${php5extension.inidir}/${php5extension.ini}
     79   
    7780    php5extension.source        ${source}
    7881   
    7982    name                        php5-[lindex ${php5extension.extensions} 0]
     
    129132        } else {
    130133            set extension_prefix "extension="
    131134        }
    132         set fp [open ${destroot}${php5extension.inidir}/${php5extension.ini} w]
     135        set fp [open ${php5extension.iniFile} w]
    133136        puts $fp "; Do not edit this file; it is automatically generated by MacPorts."
    134137        puts $fp "; Any changes you make will be lost if you upgrade or uninstall ${name}."
    135138        puts $fp "; To configure PHP, edit ${php5extension.php_ini}."
     
    137140            puts $fp "${extension_prefix}${extension}.so"
    138141        }
    139142        close $fp
     143
     144        if { [ file exists ${filespath}/php_default.ini ] } {
     145            exec    cat ${filespath}/php_default.ini >> ${php5extension.iniFile}
     146        }
     147
     148
    140149    }
    141150   
    142151    post-install {