updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / ibjts / PKGBUILD
blob2729d31d9a79d88ca99b7a7a365dd1d05b9af2e8
1 # $Id:$
2 # Contributor: Balwinder S "bsd" Dheeman <bdheeman@gmail.com>
4 pkgname=ibjts
5 pkgver=898
6 pkgrel=2
7 pkgdesc="Interactive Brocker's Trade Workstation"
8 arch=('i686' 'x86_64')
9 url=http://www.interactivebrokers.co.in/
10 license=('GPL2')
11 depends=('jre>=6u10')
13 _bldname=unixmacosx.jar
14 _bldroot=http://www.interactivebrokers.com/download
16 source=('IBJts.desktop' 'IBJts.sh' 'IBJts_64x64.gif')
18 # trick re-determining the build revision and, or entertain the hidden
19 # makepkg option --forcever, huh
20 if [ -z "$FORCE_VER" ]; then
21     msg "Determining latest build revision..."
22     newpkgver=$(expr $pkgver + 1)
23     while wget -qO /dev/null http://www.interactivebrokers.co.in/en/software/releaseNotes/TWS_Notes_$newpkgver.php; do
24         newpkgver=$(expr $newpkgver + 1)
25     done
26     newpkgver=$(expr $newpkgver - 1)
27     if [ -n "$newpkgver" -a "$newpkgver" != "$pkgver" ]; then
28         msg2 "Version found: %s" "$newpkgver"
29         rm -f "$SRCDEST/${_bldname}"
30         FORCE_VER="$newpkgver"
31         devel_update
32     fi
33 elif [ "$FORCE_VER" != "$pkgver" ]; then
34     newpkgver="$FORCE_VER"
35     rm -f "$SRCDEST/${_bldname}"
36     devel_update
39 build() {
40     if [ ! -r "$srcdir/${_bldname}" ]; then
41         msg "Downloading the latest '$CARCH/$pkgver/${_bldname}'..."
42         wget --no-proxy -c "${_bldroot}/${_bldname}" \
43             -O "$SRCDEST/${_bldname}" || return $?
44         ln -fs "$SRCDEST/${_bldname}" "$srcdir/${_bldname}" || return $?
45     fi
47     msg "Extracting JAR..."
48     cd $srcdir
49     bsdtar -xf $srcdir/${_bldname} || return $?
50     mkdir -p $pkgdir/opt
51     cp -r $srcdir/IBJts $pkgdir/opt/IBJts
53     msg "Making it nice..."
54     chmod 0755 $pkgdir/opt/IBJts
55     chmod 0644 $pkgdir/opt/IBJts/*
56     install -Dm755 $srcdir/IBJts.sh $pkgdir/opt/IBJts/IBJts.sh
57     install -Dm644 $srcdir/IBJts.desktop \
58         $pkgdir/usr/share/applications/IBJts.desktop
59     install -Dm644 $srcdir/IBJts_64x64.gif \
60         $pkgdir/usr/share/pixmaps/IBJts_64x64.gif
63 # vim:set ts=4 sw=4 et:
64 md5sums=('87beeb5ab2d9436ee7babb698da51678'
65          'e9e10b820207c951ee929c5a68d6abac'
66          'de672919cfbcd4668a10db082517560a')