# $Id: PKGBUILD 106111 2014-02-23 06:01:15Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=emacs-pkgbuild-mode
pkgver=0.11
pkgrel=2
pkgdesc="A major mode for creating packages with emacs"
arch=('any')
url="http://github.com/juergenhoetzel/pkgbuild-mode"
license=('GPL')
depends=('emacs')
install=emacs-pkgbuild-mode.install
source=(https://github.com/juergenhoetzel/pkgbuild-mode/tarball/${pkgver} emacs-pkgbuild-mode-template.patch)
sha1sums=('2f0a658bef68801b50faac4fb746c895ed8ea672'
          'a7059f87095970a8fc2b954ec7420aae72a00995')

prepare() {
  cd juergenhoetzel-pkgbuild-mode-*
  patch -p1 -i "${srcdir}/emacs-pkgbuild-mode-template.patch"
}

package() {
  cd juergenhoetzel-pkgbuild-mode-*
  emacs -batch -f batch-byte-compile pkgbuild-mode.el
  install -d "${pkgdir}/usr/share/emacs/site-lisp"
  install -D -m644 pkgbuild-mode.el pkgbuild-mode.elc "${pkgdir}/usr/share/emacs/site-lisp"
}
