31b266b
%{?mingw_package_header}
31b266b
31b266b
%global nativename hidapi
d82cd24
%global commit d17db57b9d4354752e0af42f5f33007a42ef2906
31b266b
%global shortcommit %(c=%{commit}; echo ${c:0:7})
31b266b
31b266b
Name:           mingw-%{nativename}
d82cd24
Version:        0.8.0
f2f7f81
Release:        0.2.%{shortcommit}%{?dist}
31b266b
Summary:        Library for communicating with USB and Bluetooth HID devices
31b266b
31b266b
Group:          Development/Libraries
31b266b
License:        GPLv3 or BSD
31b266b
URL:            http://www.signal11.us/oss/hidapi/
31b266b
Source0:        https://github.com/signal11/hidapi/archive/%{commit}/%{nativename}-%{version}-%{shortcommit}.tar.gz
31b266b
BuildArch:      noarch
31b266b
31b266b
BuildRequires:  autoconf
31b266b
BuildRequires:  automake
31b266b
BuildRequires:  libtool
31b266b
BuildRequires:  m4
31b266b
BuildRequires:  mingw32-filesystem >= 95
31b266b
BuildRequires:  mingw32-gcc
31b266b
BuildRequires:  mingw32-gcc-c++
31b266b
BuildRequires:  mingw32-binutils
31b266b
31b266b
BuildRequires:  mingw64-filesystem >= 95
31b266b
BuildRequires:  mingw64-gcc
31b266b
BuildRequires:  mingw64-gcc-c++
31b266b
BuildRequires:  mingw64-binutils
31b266b
31b266b
%description
31b266b
HIDAPI is a multi-platform library which allows an application to interface
31b266b
with USB and Bluetooth HID-class devices on Windows, Linux, FreeBSD and Mac OS
31b266b
X.  On Linux, either the hidraw or the libusb back-end can be used. There are
31b266b
trade-offs and the functionality supported is slightly different.
31b266b
31b266b
31b266b
# Win32
31b266b
%package -n mingw32-%{nativename}
31b266b
Summary:        Library for communicating with USB and Bluetooth HID devices
31b266b
31b266b
%description -n mingw32-%{nativename}
31b266b
HIDAPI is a multi-platform library which allows an application to interface
31b266b
with USB and Bluetooth HID-class devices on Windows, Linux, FreeBSD and Mac OS
31b266b
X.  On Linux, either the hidraw or the libusb back-end can be used. There are
31b266b
trade-offs and the functionality supported is slightly different.
31b266b
31b266b
%package -n mingw32-%{nativename}-static
31b266b
Summary:        Static libraries for mingw32-hidapi development
31b266b
Requires:       mingw32-%{nativename} = %{version}-%{release}
31b266b
31b266b
%description -n mingw32-%{nativename}-static
31b266b
The mingw32-hidapi-static package contains static library for mingw32-hidapi
31b266b
development.
31b266b
31b266b
31b266b
# Win64
31b266b
%package -n mingw64-%{nativename}
31b266b
Summary:        Library for communicating with USB and Bluetooth HID devices
31b266b
31b266b
%description -n mingw64-%{nativename}
31b266b
HIDAPI is a multi-platform library which allows an application to interface
31b266b
with USB and Bluetooth HID-class devices on Windows, Linux, FreeBSD and Mac OS
31b266b
X.  On Linux, either the hidraw or the libusb back-end can be used. There are
31b266b
trade-offs and the functionality supported is slightly different.
31b266b
31b266b
%package -n mingw64-%{nativename}-static
31b266b
Summary:        Static libraries for mingw64-hidapi development
31b266b
Requires:       mingw64-%{nativename} = %{version}-%{release}
31b266b
31b266b
%description -n mingw64-%{nativename}-static
31b266b
The mingw64-hidapi-static package contains static library for mingw64-hidapi
31b266b
development.
31b266b
31b266b
31b266b
%{?mingw_debug_package}
31b266b
31b266b
31b266b
%prep
31b266b
%setup -qn %{nativename}-%{commit}
31b266b
31b266b
31b266b
%build
31b266b
autoreconf -vif
31b266b
%mingw_configure --disable-testgui
31b266b
%mingw_make %{?_smp_mflags}
31b266b
31b266b
31b266b
%install
31b266b
%mingw_make_install DESTDIR=%{buildroot}
31b266b
31b266b
# Remove files we don't need
31b266b
find %{buildroot} -name "*.la" -delete
31b266b
rm -r %{buildroot}%{mingw32_datadir}/*
31b266b
rm -r %{buildroot}%{mingw64_datadir}/*
31b266b
31b266b
31b266b
%files -n mingw32-%{nativename}
31b266b
%doc AUTHORS.txt README.txt LICENSE*.txt
31b266b
%{mingw32_bindir}/libhidapi-0.dll
31b266b
%{mingw32_libdir}/libhidapi.dll.a
31b266b
%{mingw32_libdir}/pkgconfig/hidapi.pc
31b266b
%{mingw32_includedir}/hidapi
31b266b
31b266b
%files -n mingw32-%{nativename}-static
31b266b
%{mingw32_libdir}/libhidapi.a
31b266b
31b266b
%files -n mingw64-%{nativename}
31b266b
%doc AUTHORS.txt README.txt LICENSE*.txt
31b266b
%{mingw64_bindir}/libhidapi-0.dll
31b266b
%{mingw64_libdir}/libhidapi.dll.a
31b266b
%{mingw64_libdir}/pkgconfig/hidapi.pc
31b266b
%{mingw64_includedir}/hidapi
31b266b
31b266b
%files -n mingw64-%{nativename}-static
31b266b
%{mingw64_libdir}/libhidapi.a
31b266b
31b266b
31b266b
%changelog
f2f7f81
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-0.2.d17db57
f2f7f81
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f2f7f81
d82cd24
* Tue Sep 01 2015 Scott Talbert <swt@techie.net> - 0.8.0-0.1.d17db57
d82cd24
- Update to latest upstream commit d17db57
d82cd24
- Remove patch as it has been incorporated upstream
d82cd24
b83b7d9
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-5.a88c724
b83b7d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b83b7d9
894af09
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-4.a88c724
894af09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
894af09
f122932
* Thu Mar 20 2014 Scott Talbert <swt@techie.net> - 0.7.0-3.a88c724
f122932
- Add patch for increasing the input report buffer size
f122932
31b266b
* Mon Nov 4 2013 Scott Talbert <swt@techie.net> - 0.7.0-2.a88c724
31b266b
- Incorporate fixes from package review
31b266b
31b266b
* Tue Oct 22 2013 Scott Talbert <swt@techie.net> - 0.7.0-1.a88c724
31b266b
- Initial packaging of mingw-hidapi library