File gr-hpsdr.spec of Package gr-hpsdr

#
# spec file for package gr-hpsdr
#
# Copyright (c) 2019-2022 Wojciech Kazubski, wk@ire.pw.edu.pl
#
# 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-hpsdr

Name:           gr-hpsdr
Version:        1.2.1
Release:        0
Summary:        OpenHPSDR blocks for GNU Radio
License:        GPL-2.0-or-later
Group:          Productivity/Hamradio/Other
URL:            http://wiki.spench.net/wiki/gr-hpsdr
Source:         https://codeload.github.com/Tom-McDermott/gr-hpsdr/tar.gz/refs/tags/v%{version}#/%{name}-%{version}.tar.gz
Patch0:         %{name}-fix-find-doxygen.patch
BuildRequires:  cmake
BuildRequires:  cppunit-devel
BuildRequires:  fdupes
BuildRequires:  doxygen
BuildRequires:  gcc-c++
BuildRequires:  gnuradio-devel >= 3.7.0
%if 0%{?suse_version} >= 1330
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_system-devel
%else
BuildRequires:  boost-devel
%endif
BuildRequires:  libusb-1_0-devel
BuildRequires:  python2-devel
BuildRequires:  swig

%description
GNU Radio 3.7 modules for OpenHPSDR Hermes / Metis and Red Pitaya using the 
OpenHpsdr protocol.   July 2017


%package -n %{libname}
Summary:        GNU Radio OpenHpsdr module library
Group:          Hardware/Other

%description -n %{libname}
GNU Radio module library fo OpenHpsdr protocol


%package devel
Summary:        Headers for gr-hpsdr
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}-%{release}
Requires:       %{libname} = %{version}-%{release}
AutoReq:        on

%description devel
Library headers for gr-hpsdr.


%package doc
Summary:        Documentation for gr-hpsdr
Group:          Documentation/Other
BuildArch:      noarch
Requires:       %{name}-devel
Provides:       %{name}-devel-doc = %{version}-%{release}
Obsoletes:      %{name}-devel-doc < %{version}-%{release}

%description doc
Documentation for gr-hpsdr module for GNU Radio.


%prep
%setup -q
%patch0 -p 1


%build
%cmake \
    -DENABLE_DOXYGEN=1 \
    -DCMAKE_SHARED_LINKER_FLAGS=""
%cmake_build


%install
%cmake_install

find %{buildroot}%{_libdir}/python*/site-packages/ -name '*.pyo' -exec rm {} \;

#move docs
%if 0%{?suse_version}
mkdir -p %{buildroot}%{_docdir}
mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}
%endif

%fdupes -s %{buildroot}%{_docdir}


%post -n %{libname} -p /sbin/ldconfig
%postun  -n %{libname} -p /sbin/ldconfig


%files
%defattr(-, root, root)
%doc license.txt
%doc README.md MANIFEST.md
%{python_sitearch}/hpsdr
%{_datadir}/gnuradio/grc/blocks/*.?ml
%exclude %{_docdir}/%{name}/html
%exclude %{_docdir}/%{name}/xml

%files -n %{libname}
%defattr(-, root, root)
%{_libdir}/libgnuradio-hpsdr.so

%files devel
%defattr(-, root, root)
%{_includedir}/hpsdr

%files doc
%defattr(-, root, root)
%{_docdir}/%{name}/html
%{_docdir}/%{name}/xml

%changelog
openSUSE Build Service is sponsored by