]>
Commit | Line | Data |
---|---|---|
912a3b4b | 1 | # |
2 | # Conditional build: | |
45fc015c | 3 | %bcond_with tests # perform "make test" |
912a3b4b | 4 | # |
5 | %include /usr/lib/rpm/macros.perl | |
6 | %define pdir Device | |
7 | %define pnam USB | |
8 | Summary: Device::USB - Use libusb to access USB devices | |
9 | Name: perl-Device-USB | |
52a006a9 | 10 | Version: 0.33 |
23d38977 | 11 | Release: 2 |
912a3b4b | 12 | # same as perl |
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 | |
52a006a9 | 16 | # Source0-md5: a3a9e89c61093f428e1c2440d9187fb1 |
912a3b4b | 17 | URL: http://search.cpan.org/dist/Device-USB/ |
685c6566 | 18 | %if "%{pld_release}" == "ac" |
19 | BuildRequires: libusb-devel < 1.0 | |
20 | %else | |
52bac288 | 21 | BuildRequires: libusb-compat-devel |
685c6566 | 22 | %endif |
912a3b4b | 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 | |
9254e820 | 28 | BuildRequires: sed >= 4.0 |
912a3b4b | 29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
30 | ||
31 | %description | |
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. | |
37 | ||
38 | %prep | |
39 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
40 | ||
9254e820 | 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 | |
43 | rm USB.pm | |
44 | ln -s lib/Device/USB.pm . | |
45 | ||
912a3b4b | 46 | %build |
52bac288 | 47 | export LIBUSB_LIBDIR="%{_libdir}" |
912a3b4b | 48 | %{__perl} Makefile.PL \ |
49 | INSTALLDIRS=vendor | |
52bac288 | 50 | %{__make} -j1 |
912a3b4b | 51 | |
52 | %{?with_tests:%{__make} test} | |
53 | ||
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | ||
57 | %{__make} pure_install \ | |
58 | DESTDIR=$RPM_BUILD_ROOT | |
59 | ||
60 | %clean | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %files | |
64 | %defattr(644,root,root,755) | |
65 | %doc Changes README | |
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 | %{perl_vendorarch}/auto/Device/USB/*.bs | |
71 | %attr(755,root,root) %{perl_vendorarch}/auto/Device/USB/*.so | |
72 | %{_mandir}/man3/* |