# $Id: PKGBUILD 163502 2012-07-13 16:29:26Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Judd Vinet <jvinet@zeroflux.org>
# Contributor: Curtis Campbell <curtisjamescampbell@hotmail.com>
pkgname=usbutils
pkgver=006
pkgrel=1
pkgdesc="USB Device Utilities"
arch=(i686 x86_64)
license=('GPL')
groups=('base')
depends=('libusb' 'hwids')
optdepends=('python2: for lsusb.py usage'
            'coreutils: for lsusb.py usage')
url="http://linux-usb.sourceforge.net/"
source=("http://www.kernel.org/pub/linux/utils/usb/usbutils/${pkgname}-${pkgver}.tar.xz"
        fix-python2.patch)
md5sums=('c9aa14ee3d6c991fda183f42cf72a8a8'
         '45766196895b4cc50b53cd56e1bbf3d1')

build() {
  cd $srcdir/$pkgname-$pkgver
  # patch lsusb.py to use correct usb.ids file and python2 interpreter
  patch -Np1 -i $srcdir/fix-python2.patch
  ./configure --prefix=/usr --datadir=/usr/share/hwdata --disable-zlib
  make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install
  # this is now in the hwids package
  rm -rf $pkgdir/usr/{share/hwdata,sbin}
}