# $Id: PKGBUILD 117954 2014-08-27 07:33:01Z arcanis $
# Maintainer: Evgeniy Alekseev <arcanis.arch at gmail dot com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski at archlinux dot org>
# Contributor: Felipe Hommen <felibank at gmail dot com>
# Contributor: moostik <mooostik at gmail dot com>

pkgname=geogebra
pkgver=4.4.43.0
pkgrel=1
pkgdesc="Dynamic mathematics software with interactive graphics, algebra and spreadsheet"
arch=('any')
url='http://www.geogebra.org/'
license=('GPL3' 'CCPL:by-sa' 'CCPL:by-nc')
depends=('desktop-file-utils' 'gsl' 'hicolor-icon-theme' 'java-runtime'
         'shared-mime-info' 'xdg-utils')
source=(http://download.geogebra.org/installers/4.4/GeoGebra-Linux-Installer-${pkgver}.tar.gz)
install=geogebra.install
md5sums=('03c65a4f06bdeff9be4444f42bdce15e')
changelog=ChangeLog

prepare() {
  cd "${pkgname}-${pkgver}"
  sed -i 's|/usr|${pkgdir}/usr|g' install.sh
}

package() {
  cd "${pkgname}-${pkgver}"
  install -dm755 "${pkgdir}/usr/bin" \
                 "${pkgdir}/usr/share/"{applications,geogebra}
  source install.sh
  install -Dm644 "_license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  rm -rf "${pkgdir}/usr/share/mime/"
}
