# $Id: PKGBUILD 108041 2014-03-21 16:52:18Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Timm Preetz <timm@preetz.us>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=netbeans
pkgver=8.0
_subpkgver=201403022200
pkgrel=1
pkgdesc='IDE for Java, HTML5, PHP, Groovy, C and C++'
arch=('any')
url='http://netbeans.org/'
license=('CDDL')
# classpath is not needed, see FS#38567 (Oracle JDK does not need atk either)
depends=('java-environment' 'ttf-font' 'libxtst' 'giflib' 'atk')
backup=('usr/share/netbeans/etc/netbeans.conf')
makedepends=('gendesk' 'setconf')
optdepends=('php: for developing programs in php'
            'groovy: for developing programs in groovy'
            'lib32-glibc')
install='netbeans.install'
options=('!strip')
source=("http://dlc.sun.com.edgesuite.net/$pkgname/$pkgver/final/zip/$pkgname-$pkgver-$_subpkgver.zip")
# http://dlc.sun.com.edgesuite.net/netbeans/8.0/final/zip/
sha256sums=('dbe6b8d6ba0f3bbfec2bab941d7d7b24812679bf38f50469df55d360bcf0eae7')

prepare() {
  gendesk -f -n --pkgname "$pkgname" --pkgdesc "$pkgdesc"
  setconf "$pkgname/bin/$pkgname" basedir "/usr/share/$pkgname"
}

package() {
  mkdir -p "$pkgdir/usr/"{bin,share/applications}
  cp -r "$pkgname" "$pkgdir/usr/share/"
  install -Dm644 "$pkgname.desktop" \
    "$pkgdir/usr/share/applications/$pkgname.desktop"
  cd "$pkgname"
  install -Dm644 "nb/$pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
  install -Dm755 "bin/$pkgname" "$pkgdir/usr/bin/$pkgname"

  # Cleanup (contains the file that is now placed in /usr/bin + .exe-files)
  rm -r "$pkgdir/usr/share/$pkgname/bin"
}

# vim:set ts=2 sw=2 et:
