3 %bcond_with tests # perform "make test"
7 %include /usr/lib/rpm/macros.perl
8 Summary: Device::USB - Use libusb to access USB devices
13 License: GPL v1+ or Artistic
14 Group: Development/Languages/Perl
15 Source0: http://search.cpan.org/CPAN/authors/id/G/GW/GWADEJ/Device-USB-%{version}.tar.gz
16 # Source0-md5: 8ce79b0c26336dafd3d29f8cb534a925
17 URL: http://search.cpan.org/dist/Device-USB/
18 %if "%{pld_release}" == "ac"
19 BuildRequires: libusb-devel < 1.0
21 BuildRequires: libusb-compat-devel
23 BuildRequires: perl-Inline
24 BuildRequires: perl-Inline-C
25 BuildRequires: perl-Parse-RecDescent
26 BuildRequires: perl-devel >= 1:5.8.0
27 BuildRequires: rpm-perlprov >= 4.1-13
28 BuildRequires: sed >= 4.0
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 This module provides a Perl interface to the C library libusb. This
33 library supports a relatively full set of functionality to access a
34 USB device. In addition to the libusb, functioality, Device::USB
35 provides a few convenience features that are intended to produce a
36 more Perl-ish interface.
39 %setup -q -n %{pdir}-%{pnam}-%{version}
41 # function names conflict with libusb-1.0
42 sed -e 's/libusb_/DeviceUSB_/g' -i lib/Device/USB.pm lib/Device/USB/Device.pm
44 ln -s lib/Device/USB.pm .
47 export LIBUSB_LIBDIR="%{_libdir}"
48 %{__perl} Makefile.PL \
52 %{?with_tests:%{__make} test}
55 rm -rf $RPM_BUILD_ROOT
57 %{__make} pure_install \
58 DESTDIR=$RPM_BUILD_ROOT
61 rm -rf $RPM_BUILD_ROOT
64 %defattr(644,root,root,755)
66 %{perl_vendorarch}/Device/*.pm
67 %{perl_vendorarch}/Device/USB
68 %attr(755,root,root) %{perl_vendorarch}/Device/dump_usb.pl
69 %dir %{perl_vendorarch}/auto/Device/USB
70 %attr(755,root,root) %{perl_vendorarch}/auto/Device/USB/*.so