3 %bcond_with tests # perform "make test"
7 Summary: Device::USB - Use libusb to access USB devices
12 License: GPL v1+ or Artistic
13 Group: Development/Languages/Perl
14 Source0: http://search.cpan.org/CPAN/authors/id/G/GW/GWADEJ/Device-USB-%{version}.tar.gz
15 # Source0-md5: aa91bee777f7ed7a18225a84f8795344
16 Patch0: fix-buildsystem.patch
17 Patch1: hardening-flags.patch
18 Patch2: just-assume-libusb-is-there.patch
19 URL: http://search.cpan.org/dist/Device-USB/
20 %if "%{pld_release}" == "ac"
21 BuildRequires: libusb-devel < 1.0
23 BuildRequires: libusb-compat-devel
25 BuildRequires: perl-Inline
26 BuildRequires: perl-Inline-C
27 BuildRequires: perl-Parse-RecDescent
28 BuildRequires: perl-devel >= 1:5.8.0
29 BuildRequires: rpm-perlprov >= 4.1-13
30 BuildRequires: sed >= 4.0
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 This module provides a Perl interface to the C library libusb. This
35 library supports a relatively full set of functionality to access a
36 USB device. In addition to the libusb, functioality, Device::USB
37 provides a few convenience features that are intended to produce a
38 more Perl-ish interface.
41 %setup -q -n %{pdir}-%{pnam}-%{version}
46 # function names conflict with libusb-1.0
47 sed -e 's/libusb_/DeviceUSB_/g' -i lib/Device/USB.pm lib/Device/USB/Device.pm
49 ln -s lib/Device/USB.pm .
52 export LIBUSB_LIBDIR="%{_libdir}"
53 %{__perl} Makefile.PL \
57 %{?with_tests:%{__make} test}
60 rm -rf $RPM_BUILD_ROOT
62 %{__make} pure_install \
63 DESTDIR=$RPM_BUILD_ROOT
66 rm -rf $RPM_BUILD_ROOT
69 %defattr(644,root,root,755)
70 %doc Changes README dump_usb.pl
71 %{perl_vendorarch}/Device/*.pm
72 %{perl_vendorarch}/Device/USB
73 %dir %{perl_vendorarch}/auto/Device/USB
74 %attr(755,root,root) %{perl_vendorarch}/auto/Device/USB/*.so