# $Id$
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
# shamelessly stolen from Archlinux
pkgname='docbook-dsssl'
pkgver=1.79
pkgrel=1
pkgdesc="DSSSL Stylesheets for DocBook"
arch=('any')
url="https://docbook.sourceforge.io/"
license=('custom')
depends=('sgml-common' 'perl')
install=${pkgname}.install
source=(https://sourceforge.net/projects/docbook/files/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2
        docbook-style-dsssl.Makefile)
sha256sums=('2f329e120bee9ef42fbdd74ddd60e05e49786c5a7953a0ff4c680ae6bdf0e2bc'
            '563662f6a3a0777f1ac037a0aebcfcdf7e9c8a8d3e042e69a33edffc0bcae1f1')

prepare() {
  cd "${pkgname}-${pkgver}"
  cp ${srcdir}/docbook-style-dsssl.Makefile Makefile
}

package(){
  cd "${pkgname}-${pkgver}"
  make install \
     BINDIR="${pkgdir}/usr/bin" \
     DESTDIR="${pkgdir}/usr/share/sgml/docbook/dsssl-stylesheets-${pkgver}" \
     MANDIR="${pkgdir}/usr/share/man"
  
  ln -s dsssl-stylesheets-${pkgver} ${pkgdir}/usr/share/sgml/docbook/dsssl-stylesheets
  # license
  install -Dm644 README "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
