File gr-fosphor.spec of Package gr-fosphor

#
# spec file for package gr-fosphor
#
# Copyright (c) 2017, 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  3_8_0git
Name:           gr-fosphor
Version:        3.8.0~git.20180925
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.xz
Patch0:         0001-Resync-cmake-files-with-ones-from-gr_modtool-3.8.0.0.patch
Patch1:         0002-Resync-doxygen-files-with-ones-from-gr_modtool-3.8.0.patch
Patch2:         0003-Resync-swig-files-with-ones-from-gr_modtool-3.8.0.0.patch
BuildRequires:  libboost_atomic-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_system-devel
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:  libmpir-devel
BuildRequires:  opencl-headers
BuildRequires:  orc
BuildRequires:  pkgconfig
BuildRequires:  python-rpm-macros
BuildRequires:  python3-base
BuildRequires:  python3-devel
BuildRequires:  swig
BuildRequires:  pkgconfig(OpenCL)
BuildRequires:  pkgconfig(cppunit)
BuildRequires:  pkgconfig(fftw3f)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glfw3) > 3.0
BuildRequires:  pkgconfig(gnuradio-runtime) >= 3.8.0
BuildRequires:  pkgconfig(log4cpp)

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

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

%description -n libgnuradio-fosphor%{sover}
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
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
%cmake -DENABLE_DOXYGEN=1

%cmake_build

# test/benchmark-tool
export CFLAGS='%{optflags}'
cd ../lib/fosphor
%cmake_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}

%post -n libgnuradio-fosphor%{sover} -p /sbin/ldconfig
%postun -n libgnuradio-fosphor%{sover} -p /sbin/ldconfig

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

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

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

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

%changelog
openSUSE Build Service is sponsored by