%global pkgvers 1
%global scdate0 20230430
%global schash0 244c6bf4f1cb52a8b4d27240d7a4c88c9542cbbb
%global branch0 master
%global source0 https://github.com/myriadrf/gr-limesdr.git

%global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}}

Name:           gr-limesdr
Version:        3.0.1
Release:        %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist}
Summary:        GNURadio limesdr plugin
License:        Apache

URL:            https://github.com/myriadrf/gr-limesdr

Source1:        77.patch

BuildRequires:  git gcc-c++ cmake pkgconfig doxygen swig
BuildRequires:  python3-devel pybind11-devel gnuradio-devel gmp-devel
BuildRequires:  volk-devel spdlog-devel limesuite-devel boost-devel

%global __cmake_in_source_build 1

%description
Package includes GNU Radio blocks for various LimeSDR boards.

%package        devel
Summary:        Development library of SoapySDR
Requires:       %{name} = %{version}-%{release}

%description    devel
Package includes GNU Radio blocks for various LimeSDR boards.

%package        python3
Summary:        Python bindings for apps which use SoapySDR
Requires:       %{name} = %{version}-%{release}

%description    python3
Package includes GNU Radio blocks for various LimeSDR boards.


%prep
%setup -T -c -n %{name}
git clone --depth 1 -n -b %{branch0} %{source0} .
git fetch --depth 1 origin %{schash0}
git reset --hard %{schash0}
git log --format=fuller
git apply %{SOURCE1}


%build
sed -i 's|MAX_GR_VERSION "3.8.0"|MAX_GR_VERSION "4.0.0"|' CMakeLists.txt
mkdir -p build
pushd build
%cmake .. -Wno-dev \
       -DCMAKE_SKIP_RPATH=ON \
       -DCMAKE_VERBOSE_MAKEFILE=OFF \
       -DCMAKE_BUILD_TYPE=RelWithDebInfo
%make_build
popd


%install
rm -rf %{buildroot}
pushd build
%make_install
popd


%files
%doc README.md
%{_docdir}/%{name}
%{_libdir}/*.so
%{_datadir}/gnuradio/grc/*

%files devel
%{_includedir}/*
%{_libdir}/*.so.*
%{_libdir}/cmake/*

%files python3
%{python3_sitearch}/*


%changelog
* Tue Aug 21 2018 Balint Cristian <cristian.balint@gmail.com>
- github update releases