# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
# Contributor: Øyvind 'Mr.Elendig' Heggstad <mrelendig@har-ikkje.net>
# Contributor: Fabrizio Antonangeli <fabrizio.antonangeli@gmail.com>

pkgname=dfu-util
pkgver=0.9
pkgrel=2
pkgdesc='Tool intended to download and upload firmware using DFU protocol to devices connected over USB'
url='http://dfu-util.sourceforge.net/'
license=(GPL2)
arch=(x86_64)
depends=(libusb)
install=dfu-util.install
source=(stm32dfu.udev.rules
        http://dfu-util.sourceforge.net/releases/$pkgname-$pkgver.tar.gz)
sha256sums=('64d4314f354d965e3dc0fd439dc497d5d0a41bf649da1869df40f93718e5a6fe'
            '36428c6a6cb3088cad5a3592933385253da5f29f2effa61518ee5991ea38f833')

build() {
  cd $pkgname-$pkgver
  ./autogen.sh
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 "$srcdir"/stm32dfu.udev.rules "$pkgdir"/usr/lib/udev/rules.d/48-stm32dfu.rules
}
