%define name	usbutils
%define version	0.86
%define release	2%{?_dist_release}

Summary:	USB related utilities.
Summary(ja): 	USB 用ユーティリティ
Name:		%{name}
Version:	%{version}
Release: 	%{release}
Source0:	%{name}-%{version}.tar.gz
Patch1:		usbutils-0.86-hwdata.patch
License:	GPLv2+
Group:		Applications/System
URL:		http://www.linux-usb.org/

Requires:	hwdata
BuildRequires:	libtool, libusb-devel >= 0.1.8
BuildRoot:	%{_tmppath}/%{name}-%{version}-root


%description
The usbutils package contains utilities for inspecting devices 
connected to the USB. 

%description -l ja
このパッケージには USB に接続された各種デバイスの状態を見る為の
ユーティリティが収められています．


%prep

%setup -q
%patch1 -p1 -b .hwdata
autoreconf

%build
%configure --sbindir=%{_sbindir}
make %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%makeinstall

# remove unnecessary file.
%{__rm} -rf ${RPM_BUILD_ROOT}/%{_datadir}/usb.ids*
%{__rm} -rf ${RPM_BUILD_ROOT}/%{_sbindir}/update-usbids.sh

# usb.ids is shipped in hwdata; nuke and adjust .pc file
sed -i 's|usbids=/usr/share/usb.ids|usbids=/usr/share/hwdata/usb.ids|' $RPM_BUILD_ROOT%{_datadir}/pkgconfig/usbutils.pc

%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%files
%defattr(-,root,root,-)
%{_mandir}/*/*
%{_sbindir}/*
%{_bindir}/*
%{_datadir}/pkgconfig/usbutils.pc
%doc AUTHORS COPYING ChangeLog NEWS README

%changelog
* Wed Oct 06 2010 Shu KONNO <owa@bg.wakwak.com> 0.86-2
- rebuilt with rpm-4.8.1 for pkg-config

* Sun Oct 11 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.86-1
- new upstream release
- added %configure --sbindir=%{_sbindir}

* Thu Jul 23 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.84-1vl5
- new upstream release
- changed %files
- added Patch1
- added autoreconf before %build

* Sun Jun 14 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.82-1vl5
- new upstream release
- dropt Patch1
- changed License: GPLv2+
- added BuildRequires:	libtool

* Mon Oct 13 2008 Shu KONNO <owa@bg.wakwak.com> 0.72-1vl5
- applied new versioning policy, spec in utf-8

* Sat Jul 14 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.72-0vl1
- initial build for Vine Linux
