Ticket #24795: Portfile.3

File Portfile.3, 2.8 KB (added by franck.cassedanne@…, 14 years ago)

The rhino script now passes arguments e.g. "rhino -help". Livecheck.regex has been updated. Test phase added.

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id$
3
4PortSystem          1.0
5name                rhino
6version             1.7R2
7license             MPL 1.1/GPL 2.0
8categories          java
9categories-append   devel lang
10platforms           darwin freebsd openbsd
11homepage            http://www.mozilla.org/rhino
12maintainers         ouarz.net:franck.cassedanne
13description         Mozilla JavaScript engine for Java
14
15long_description    [string toupper ${name} 0] is an open-source \
16                    implementation of JavaScript written entirely in Java. \
17                    It is typically embedded into Java applications to provide \
18                    scripting to end users.
19
20master_sites        http://ftp.mozilla.org/pub/mozilla.org/js/ \
21                    ftp://ftp.mozilla.org/pub/mozilla.org/js/ \
22                    http://ftp.mozilla.org/pub/mozilla.org/js/older-packages/ \
23                    ftp://ftp.mozilla.org/pub/mozilla.org/js/older-packages/
24
25distname            ${name}[string map {. _} $version]
26use_zip             yes
27
28depends_lib         bin:java:kaffe
29
30use_configure       no
31
32build               {}
33
34checksums           md5     40d0a9abec8169e42920214b37fa8e0e \
35                    sha1    3bb380cfb7f6febb87a64b2dee7fa308042f37e4 \
36                    rmd160  58ae321829ac701e442bfbfed3d6f87b2bb6ba4c
37
38livecheck.type      regex
39livecheck.url       http://www.mozilla.org/rhino/download.html
40livecheck.regex     {Rhino (\d+\.\d+(:?\D+\d))}
41
42test.run            yes
43test.cmd            java
44test.target         -jar js.jar
45
46destroot {
47    set javadir ${destroot}${prefix}/share/java
48    set docdir ${destroot}${prefix}/share/doc/${distname}
49    set examplesdir ${destroot}${prefix}/share/examples/${distname}
50
51    xinstall -m 755 -d ${javadir}/${name}/bin
52    xinstall -m 755 -d ${docdir}
53    xinstall -m 755 -d ${examplesdir}
54    file copy ${worksrcpath}/js.jar ${javadir}/${name}/js.jar
55    file copy ${worksrcpath}/js-14.jar ${javadir}/${name}/js-14.jar
56
57    set rhino [open ${destroot}${prefix}/bin/${name} "w"]
58    puts $rhino "java -jar ${prefix}/share/java/${name}/js.jar $@"
59    close $rhino
60    file attributes ${destroot}${prefix}/bin/${name} -permissions +x
61
62    file copy ${worksrcpath}/javadoc/ ${docdir}
63    file copy ${worksrcpath}/examples/ ${examplesdir}
64}
65
66post-install {
67    ui_msg "-------------------------------------------------------------------"
68    ui_msg "${name} has been installed in:"
69    ui_msg "\t- Command-line access: ${prefix}/bin/${name}"
70    ui_msg "\t- JAR files: ${prefix}/share/java/${name}/"
71    ui_msg "\t- Javadoc: ${prefix}/share/doc"
72    ui_msg "\t- Examples: ${prefix}/share/examples"
73    ui_msg "-------------------------------------------------------------------"
74}