Changeset 98224


Ignore:
Timestamp:
Sep 29, 2012, 8:39:39 PM (12 years ago)
Author:
pixilla@…
Message:

php/pear-install-phar:

  • Improve discription for php*-pear subports.
  • Add files to files dir rather than write them with TCL.
  • Fix typo in installed pear.ini file.
Location:
trunk/dports/php/pear-install-phar
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/php/pear-install-phar/Portfile

    r97236 r98224  
    66name                pear-install-phar
    77version             20110901
    8 revision            3
     8revision            4
    99categories          php www
    1010license             BSD PHP-3 LGPL-2.1+
     
    1313homepage            http://pear.php.net
    1414master_sites        http://pear.php.net
    15 livecheck.type      moddate
    16 
    17 dist_subdir         ${name}-${version}
    18 distfiles           install-pear-nozlib.phar
    19 
    20 checksums           rmd160  1eef5e3a68b5521e2d42e68d031fd79828709923 \
    21                     sha256  06757ae34c93d4aad8a3abc63958106ca11bb1a9a5f85e7e013d70077e4aafa1
    22 
    23 set buildpath       ${worksrcpath}/build
    24 set libpath         /lib/php/pear
    2515
    2616subport php5-pear {
    2717
    28     set dbpath          /var/db/php5
    29     depends_lib         port:php5
     18    set php.port        [lindex [split $subport -] 0]
     19    set php.db          /var/db/${php.port}
     20    depends_lib         port:${php.port}
    3021}
    3122
    3223subport php53-pear {
    3324
    34     set dbpath          /var/db/php53
    35     depends_lib         port:php53
     25    set php.port        [lindex [split $subport -] 0]
     26    set php.db          /var/db/${php.port}
     27    depends_lib         port:${php.port}
    3628}
    3729
    3830subport php54-pear {
    3931
    40     set dbpath          /var/db/php54
    41     depends_lib         port:php54
     32    set php.port        [lindex [split $subport -] 0]
     33    set php.db          /var/db/${php.port}
     34    depends_lib         port:${php.port}
    4235}
    4336
     
    4841    description         PEAR installer phar
    4942    long_description    ${description}
     43
     44    livecheck.type      moddate
     45
     46    dist_subdir         ${name}-${version}
     47    distfiles           install-pear-nozlib.phar
     48
     49    checksums           rmd160  1eef5e3a68b5521e2d42e68d031fd79828709923 \
     50                        sha256  06757ae34c93d4aad8a3abc63958106ca11bb1a9a5f85e7e013d70077e4aafa1
     51
     52    set buildpath       ${worksrcpath}/build
     53    set libpath         /lib/php/pear
    5054
    5155    extract.mkdir       yes
     
    6468} else {
    6569
    66     description         PEAR build and repository support for php
     70    description         Optional port that auto-prepends the PEAR repository for ${php.port}.
    6771    long_description    ${description}
    6872
    6973    distfiles
    7074
    71     build {
     75    worksrcdir          ${php.port}-pear
     76    extract.dir         ${worksrcpath}
     77    extract.mkdir       yes
     78    post-extract {
    7279
    73         xinstall -d ${buildpath}${dbpath}
    74         set fp [open ${buildpath}${dbpath}/pear-ini.php w]
    75         puts $fp "<?php"
    76         puts $fp "# Automatically add the PEAR repository path to PHP's include_path."
    77         puts $fp "set_include_path ( get_include_path (  ) . PATH_SEPARATOR . '${prefix}/lib/php/pear' ) ;"
    78         close $fp
    79    
    80         set fp [open ${buildpath}${dbpath}/pear.ini w]
    81         puts $fp "; Do not edit this file; it is automatically generated by MacPorts."
    82         puts $fp "; Any changes you make will be lost if you upgrade or uninstall ${subport}-pear."
    83         puts $fp "; To configure PHP, edit ${prefix}/etc/${subport}/php.ini."
    84         puts $fp "auto_prepend_file = '${prefix}${dbpath}/pear/pear-ini.php'"
    85         close $fp
     80        copy ${filespath}/pear-ini.php ${worksrcpath}/pear-ini.php
     81        copy ${filespath}/pear.ini ${worksrcpath}/pear.ini
    8682    }
     83
     84    post-patch {
     85
     86        reinplace "s,@PHP.PORT@,${php.port},g" \
     87            ${worksrcpath}/pear.ini
     88        reinplace "s,@PREFIX@,${prefix},g" \
     89            ${worksrcpath}/pear-ini.php \
     90            ${worksrcpath}/pear.ini
     91    }
     92
     93    use_configure       no
     94    build {}
    8795
    8896    destroot {
    8997
    90         xinstall -d ${destroot}${prefix}${dbpath}/pear
    91         file copy ${buildpath}${dbpath}/pear-ini.php ${destroot}${prefix}${dbpath}/pear/pear-ini.php
    92         file copy ${buildpath}${dbpath}/pear.ini ${destroot}${prefix}${dbpath}/pear.ini
     98        xinstall -d -m 0755 ${destroot}${prefix}/var/db/${php.port}/pear
     99        xinstall -m 0644 ${worksrcpath}/pear-ini.php \
     100            ${destroot}${prefix}/var/db/${php.port}/pear/pear-ini.php
     101        xinstall -m 0644 ${worksrcpath}/pear.ini \
     102            ${destroot}${prefix}/var/db/${php.port}/pear.ini
    93103    }
    94104}
Note: See TracChangeset for help on using the changeset viewer.