Changeset 98556


Ignore:
Timestamp:
Oct 8, 2012, 7:26:42 PM (12 years ago)
Author:
blair@…
Message:

db46: add db46-java subport so that other ports can depend on it.

Delete the no_java variant since the variant has been removed. The
java variant now prints a note that the db46-java port should be
installed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/databases/db46/Portfile

    r98552 r98556  
    66name            db46
    77version         4.6.21
    8 revision        6
     8revision        7
    99set branch      [join [lrange [split ${version} .] 0 1] {}]
    1010categories      databases
     
    7272}
    7373
    74 post-destroot {
    75     foreach bin [glob -tails -directory ${destroot}${prefix}/bin/ db_*] {
    76         set newbin [regsub {^db_} ${bin} "db${branch}_"]
    77         move ${destroot}${prefix}/bin/${bin} \
    78             ${destroot}${prefix}/bin/${newbin}
    79     }
    80 }
     74subport ${name}-java {
     75    depends_lib-append      port:${name}
    8176
    82 variant java conflicts no_java description {Build the Java API} {
    8377    configure.args-append   --enable-java
     78
    8479    platform macosx {
    8580        pre-configure {
    8681            if {![file isfile "/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"]} {
    87                 ui_error "${name} requires the Java for Mac OS X development headers."
     82                ui_error "${subport} requires the Java for Mac OS X development headers."
    8883                if {${os.major} == 10} {
    8984                    ui_error "Download the Java Developer Package from: <https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719>"
     
    9893    }
    9994}
    100 variant no_java conflicts java description {Legacy compatibility variant} {}
    101 if {[variant_isset no_java]} {
    102     default_variants -java
    103 } elseif {${os.subplatform} == "macosx" && ${os.major} < 11} {
    104     default_variants +java
    105 }
    10695
    107 variant tcl description {build Tcl API} {
    108     depends_lib-append      port:tcl
    109     configure.args-append   --enable-tcl --with-tcl=${prefix}/lib
     96if {$subport == $name} {
     97    post-destroot {
     98        foreach bin [glob -tails -directory ${destroot}${prefix}/bin/ db_*] {
     99            set newbin [regsub {^db_} ${bin} "db${branch}_"]
     100            move ${destroot}${prefix}/bin/${bin} \
     101                ${destroot}${prefix}/bin/${newbin}
     102        }
     103
     104        delete ${destroot}${prefix}/share/doc/${name}/java
     105    }
     106
     107    # Delete this variant on or after 2013-10-08.
     108    variant java description "Java API - moved to ${name}-java port" {
     109        notes "${name}'s +java variant has been replaced with the ${name}-java port."
     110    }
     111
     112    variant tcl description {build Tcl API} {
     113        depends_lib-append      port:tcl
     114        configure.args-append   --enable-tcl --with-tcl=${prefix}/lib
     115    }
     116} else {
     117    # There is no Java specific install target, so delete everything
     118    # but the Java related files.
     119    post-destroot {
     120        set p ${destroot}${prefix}
     121
     122        delete ${p}/bin
     123        delete ${p}/include
     124
     125        # Install the docs into the main ports's doc directory so that
     126        # the link in index.html to java/index.html works.
     127        foreach f [lsort [glob -tails -directory ${p}/share/doc/${name} *]] {
     128            if {${f} != {java}} {
     129                delete ${p}/share/doc/${name}/${f}
     130            }
     131        }
     132        ln -s ${name} ${p}/share/doc/${subport}
     133
     134        foreach f [lsort [glob -tails -directory ${p}/lib/${name} *]] {
     135            if {   ${f} != {db.jar}
     136                && [string compare -length 10 {libdb_java} ${f}]} {
     137                delete ${p}/lib/${name}/${f}
     138            }
     139        }
     140    }
    110141}
    111142
Note: See TracChangeset for help on using the changeset viewer.