]>
Commit | Line | Data |
---|---|---|
912a3b4b | 1 | # |
2 | # Conditional build: | |
45fc015c | 3 | %bcond_with tests # perform "make test" |
846e33ca ER |
4 | |
5 | %define pdir Device | |
6 | %define pnam USB | |
912a3b4b | 7 | Summary: Device::USB - Use libusb to access USB devices |
8 | Name: perl-Device-USB | |
5bfaa1a1 | 9 | Version: 0.36 |
797f8981 | 10 | Release: 6 |
912a3b4b | 11 | # same as perl |
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 | |
5bfaa1a1 | 15 | # Source0-md5: aa91bee777f7ed7a18225a84f8795344 |
ac078533 JR |
16 | Patch0: fix-buildsystem.patch |
17 | Patch1: hardening-flags.patch | |
18 | Patch2: just-assume-libusb-is-there.patch | |
912a3b4b | 19 | URL: http://search.cpan.org/dist/Device-USB/ |
685c6566 | 20 | %if "%{pld_release}" == "ac" |
21 | BuildRequires: libusb-devel < 1.0 | |
22 | %else | |
52bac288 | 23 | BuildRequires: libusb-compat-devel |
685c6566 | 24 | %endif |
912a3b4b | 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 | |
9254e820 | 30 | BuildRequires: sed >= 4.0 |
912a3b4b | 31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
33 | %description | |
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. | |
39 | ||
40 | %prep | |
41 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
ac078533 JR |
42 | %patch0 -p1 |
43 | %patch1 -p1 | |
44 | %patch2 -p1 | |
912a3b4b | 45 | |
9254e820 | 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 | |
48 | rm USB.pm | |
49 | ln -s lib/Device/USB.pm . | |
50 | ||
912a3b4b | 51 | %build |
52bac288 | 52 | export LIBUSB_LIBDIR="%{_libdir}" |
912a3b4b | 53 | %{__perl} Makefile.PL \ |
54 | INSTALLDIRS=vendor | |
52bac288 | 55 | %{__make} -j1 |
912a3b4b | 56 | |
57 | %{?with_tests:%{__make} test} | |
58 | ||
59 | %install | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
62 | %{__make} pure_install \ | |
63 | DESTDIR=$RPM_BUILD_ROOT | |
64 | ||
65 | %clean | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %files | |
69 | %defattr(644,root,root,755) | |
ac078533 | 70 | %doc Changes README dump_usb.pl |
912a3b4b | 71 | %{perl_vendorarch}/Device/*.pm |
72 | %{perl_vendorarch}/Device/USB | |
912a3b4b | 73 | %dir %{perl_vendorarch}/auto/Device/USB |
912a3b4b | 74 | %attr(755,root,root) %{perl_vendorarch}/auto/Device/USB/*.so |
75 | %{_mandir}/man3/* |