# $Id: PKGBUILD 114772 2014-07-04 01:58:35Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=auctex
pkgver=11.87
pkgrel=2
pkgdesc="An extensible package for writing and formatting TeX files in Emacs"
arch=('any') 
url="http://www.gnu.org/software/auctex/"
license=('GPL3')
depends=('emacs' 'ghostscript' 'texlive-core')
options=('!makeflags')
install=auctex.install
source=(http://ftp.gnu.org/pub/gnu/auctex/${pkgname}-${pkgver}.tar.gz{,.sig})
sha1sums=('0be92c7d8f89d57346fe07f05a1a045ffd11cd71'
          'SKIP')

prepare() {
  cd ${pkgname}-${pkgver}/preview
  sed -i 's/as_fn_error $? "--with-texmf-dir=/echo as_fn_error $? "--with-texmf-dir=/' configure
}


build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --localstatedir=/var --with-texmf-dir=/usr/share/texmf
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}"  install
}
