File gr-m17-openSUSE_Tumbleweed.spec of Package gr-m17

#
# spec file for package gr-m17
#
# Copyright (c) 2025 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 libname libgnuradio-m17
%define sover 1_0_0
%define examplesdir %{_libdir}/gnuradio/examples

Name:           gr-m17
Version:        1.0.0git20250818
Release:        1.0.0
Summary:        GNU Radio M17 protocol implementation
License:        GPL-2.0
URL:            https://github.com/M17-Project/gr-m17
Group:          Productivity/Hamradio/Other
#Git-Clone:     https://github.com/M17-Project/gr-m17.git
Source:         %{name}-%{version}.tar.gz
#Git-Clone:     https://github.com/M17-Project/M17_Implementations.git
Source2:        M17_Implementations-git20240709.tar.gz
#Git-Clone:     https://github.com/M17-Project/libm17.git
Source3:        libm17-0.1git20250612.tar.gz
#Git-Clone:     https://github.com/kmackay/micro-ecc.git
Source4:        micro-ecc-1.1git20241114.tar.gz
#Git-Clone:     https://github.com/lwvmobile/tinier-aes.git
Source5:        tinier-aes-20250115.tar.gz
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gnuradio-devel >= 3.9.0.0
BuildRequires:  gnuradio-examples
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_test-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  python3-devel
BuildRequires:  python3-numpy-devel
BuildRequires:  python3-pybind11-devel

%description
GNU Radio M17 protocol implementation. M17 is an RF protocol that is:
- Completely open: open specification, open source code, open source hardware,
  open algorithms. Anyone must be able to build an M17 radio and interoperate
  with other M17 radios without having to pay anyone else for the right to do so.
- Optimized for amateur radio use.
- Simple to understand and implement.

%package -n %{libname}%{sover}
Summary:        GNU Radio M17 protocol implementation
Group:          System/Libraries

%description -n %{libname}%{sover}
GNU Radio M17 protocol implementation. M17 is an RF protocol that is:
- Completely open: open specification, open source code, open source hardware,
  open algorithms. Anyone must be able to build an M17 radio and interoperate
  with other M17 radios without having to pay anyone else for the right to do so.
- Optimized for amateur radio use.
- Simple to understand and implement.


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

%description -n %{libname}-devel
Library headers for gr-m17.

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

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

%package examples
Summary:        Examples for gr-m17
Group:          Productivity/Hamradio/Other
Requires:       %{name}
Requires:       gnuradio-examples

%description examples
Example flowgraphs for gr-m17 module for GNU Radio.


%prep
%setup -q -n %{name} -a 2 -a 3 -a 4 -a 5


%build
%cmake -DENABLE_DOXYGEN=1
%cmake_build


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

#install examples
install -m 644 -D examples/*.grc -t %{buildroot}%{examplesdir}/m17

#move docs
mkdir -p %{buildroot}%{_docdir}
mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}


%check


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


%files
%license LICENSE
%doc MANIFEST.md README.md
%{python3_sitearch}/gnuradio/m17
%{_datadir}/gnuradio/grc/blocks/*.?ml
%exclude %{_docdir}/%{name}/html
%exclude %{_docdir}/%{name}/xml

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

%files -n %{libname}-devel
%{_libdir}/%{libname}.so
%{_includedir}/gnuradio/m17
%{_libdir}/cmake/gnuradio-m17

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

%files examples
%{examplesdir}/m17


%changelog
openSUSE Build Service is sponsored by