# $Id$
# Maintainer (arch): Tobias Powalowski <tpowa@archlinux.org>
# Maintainer (arch): Thomas Baechler <thomas@archlinux.org>
# Contributor: André Silva <emulatorman@hyperbola.info>

# parabola changes and rationale (based on extra/linux-manpages):
#  changed upstream source to linux-libre

pkgname=linux-libre-manpages
pkgver=4.10_gnu
pkgrel=1
pkgdesc="Kernel hackers manual - Section 9 manpages that comes with the Linux-libre kernel."
arch=('any')
url="https://linux-libre.fsfla.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl')
replaces=('linux-manpages' 'kernel26-manpages')
conflicts=('linux-manpages' 'kernel26-manpages')
provides=('linux-manpages' 'kernel26-manpages')
options=('!zipman')
source=("https://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver//_/-}/linux-libre-${pkgver//_/-}.tar.xz"{,.sign})
sha256sums=('8a5e5d69a71480d90f9e8db9f8c6fdad71adb1e445b4d80eb81adf1de7fbff98'
            'SKIP')
validpgpkeys=('474402C8C582DAFBE389C427BCB7CF877E7D47A7') # Alexandre Oliva


build() {
  cd "${srcdir}/linux-${pkgver%_*}"
  make mandocs
}

package() {
  cd "${srcdir}/linux-${pkgver%_*}"
  # fix install path
  sed -i -e "s:/usr/local/man/man9/:${pkgdir}/usr/share/man/man9/:g" Documentation/DocBook/Makefile
  make installmandocs

  #install -d "${pkgdir}/usr/share/man/man9/"
  #install "${srcdir}"/linux-$pkgver/Documentation/DocBook/man/*/*.9.gz "${pkgdir}/usr/share/man/man9/"

#  find "${pkgdir}" -type f -exec chmod 644 {} \;
}
