summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 94bf042a75e309468e1fb413f2c613b3a4fc7406 (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
# $Id: PKGBUILD 134107 2015-05-25 23:45:31Z dwallace $
# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Chris Brannon <cmbrannon79@gmail.com>
# Contributor: Geoffroy Carrier <geoffroy.carrier@aur.archlinux.org>
# Contributor: Richard Murri <admin@richardmurri.com>
_pkgname=jython
pkgname=$_pkgname-hg
pkgver=r8074.fc946dea9c0f
pkgrel=1
pkgdesc="An implementation of the Python language written in Java"
arch=('any')
url="http://www.jython.org/"
license=('PSF' 'APACHE' 'custom')
depends=('java-runtime' 'bash' 'python2')
makedepends=('apache-ant' 'mercurial')
backup=('opt/jython/registry')
options=('!emptydirs')
install='jython.install'
source=("hg+https://hg.python.org/jython/"
        'README.ArchLinux'
        'jython.sh')
provides=('jython')
conflicts=('jython')

md5sums=('SKIP'
         '0a2e265af61c7d695e13b605dc180553'
         'c08ade059dae86b015f39842ceb465cf')

pkgver() {
    cd "$srcdir/$_pkgname"
    printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
}

build() {
    cd "$srcdir/$_pkgname"

    # ANTLR 3 causes non-fatal errors with Java 8, so just try again
    # http://stackoverflow.com/a/22367682/3786245
    ant || ant
}

check() {
    cd "$srcdir/$_pkgname"

    ant test
}

package() {
    install -m755 -D -d "$pkgdir/opt/"

    cp -r "$srcdir/$_pkgname/dist" "$pkgdir/opt/$_pkgname"
    rm "$pkgdir/opt/jython/bin/"{jython.exe,jython_regrtest.bat,python27.dll}

    install -m644 -D "$srcdir/jython.sh" "$pkgdir/etc/profile.d/jython.sh"
    install -m644 -D "$srcdir/README.ArchLinux" "$pkgdir/usr/share/doc/$_pkgname/README.ArchLinux"

    install -m644 -D "$srcdir/$_pkgname/LICENSE.txt" "$pkgdir/usr/share/licenses/$_pkgname/LICENSE.txt"
}