# Maintainer: Norbert Pfeiler <norbert.pfeiler+aur ät gmail.com>

pkgname=grml-zsh-config
pkgver=0.20.2
pkgrel=1
pkgdesc="grml's zsh setup"
arch=('any')
url='https://grml.org/zsh/'
msys2_repository_url='https://github.com/grml/grml-etc-core'
msys2_documentation_url='https://grml.org/zsh/'
msys2_changelog_url='https://github.com/grml/grml-etc-core/blob/master/debian/changelog'
msys2_references=(
  'anitya: 14445'
  'archlinux: grml-zsh-config'
)
license=('spdx:GPL-2.0-or-later')
provides=('grmlzshrc')
depends=('zsh' 'coreutils' 'grep' 'sed' 'procps-ng')
makedepends=('txt2tags' 'asciidoctor')
source=("https://deb.grml.org/pool/main/g/grml-etc-core/grml-etc-core_${pkgver}.tar.xz")
sha256sums=('9e3d2a91e9f078bff29a6b1a96b493726b3bb36e71ea4380ec6963ad41c94738')

build() {
  cd ${srcdir}/grml-etc-core-${pkgver}/doc
  make
}

package() {
  cd ${srcdir}/grml-etc-core-${pkgver}
  install -D -m644 etc/skel/.zshrc ${pkgdir}/etc/skel/.zshrc
  install -D -m644 etc/zsh/keephack ${pkgdir}/etc/zsh/keephack
  install -D -m644 etc/zsh/zshrc ${pkgdir}/etc/zsh/zshrc

  install -D -m644 doc/grmlzshrc.5 ${pkgdir}/usr/share/man/man5/grmlzshrc.5
  # the symlinking from the original pkg doesn’t work
  # because the target doesn’t exist yet (manpage compression)
  # and msys2’s symlink simply copies
  install -D -m644 doc/grmlzshrc.5 ${pkgdir}/usr/share/man/man5/grml-zsh-config.5
}
