# Maintainer: damir <damir@archlinux.org>

pkgbase=libxml++2.6
pkgname=('libxml++2.6' 'libxml++2.6-docs')
pkgver=2.40.1
pkgrel=3
arch=('x86_64')
license=('LGPL')
url="http://libxmlplusplus.sourceforge.net/"
makedepends=('pkgconfig' 'glibmm-docs' 'libxml2' 'glibmm')
options=('!emptydirs')
source=(http://ftp.gnome.org/pub/GNOME/sources/libxml++/${pkgver:0:4}/libxml++-${pkgver}.tar.xz)
sha256sums=('4ad4abdd3258874f61c2e2a41d08e9930677976d303653cd1670d3e9f35463e9')

build() {
  cd "${srcdir}/libxml++-${pkgver}"
  ./configure --prefix=/usr

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_libxml++2.6() {
  pkgdesc="C++ bindings to libxml2"
  depends=('libxml2' 'glibmm')
  replaces=('libxml++2')
  provides=("libxml++2=${pkgver}")
  conflicts=('libxml++2')

  cd "${srcdir}/libxml++-${pkgver}"
  make DESTDIR="${pkgdir}" install doc_subdirs=
}

package_libxml++2.6-docs() {
  pkgdesc="Developer documentation for libxml++"
  depends=('glibmm-docs')
  cd "${srcdir}/libxml++-${pkgver}"
  make DESTDIR="${pkgdir}" -C docs install
}
