File gr-fosphor.spec of Package gr-fosphor

#
# spec file for package gr-fosphor
#
# Copyright (c) 2017-2024, 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 soname  3_9_0git
%define libname libgnuradio-fosphor%{soname}

Name:           gr-fosphor
Version:        3.9.0git20240323 
Release:        0
Summary:        GNUradio fosphor block (GPU spectrum display)
License:        GPL-3.0-only
Group:          Productivity/Hamradio/Other
Url:            https://osmocom.org/projects/sdr/wiki/Fosphor
Source:         %{name}-%{version}.tar.gz
Patch0:         fosphor-workaround-build-error.patch
Patch1:         gr-fosphor-disable-gl-sharing.patch
Patch2:         gr-fosphor-boost.patch
BuildRequires:  gcc-c++
BuildRequires:  libboost_atomic-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_regex-devel
%if 0%{?suse_version} <= 1600
BuildRequires:  libboost_system-devel
%endif
BuildRequires:  libboost_test-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  cmake
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5Gui)
BuildRequires:  cmake(Qt5OpenGL)
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gmp-devel
BuildRequires:  opencl-headers
BuildRequires:  pkgconfig
BuildRequires:  python-rpm-macros
BuildRequires:  python3-base
BuildRequires:  python3-devel
BuildRequires:  python3-pybind11-devel
BuildRequires:  python3-numpy-devel
BuildRequires:  pkgconfig(OpenCL)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(glfw3)
BuildRequires:  pkgconfig(gnuradio-runtime)

%description
GNU Radio block for RTSA-like spectrum visualization using OpenCL and OpenGL
acceleration.

%package -n %{libname}
Summary:        Library for gr-fosphor
Group:          Productivity/Hamradio/Other

%description -n %{libname}
Library for gr-fosphor, spectrum visualization using GPU for GNU Radio

%package devel
Summary:        Development files for gr-fosphor
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description devel
Headers for gr-fosphor module for GNURadio

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

%description devel-doc
Documentation for gr-fosphor module for GNU Radio.

%prep
%setup -q -n %{name}
%autopatch -p1

%build
%cmake -DENABLE_DOXYGEN=1
%cmake_build

# test/benchmark-tool
export CFLAGS='%{optflags}'
cd ../lib/fosphor
%make_build

%install
%cmake_install
install -Dpm 0755 ./lib/fosphor/main %{buildroot}/%{_bindir}/gr-fosphor-test

mkdir -p %{buildroot}%{_docdir}/%{name}
mv %{buildroot}/%{_datadir}/doc/%{name}/html %{buildroot}%{_docdir}/%{name}
mv %{buildroot}/%{_datadir}/doc/%{name}/xml %{buildroot}%{_docdir}/%{name}

%fdupes %{buildroot}%{python3_sitearch}

%ldconfig_scriptlets -n %{libname}


%files
%license COPYING
%doc AUTHORS
%{_bindir}/gr-fosphor-test
%{python3_sitearch}/gnuradio/fosphor
%{_datadir}/gnuradio/grc/blocks/fosphor*.yml
%{_datadir}/gnuradio/grc/blocks/overlap_cc.block.yml
%exclude %{_docdir}/%{name}/html
%exclude %{_docdir}/%{name}/xml

%files -n %{libname}
%{_libdir}/libgnuradio-fosphor*.so.*

%files devel
%{_includedir}/gnuradio/fosphor
%{_libdir}/libgnuradio-fosphor*.so
%{_libdir}/cmake/gnuradio/*

%files devel-doc
%{_docdir}/%{name}/html
%{_docdir}/%{name}/xml

%changelog
openSUSE Build Service is sponsored by