File mingw32-rtl-sdr.spec of Package mingw32-rtl-sdr

#
# spec file for package mingw32-rtl-sdr
#
# Copyright (c) 2016, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define sover 0
%define realname rtl-sdr
%define libname mingw32-librtlsdr%{sover}
Name:           mingw32-%{realname}
Version:        0.5.4+git.20180603
Release:        0
Summary:        Support programs for RTL2832
License:        GPL-2.0-only
Group:          Productivity/Hamradio/Other
URL:            http://sdr.osmocom.org/trac/wiki/rtl-sdr
Source:         %{realname}-%{version}.tar.xz
### FIXME: disable postbuild-checks ugly workaround for
# E: mingw32-rtl-sdr no-return-in-nonvoid-function /home/abuild/rpmbuild/BUILD/rtl-sdr-0.5.3.git1409081186.d447a2e/src/rtl_tcp.c:246
# -> should be ok since it's a "static void" function
BuildRequires:  -post-build-checks
###
BuildRequires:  cmake
# for git-version-gen
BuildRequires:  git-core
BuildRequires:  mingw32-cross-binutils
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-filesystem >= 35
BuildRequires:  mingw32-libusb-1_0-devel
BuildRequires:  mingw32-winpthreads-devel
BuildArch:      noarch
%{_mingw32_package_header_debug}
%{_mingw32_debug_package}

%description
Programs that controls Realtek RTL2832 based DVB dongle in raw mode, so
it can be used as a SDR receiver.

%package -n %{libname}
Summary:        SDR driver for RTL2832
Group:          Hardware/Other

%description -n %{libname}
Library to run Realtek RTL2832 based DVB dongle as a SDR receiver.

%package devel
Summary:        Development files for rtl-sdr
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
Library headers for rtl-sdr driver.

%prep
%setup -q -n %{realname}-%{version}

%build
%{_mingw32_cmake}
%{_mingw32_make} VERBOSE=1 %{?_smp_mflags}

%install
%{_mingw32_make} DESTDIR=%{buildroot} install
# remove unneeded static version of the lib
rm %{buildroot}/%{_mingw32_libdir}/librtlsdr_static.a

%files
%{_mingw32_bindir}/rtl_*.exe

%files -n %{libname}
%{_mingw32_bindir}/librtlsdr.dll

%files devel
%{_mingw32_libdir}/librtlsdr.dll.a
%{_mingw32_includedir}/rtl-sdr*.h
%{_mingw32_libdir}/pkgconfig/librtlsdr.pc

%changelog