%{?mingw_package_header}
%global nativename hidapi
%global commit a88c7244d632ed238b829968be9b765605b53c34
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: mingw-%{nativename}
Version: 0.7.0
Release: 2.%{shortcommit}%{?dist}
Summary: Library for communicating with USB and Bluetooth HID devices
Group: Development/Libraries
License: GPLv3 or BSD
URL: http://www.signal11.us/oss/hidapi/
Source0: https://github.com/signal11/hidapi/archive/%{commit}/%{nativename}-%{version}-%{shortcommit}.tar.gz
BuildArch: noarch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: m4
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw32-binutils
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc
BuildRequires: mingw64-gcc-c++
BuildRequires: mingw64-binutils
%description
HIDAPI is a multi-platform library which allows an application to interface
with USB and Bluetooth HID-class devices on Windows, Linux, FreeBSD and Mac OS
X. On Linux, either the hidraw or the libusb back-end can be used. There are
trade-offs and the functionality supported is slightly different.
# Win32
%package -n mingw32-%{nativename}
Summary: Library for communicating with USB and Bluetooth HID devices
%description -n mingw32-%{nativename}
HIDAPI is a multi-platform library which allows an application to interface
with USB and Bluetooth HID-class devices on Windows, Linux, FreeBSD and Mac OS
X. On Linux, either the hidraw or the libusb back-end can be used. There are
trade-offs and the functionality supported is slightly different.
%package -n mingw32-%{nativename}-static
Summary: Static libraries for mingw32-hidapi development
Requires: mingw32-%{nativename} = %{version}-%{release}
%description -n mingw32-%{nativename}-static
The mingw32-hidapi-static package contains static library for mingw32-hidapi
development.
# Win64
%package -n mingw64-%{nativename}
Summary: Library for communicating with USB and Bluetooth HID devices
%description -n mingw64-%{nativename}
HIDAPI is a multi-platform library which allows an application to interface
with USB and Bluetooth HID-class devices on Windows, Linux, FreeBSD and Mac OS
X. On Linux, either the hidraw or the libusb back-end can be used. There are
trade-offs and the functionality supported is slightly different.
%package -n mingw64-%{nativename}-static
Summary: Static libraries for mingw64-hidapi development
Requires: mingw64-%{nativename} = %{version}-%{release}
%description -n mingw64-%{nativename}-static
The mingw64-hidapi-static package contains static library for mingw64-hidapi
development.
%{?mingw_debug_package}
%prep
%setup -qn %{nativename}-%{commit}
%build
autoreconf -vif
%mingw_configure --disable-testgui
%mingw_make %{?_smp_mflags}
%install
%mingw_make_install DESTDIR=%{buildroot}
# Remove files we don't need
find %{buildroot} -name "*.la" -delete
rm -r %{buildroot}%{mingw32_datadir}/*
rm -r %{buildroot}%{mingw64_datadir}/*
%files -n mingw32-%{nativename}
%doc AUTHORS.txt README.txt LICENSE*.txt
%{mingw32_bindir}/libhidapi-0.dll
%{mingw32_libdir}/libhidapi.dll.a
%{mingw32_libdir}/pkgconfig/hidapi.pc
%{mingw32_includedir}/hidapi
%files -n mingw32-%{nativename}-static
%{mingw32_libdir}/libhidapi.a
%files -n mingw64-%{nativename}
%doc AUTHORS.txt README.txt LICENSE*.txt
%{mingw64_bindir}/libhidapi-0.dll
%{mingw64_libdir}/libhidapi.dll.a
%{mingw64_libdir}/pkgconfig/hidapi.pc
%{mingw64_includedir}/hidapi
%files -n mingw64-%{nativename}-static
%{mingw64_libdir}/libhidapi.a
%changelog
* Mon Nov 4 2013 Scott Talbert <swt@techie.net> - 0.7.0-2.a88c724
- Incorporate fixes from package review
* Tue Oct 22 2013 Scott Talbert <swt@techie.net> - 0.7.0-1.a88c724
- Initial packaging of mingw-hidapi library