# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Chris Severance <aur.severach@spamgourmet.com>
# Contributor: Neal Buchanan <neal.buchanan@gmx.com>

pkgname=libldm
pkgver=0.2.4
pkgrel=3
pkgdesc='A tool and library for managing Microsoft Windows Dynamic Disks'
arch=('x86_64')
url='https://github.com/mdbooth/libldm'
license=('GPL3' 'LGPL3')
depends=('device-mapper' 'glib2' 'json-glib' 'zlib'
         'libreadline.so' 'libuuid.so')
makedepends=('git' 'gtk-doc')
provides=('ldmtool' 'libldm-1.0.so')
conflicts=('ldmtool')
source=("git+https://github.com/mdbooth/libldm.git#tag=libldm-${pkgver}"
        'ldmtool.service')
sha256sums=('SKIP'
            '7feca8b7b8561b2572e23c82a889fd665a25aabddfed336caf13c4bcb053d99e')

prepare() {
  cd libldm

  git cherry-pick -n ee1b37a034038f09d61b121cc8b3651024acc46f # FS#60486
}

build() {
  cd libldm

  ./autogen.sh \
    --prefix='/usr'
  make
}

package() {
  make DESTDIR="${pkgdir}" -C libldm install
  install -Dm 644 ldmtool.service -t "${pkgdir}"/usr/lib/systemd/system/
}

# vim: ts=2 sw=2 et:
