# $Id: PKGBUILD 229414 2015-01-16 11:29:52Z heftig $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Paul Mattal <paul@archlinux.org>
# Contributor: Andrew Wright <andreww@photism.org>
# Contributor: Andreas W. Hauser <andy-aur@splashground.de>
# Contributor: Marco Crosio <marco.crosio@gmail.com>

pkgname=eclipse
pkgver=4.4.1.a
pkgrel=1
_release=luna-SR1a
pkgdesc="An IDE for Java and other languages"
license=("EPL")
arch=('i686' 'x86_64')
url="http://eclipse.org"
depends=('java-environment' 'gtk2' 'unzip' 'webkitgtk2' 'libxtst')
install=eclipse.install
source=("http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$pkgname-standard-$_release-linux-gtk.tar.gz"
        "http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/${_release/-//}/$pkgname-standard-$_release-linux-gtk-x86_64.tar.gz"
        'eclipse.sh' 'eclipse.desktop')
md5sums=('88dadb3ec5c58f8eceb40ff2f8744d19'
         'a42f9c9b1be7a0eae2f3e86fc41a2472'
         '66757230837fdebabb8ce91eb4fccc80'
         'ba2cf02c48e6e35bfe3685401c26bb5b')

if (( ! GENINTEG )); then
  if [[ $CARCH == x86_64 ]]; then
    source=("${source[@]:1}")
    md5sums=("${md5sums[@]:1}")
  else
    source=("${source[0]}" "${source[@]:2}")
    md5sums=("${md5sums[0]}" "${md5sums[@]:2}")
  fi
fi

package_eclipse() {
  install -d "$pkgdir/usr/share"
  cp -a eclipse "$pkgdir/usr/share/eclipse"

  install -D eclipse.sh "$pkgdir/usr/bin/eclipse"
  install -Dm644 eclipse.desktop "$pkgdir/usr/share/applications/eclipse.desktop"

  for _i in 16 32 48 256; do
    install -Dm644 eclipse/plugins/org.eclipse.platform_*/eclipse${_i}.png \
      "$pkgdir/usr/share/icons/hicolor/${_i}x${_i}/apps/eclipse.png"
  done
}
