31b266b
%{?mingw_package_header}
31b266b
31b266b
%global nativename hidapi
31b266b
%global commit a88c7244d632ed238b829968be9b765605b53c34
31b266b
%global shortcommit %(c=%{commit}; echo ${c:0:7})
31b266b
31b266b
Name:           mingw-%{nativename}
31b266b
Version:        0.7.0
31b266b
Release:        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
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