Ticket #14526: Portfile

File Portfile, 2.2 KB (added by ameingast@…, 17 years ago)

JRuby Portfile

Line 
1# $Id$
2
3PortSystem 1.0
4
5name                    jruby
6version                 1.0.3
7
8categories              java devel
9maintainers             nobody@example.com
10platforms               darwin
11
12description             JRuby is an 100% pure-Java implementation of the Ruby \
13                  programming language.
14long_description        JRuby provides a complete set of core "builtin" classes \
15                  and syntax for the Ruby language, as well as most of the \
16                  Ruby Standard Libraries. The standard libraries are mostly \
17                  Ruby's own complement of .rb files, but a few that depend \
18                  on C language-based extensions have been reimplemented. \
19homepage                      http://jruby.codehaus.org/
20
21master_sites              http://dist.codehaus.org/jruby/
22distname                      ${name}-src-${version}
23worksrcdir                  ${name}-${version}
24use_bzip2                     no
25checksums         md5 def7168f6c8061da753f875acb250f66
26
27depends_build     bin:ant:apache-ant
28depends_lib       bin:java:kaffe
29
30use_configure             no
31universal_variant       no
32
33build.cmd                     ant
34build.target      jar
35
36variant apidocs {
37  build.target  jar create-apidocs
38}
39
40variant default_ruby {
41
42}
43
44destroot {
45        # Create the target java directory exists
46        xinstall -m 755 -d ${destroot}${prefix}/share/java/${name}
47       
48        # Copy over the needed elements of our directory tree
49        file copy \
50                ${worksrcpath}/bin \
51                ${worksrcpath}/lib \
52                ${destroot}${prefix}/share/java/${name}
53               
54        if { [variant_isset apidocs] } {
55          file copy ${worksrcpath}/docs ${destroot}${prefix}/share/java/${name}
56        }
57               
58        # Remove extraneous bat files
59        foreach f [glob -directory ${destroot}${prefix}/share/java/${name}/bin *.bat] {
60          file delete $f
61  }
62 
63  set jruby_prefix ""
64 
65  if { ![variant_isset default_ruby] } {
66    set jruby_prefix "j"
67  }
68 
69        foreach f { jruby jirb jrubyc jrubcli jrubysrv } {
70          regsub {^j} $f $jruby_prefix dest
71          if { ${dest} != ${f} } {
72      ln -s ${prefix}/share/java/${name}/bin/${f} ${destroot}${prefix}/bin/${dest}
73    }
74    ln -s ${prefix}/share/java/${name}/bin/${f} ${destroot}${prefix}/bin/
75  }
76 
77  foreach f { gem gem_mirror gemri gemwhich rake spec testrb } {
78    ln -s ${prefix}/share/java/${name}/bin/${f} \
79          ${destroot}${prefix}/bin/${jruby_prefix}${f}
80  }
81}