-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
70 lines (51 loc) · 2.12 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup github 1.0
PortGroup java 1.0
github.setup yui yuicompressor 2.4.8 v
categories www
license BSD
maintainers {amake @amake} openmaintainer
description The Yahoo! JavaScript and CSS Compressor
long_description \
The YUI Compressor is a JavaScript compressor which, in addition to removing \
comments and white-spaces, obfuscates local variables using the smallest \
possible variable name. This obfuscation is safe, even when using constructs \
such as 'eval' or 'with' (although the compression is not optimal in those \
cases) Compared to jsmin, the average savings is around 20%.
platforms any
supported_archs noarch
use_configure no
set jar ${name}-${version}.jar
set jarpath ""
set sharepath ${prefix}/share/java/${name}
variant source description "Build from source" {
depends_build bin:ant:apache-ant
checksums rmd160 9e26866b5ff2de40c2c57720fbb4bdfba35986a2 \
sha256 a5885eabfe4d030061210a0204bc8bbd318ca1f0aae1dc7348dae41e6f3b7fa5 \
size 1254366
java.version 1.8
build.cmd ant
build.target build.jar
set jarpath ${worksrcpath}/build
}
if {![variant_isset source] } {
github.tarball_from releases
extract.only
distfiles ${jar}
checksums rmd160 d870a9db48dc21436d8fc5ac82a852f5240f20d9 \
sha256 30371db57285e490c761f1cca52527e697fe09077a16da46fb892e98a6a25de2 \
size 787524
build {}
set jarpath ${distpath}
}
destroot {
xinstall -m 0755 -d ${destroot}${sharepath}
xinstall -m 0644 -W ${jarpath} ${jar} ${destroot}${sharepath}
set cli_script ${destroot}${prefix}/bin/${name}
set fp [open $cli_script w]
puts $fp "#!/bin/sh"
puts $fp "exec java -jar \"${sharepath}/${jar}\" \"$@\""
close $fp
system "chmod +x ${cli_script}"
}