# $Id: PKGBUILD 232405 2015-03-02 04:52:47Z 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.2
pkgrel=1
_release=luna-SR2
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=('ceb3bda732e4b5b6ed7004b8571b0542'
         'eec208c584a2449eb6f69d45a396c6bd'
         '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
}
