Ticket #43124: Portfile

File Portfile, 2.8 KB (added by mallman (Michael Allman), 11 years ago)
Line 
1# $Id: Portfile 118231 2014-03-26 20:17:31Z blair@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5
6name            scala2.11
7set real_version 2.11.0-RC3
8version         0.1.${real_version}
9set branch      [join [lrange [split ${real_version} .] 0 1] .]
10categories      lang java
11license         BSD
12maintainers     openmaintainer blair
13description     The Scala Programming Language
14long_description \
15                Scala is a modern multi-paradigm programming language \
16                designed to express common programming patterns in a \
17                concise, elegant, and type-safe way.  It smoothly \
18                integrates features of object-oriented and functional \
19                languages.  It runs inside a Java Virtual Machine and \
20                is fully interoperable with Java.
21homepage        http://www.scala-lang.org/
22platforms       darwin
23supported_archs noarch
24
25master_sites    ${homepage}files/archive/
26
27use_configure   no
28build           {}
29
30set sharedir     ${destroot}${prefix}/share
31set docdir       ${sharedir}/doc
32set docscaladir  ${docdir}/scala-${branch}
33
34if {$subport == $name} {
35    depends_lib     port:scala_select
36    select.group    scala
37    select.file     ${filespath}/${name}
38
39    distname        scala-${real_version}
40    extract.suffix  .tgz
41    checksums       md5    94cc4d2afbbbdb0d3e98561254589221 \
42                    sha1   cd1b8fb5b6896c9e3b9f2c6b3eb52556fd25bd3a \
43                    sha256 4c5ca2f0b3325f6bf23c8ea1306c6dcd109c4bc15e612fa50e6e51f574fae8bf
44
45    destroot {
46        set man1dir ${sharedir}/man/man1
47        set scaladir ${sharedir}/scala-${branch}
48        set bindir ${scaladir}/bin
49
50        xinstall -d -m 755 ${sharedir}
51        file copy ${worksrcpath} ${scaladir}
52
53        foreach f {fsc scala scalac scaladoc scalap} {
54            file attributes ${bindir}/${f} -permissions 0755
55            ln -s ../share/scala-${branch}/bin/${f} \
56                ${destroot}${prefix}/bin/${f}-${branch}
57        }
58
59        file delete ${man1dir}
60        file rename ${scaladir}/man/man1 ${man1dir}
61        foreach f {fsc scala scalac scaladoc scalap} {
62            file rename ${man1dir}/${f}.1 ${man1dir}/${f}-${branch}.1
63        }
64        file delete -force ${scaladir}/man
65
66        xinstall -d -m 755 ${docdir}
67        file rename ${scaladir}/doc ${docscaladir}
68    }
69}
70
71subport ${name}-docs {
72    description     The Scala Programming Language API docs
73
74    distname        scala-docs-${real_version}
75    use_xz          yes
76    extract.suffix  .txz
77    checksums       md5    0f8d5692e4bb533c1f00f07804d826f2 \
78                    sha1   5f0a1f1ea4356ec0728915f5e54607772ed06f4f \
79                    sha256 460d1de4ba6b085b06647937b6f4611a2a216dd9f6f92b3249f1fd3508b3afbc
80
81    destroot {
82        xinstall -d -m 755 ${docscaladir}
83        file copy ${worksrcpath}/api ${docscaladir}/api
84    }
85}