summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 183629184d89e8faa433f9a2bb898bb1dda4ee4e (plain)
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
# Maintainer: Alex Szczuczko <alex@szc.ca>
# Contributor: TDY <tdy.aur@gmail.com>

pkgname=ceylon-git
pkgver=master
pkgrel=1
pkgdesc="A powerful statically typed language for writing large programs in groups"
arch=("any")
url="http://ceylon-lang.org/"
license=("Apache" "custom:GPL-CP" "LGPL")
depends=("java-environment>=7" "bash")
makedepends=("git" "apache-ant")
optdepends=("nodejs: for JavaScript interoperability")
source=("ceylon-git::git+https://github.com/ceylon/ceylon.git#branch=master")
sha256sums=("SKIP")

pkgver() {
    cd "$srcdir/$pkgname"
    git describe --match 'dist-*' --long --tags | sed -e 's/dist-//' -e 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "$srcdir/$pkgname/dist"
    ant clean publish
}

package() {
    cd "$srcdir/$pkgname/dist/dist"

    #
    # Main files
    #

    # General
    install -dm755 "$pkgdir/usr/share/java/$pkgname/"
    cp -a contrib bin lib repo samples templates "$pkgdir/usr/share/java/$pkgname/"
    find "$pkgdir/usr/share/java/$pkgname/" -type d -print0 | xargs -0 chmod 755
    find "$pkgdir/usr/share/java/$pkgname/" -type f -print0 | xargs -0 chmod 644

    # Bin
    find "$pkgdir/usr/share/java/$pkgname/" -type f -name '*.bat' -print0 | xargs -0 rm
    chmod 755 "$pkgdir/usr/share/java/$pkgname/bin/ceylon"

    #
    # System integration
    #

    # Bin
    install -dm755 "$pkgdir/usr/bin/"
    ln -s "/usr/share/java/$pkgname/bin/ceylon" "$pkgdir/usr/bin/$pkgname"

    # Completion
    install -dm755 "$pkgdir/usr/share/bash-completion/completions/"
    ln -s "/usr/share/java/$pkgname/contrib/scripts/ceylon-completion.bash" "$pkgdir/usr/share/bash-completion/completions/$pkgname"

    # License
    install -Dm644 LICENSE-GPL-CP "$pkgdir/usr/share/licenses/$pkgname/GPL-CP"
    install -Dm644 NOTICE "$pkgdir/usr/share/licenses/$pkgname/NOTICE"
}