]>
Commit | Line | Data |
---|---|---|
a1fa7d88 JB |
1 | # |
2 | # Conditional build: | |
42999523 | 3 | %bcond_without apidocs # API documentation |
881ed13f | 4 | |
a1fa7d88 JB |
5 | Summary: HID API for Windows, Linux and Mac OS X |
6 | Summary(pl.UTF-8): API HID dla systemów Windows, Linux oraz Mac OS X | |
7 | Name: hidapi | |
42999523 JB |
8 | Version: 0.9.0 |
9 | Release: 1 | |
a1fa7d88 JB |
10 | License: GPL v3 or BSD or HIDAPI |
11 | Group: Libraries | |
42999523 JB |
12 | #Source0Download: https://github.com/libusb/hidapi/releases |
13 | Source0: https://github.com/libusb/hidapi/archive/%{name}-%{version}/%{name}-%{version}.tar.gz | |
14 | # Source0-md5: a6bafd1bc5b74d411b77e0a90f601aed | |
15 | URL: https://github.com/libusb/hidapi | |
98a878eb JB |
16 | BuildRequires: autoconf >= 2.63 |
17 | BuildRequires: automake | |
a1fa7d88 | 18 | %{?with_apidocs:BuildRequires: doxygen} |
98a878eb JB |
19 | BuildRequires: libtool >= 2:2 |
20 | BuildRequires: libusb-devel >= 1.0.9 | |
21 | # HIDRAW interface | |
22 | BuildRequires: linux-libc-headers >= 7:2.6.39 | |
a1fa7d88 | 23 | BuildRequires: pkgconfig |
98a878eb JB |
24 | BuildRequires: udev-devel |
25 | Requires: libusb >= 1.0.9 | |
a1fa7d88 JB |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
28 | %description | |
29 | HIDAPI is a multi-platform library which allows an application to | |
30 | interface with USB and Bluetooth HID-Class (Human Interface Device) | |
881ed13f | 31 | devices on Windows, Linux, and Mac OS X. |
a1fa7d88 JB |
32 | |
33 | %description -l pl.UTF-8 | |
34 | HIDAPI to wieloplatformowa biblioteka pozwalająca aplikacjom | |
35 | współpracować z urządzeniami USB i Bluetooth klasy HID (Human | |
36 | Interface Device) w systemach Windows, Linux oraz Mac OS X. | |
37 | ||
38 | %package devel | |
39 | Summary: Header file for HIDAPI library | |
40 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki HIDAPI | |
41 | Group: Development/Libraries | |
42 | Requires: %{name} = %{version}-%{release} | |
98a878eb | 43 | Requires: libusb-devel >= 1.0.9 |
a1fa7d88 JB |
44 | |
45 | %description devel | |
46 | Header file for HIDAPI library. | |
47 | ||
48 | %description devel -l pl.UTF-8 | |
49 | Plik nagłówkowy biblioteki HIDAPI. | |
50 | ||
51 | %package static | |
52 | Summary: Static HIDAPI library | |
53 | Summary(pl.UTF-8): Statyczna biblioteka HIDAPI | |
54 | Group: Development/Libraries | |
55 | Requires: %{name}-devel = %{version}-%{release} | |
56 | ||
57 | %description static | |
58 | Static HIDAPI library. | |
59 | ||
60 | %description static -l pl.UTF-8 | |
61 | Statyczna biblioteka HIDAPI. | |
62 | ||
63 | %package apidocs | |
64 | Summary: HIDAPI API documentation | |
65 | Summary(pl.UTF-8): Dokumentacja API biblioteki HIDAPI | |
66 | Group: Documentation | |
42999523 | 67 | %if "%{_rpmversion}" >= "4.6" |
881ed13f ER |
68 | BuildArch: noarch |
69 | %endif | |
a1fa7d88 JB |
70 | |
71 | %description apidocs | |
72 | API documentation for HIDAPI library. | |
73 | ||
74 | %description apidocs -l pl.UTF-8 | |
75 | Dokumentacja API biblioteki HIDAPI. | |
76 | ||
77 | %prep | |
42999523 | 78 | %setup -q -n %{name}-%{name}-%{version} |
a1fa7d88 | 79 | |
98a878eb | 80 | cp -p linux/README.txt README-linux.txt |
a1fa7d88 JB |
81 | |
82 | %build | |
98a878eb JB |
83 | %{__libtoolize} |
84 | %{__aclocal} -I m4 | |
a2d215ae AM |
85 | %{__autoconf} |
86 | %{__autoheader} | |
a2d215ae AM |
87 | %{__automake} |
88 | %configure \ | |
89 | --disable-silent-rules | |
90 | %{__make} | |
a1fa7d88 JB |
91 | |
92 | %if %{with apidocs} | |
93 | cd doxygen | |
94 | doxygen Doxyfile | |
95 | cd .. | |
96 | %endif | |
97 | ||
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
a1fa7d88 | 100 | |
a2d215ae AM |
101 | %{__make} install \ |
102 | DESTDIR=$RPM_BUILD_ROOT | |
a1fa7d88 | 103 | |
42999523 JB |
104 | # obsoleted by pkg-config |
105 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libhidapi-*.la | |
106 | ||
98a878eb JB |
107 | # packaged as %doc |
108 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/hidapi | |
109 | ||
a1fa7d88 JB |
110 | %clean |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
113 | %post -p /sbin/ldconfig | |
114 | %postun -p /sbin/ldconfig | |
115 | ||
116 | %files | |
117 | %defattr(644,root,root,755) | |
118 | # included hid.rules as doc only - it uses e.g. MODE="0666", so requires some adjustments at least for stricter permissions | |
42999523 | 119 | %doc AUTHORS.txt LICENSE.txt LICENSE-bsd.txt LICENSE-orig.txt README.md README-linux.txt udev/99-hid.rules |
a2d215ae AM |
120 | %attr(755,root,root) %{_libdir}/libhidapi-hidraw.so.*.*.* |
121 | %attr(755,root,root) %ghost %{_libdir}/libhidapi-hidraw.so.0 | |
122 | %attr(755,root,root) %{_libdir}/libhidapi-libusb.so.*.*.* | |
123 | %attr(755,root,root) %ghost %{_libdir}/libhidapi-libusb.so.0 | |
a1fa7d88 JB |
124 | |
125 | %files devel | |
126 | %defattr(644,root,root,755) | |
a2d215ae AM |
127 | %attr(755,root,root) %{_libdir}/libhidapi-hidraw.so |
128 | %attr(755,root,root) %{_libdir}/libhidapi-libusb.so | |
a2d215ae AM |
129 | %{_includedir}/hidapi |
130 | %{_pkgconfigdir}/hidapi-hidraw.pc | |
131 | %{_pkgconfigdir}/hidapi-libusb.pc | |
a1fa7d88 JB |
132 | |
133 | %files static | |
134 | %defattr(644,root,root,755) | |
a2d215ae AM |
135 | %{_libdir}/libhidapi-hidraw.a |
136 | %{_libdir}/libhidapi-libusb.a | |
a1fa7d88 JB |
137 | |
138 | %if %{with apidocs} | |
139 | %files apidocs | |
140 | %defattr(644,root,root,755) | |
141 | %doc doxygen/html/* | |
142 | %endif |