File gr-osmosdr.spec of Package gr-osmosdr
#
# spec file for package gr-osmosdr
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 libname libgnuradio-osmosdr
%define sover 0_2_0
%define with_mirisdr 1
%define with_osmosdr 0
%define with_sdrplay 0
Name: gr-osmosdr
Version: 0.2.3
Release: 0
Summary: Gnuradio Source for OsmoSDR
License: GPL-3.0-or-later
# grc/gen_osmosdr_blocks.py => GPL2.0+
# swig/osmosdr_swig.i => no license specified
Group: Productivity/Hamradio/Other
URL: http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
#Git-Clone: https://git.osmocom.org/gr-osmosdr
Source: %{name}-%{version}.tar.gz
%if 0%{with_sdrplay}
# SDRplay support via libsdrplay2 from
# https://github.com/willcode/gr-osmosdr/tree/sdrplay2
Source1: gr-osmosdr-sdrplay2-support-git20200526.tar.gz
Patch2: gr-osmosdr-add-sdrplay2-support-git20200526-gr38.patch
%endif
Patch3: gr-osmosdr-0001-hackrf-fix-bandwidth-setting.patch
Patch4: gr-osmosdr-0002-xtrx-remove-BOOST_FOREACH-and-obsolete-API-call.patch
Patch5: gr-osmosdr-0003-xtrx-add-missing-libraries.patch
Patch102: gr-osmosdr-0102-Remove-disabled-OsmoSDR-and-MiriSDR-code.patch
Patch103: gr-osmosdr-0103-make-miri-osmosdr-optional.patch
BuildRequires: cmake >= 3.13
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: fftw3-devel
BuildRequires: freesrp-devel
BuildRequires: gcc-c++
BuildRequires: libboost_atomic-devel
BuildRequires: libboost_chrono-devel
BuildRequires: libboost_date_time-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
BuildRequires: libgnuradio-iqbalance-devel
BuildRequires: libosmo-dsp-devel
BuildRequires: orc
BuildRequires: pkgconfig
BuildRequires: pkgconfig(SoapySDR)
%if 0%{?sle_version} >= 150400
BuildRequires: pkgconfig(gnuradio-fcdproplus)
%endif
BuildRequires: pkgconfig(gnuradio-runtime)
BuildRequires: pkgconfig(libairspy)
BuildRequires: pkgconfig(libairspyhf)
BuildRequires: pkgconfig(libbladeRF)
BuildRequires: pkgconfig(libhackrf)
BuildRequires: pkgconfig(librtlsdr)
BuildRequires: pkgconfig(libusb-1.0) >= 1.0.19
BuildRequires: pkgconfig(uhd)
BuildRequires: python3-devel
BuildRequires: python3-six
BuildRequires: swig
BuildRequires: udev
%ifarch i586 x86_64 aarch64 armv7hl
%if 0%{?suse_version} > 1500
BuildRequires: libxtrx-devel
%endif
%endif
%if 0%{with_mirisdr}
BuildRequires: pkgconfig(libmirisdr)
%endif
%if 0%{with_osmosdr}
BuildRequires: osmosdr-devel
%endif
%if 0%{with_sdrplay}
BuildRequires: sdrplay-devel
%endif
Requires: python-gr-osmosdr = %{version}
%description
OsmoSDR Gnuradio Source supports the OsmoSDR hardware, but it also offers a
wrapper functionality for FunCube Dongle, Ettus UHD and rtl-sdr radios.
%package -n %{libname}%{sover}
Summary: Library for gr-osmosdr
Group: System/Libraries
%description -n %{libname}%{sover}
OsmoSDR Gnuradio Source supports the OsmoSDR hardware, but it also offers a
wrapper functionality for FunCube Dongle, Ettus UHD and rtl-sdr radios.
%package -n python-gr-osmosdr
Summary: Python bindings for gr-osmosdr
Group: Development/Libraries/Other
%description -n python-gr-osmosdr
Python Bindings for gr-osmosdr.
OsmoSDR Gnuradio Source supports the OsmoSDR hardware, but it also offers a
wrapper functionality for FunCube Dongle, Ettus UHD and rtl-sdr radios.
%package devel
Summary: Development files for gr-osmosdr
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: %{libname}%{sover} = %{version}-%{release}
Provides: %{libname}%{sover}-devel = %{version}-%{release}
%description devel
Library headers for gr-osmosdr.
OsmoSDR Gnuradio Source supports the OsmoSDR hardware, but it also offers a
wrapper functionality for FunCube Dongle, Ettus UHD and rtl-sdr radios.
%package doc
Summary: Documentation for gnuradio-osmosdr
Group: Documentation/Other
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for gr-osmosdr module for GNU Radio.
%prep
%setup -q
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch102 -p1 -R
%patch103 -p1
%if 0%{with_sdrplay}
tar -xzf %{SOURCE1}
%patch2 -p 1
%endif
%build
%cmake \
%if 0%{with_mirisdr}
-DENABLE_MIRICS=1 \
%endif
%if 0%{with_osmosdr}
-DENABLE_OSMOCOM=1 \
%endif
%if 0%{with_sdrplay}
-DENABLE_NONFREE=1 \
%endif
-DENABLE_DOXYGEN=1 \
-DCMAKE_SHARED_LINKER_FLAGS=""
%cmake_build
%install
%cmake_install
mkdir -p %{buildroot}%{_docdir}
mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}
%fdupes %{buildroot}/%{_prefix}
%post -n %{libname}%{sover} -p /sbin/ldconfig
%postun -n %{libname}%{sover} -p /sbin/ldconfig
%files
%license COPYING
%doc AUTHORS README
%{_bindir}/osmocom_*
%{_datadir}/gnuradio/grc/blocks/*.yml
%exclude %{_docdir}/%{name}/html
%exclude %{_docdir}/%{name}/xml
%files -n python-gr-osmosdr
%{python3_sitearch}/osmosdr
%files -n %{libname}%{sover}
%{_libdir}/%{libname}*.so.*
%files devel
%{_libdir}/%{libname}*.so
%{_includedir}/osmosdr
%{_libdir}/cmake/osmosdr
%files doc
%{_docdir}/%{name}/html
%{_docdir}/%{name}/xml
%changelog