File libcyberradio.spec of Package libcyberradio
#
# spec file for package libcyberradio
#
# Copyright (c) 2022 SUSE LLC
#
# 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 22
Name: libcyberradio
Version: 24.10.14
Release: 0
Summary: Library for CyberRadio applications
License: BSD-1-Clause
Group: Productivity/Hamradio/Other
Url: https://github.com/CyberRadio/libcyberradio
#Git-Clone: https://github.com/CyberRadio/libcyberradio.git
Source: https://github.com/CyberRadio/libcyberradio/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: libcyberradio-add-missing-header.patch
Patch1: libcyberradio-remove-boost_system.patch
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: jsoncpp-devel
BuildRequires: libboost_atomic-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_thread-devel
BuildRequires: libcurl-devel
BuildRequires: libpcap-devel
BuildRequires: volk-devel
%description
The libcyberradio Shared Library is a C++ library that provides core utility
classes for many CyberRadio applications.
%package -n %{name}%{sover}
Summary: Development files for libcyberradio
Group: Development/Libraries/Other
%description -n %{name}%{sover}
The libcyberradio Shared Library is a C++ library that provides core utility
classes for many CyberRadio applications.
%package devel
Summary: Development files for libcyberradio
Group: Development/Libraries/Other
Requires: %{name}%{sover} = %{version}
%description devel
The libcyberradio Shared Library is a C++ library that provides core utility
classes for many CyberRadio applications.
%package doc
Summary: Documentation for libcyberradio
Group: Development/Libraries/Other
Requires: %{name}%{sover} = %{version}
BuildArch: noarch
%description doc
The libcyberradio Shared Library is a C++ library that provides core utility
classes for many CyberRadio applications.
%package -n cyberradio-examples
Summary: Examples for Cyberradio
Group: Productivity/Hamradio/Other
Requires: %{name}%{sover} = %{version}
%description -n cyberradio-examples
Examples for using libcyberradio library that provides core utility
classes for many CyberRadio applications.
%prep
%setup -q
%patch -P 0 -p1
%if 0%{?suse_version} > 1620
%patch -P 1 -p1
%endif
sed -i 's|^HTML_TIMESTAMP = YES|HTML_TIMESTAMP = NO|' libcyberradio/libcyberradio.doxyfile
%build
cd %{name}
%cmake
%cmake_build
%install
cd %{name}
%cmake_install
%fdupes %{buildroot}
#move docs to proper location
mkdir -p %{buildroot}%{_docdir}
mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}
#move binary example files to binary location
mkdir -p %{buildroot}%{_bindir}
mv %{buildroot}/%{_datadir}/%{name}/examples/NDR358Example %{buildroot}%{_bindir}
mv %{buildroot}/%{_datadir}/%{name}/examples/NDR551Example %{buildroot}%{_bindir}
mv %{buildroot}/%{_datadir}/%{name}/examples/TXClientDriver %{buildroot}%{_bindir}
mv %{buildroot}/%{_datadir}/%{name}/examples/ndr651_driver %{buildroot}%{_bindir}
mv %{buildroot}/%{_datadir}/%{name}/examples/ndr651_tx_test %{buildroot}%{_bindir}
mv %{buildroot}/%{_datadir}/%{name}/examples/testvitaiq %{buildroot}%{_bindir}
%check
%post -n %{name}%{sover} -p /sbin/ldconfig
%postun -n %{name}%{sover} -p /sbin/ldconfig
%files -n %{name}%{sover}
%doc README.md
%{_libdir}/%{name}*.so.*
%{_docdir}/%{name}
%exclude %{_docdir}/%{name}/html
%files devel
%{_includedir}/LibCyberRadio
%{_libdir}/%{name}*.so
%{_libdir}/cmake/%{name}
%{_datadir}/pkgconfig/CyberRadio.pc
%files doc
%{_docdir}/%{name}/html
%files -n cyberradio-examples
%{_datadir}/%{name}
%{_bindir}/*
%changelog