File dab-cmdline.spec of Package dab-cmdline

#
# spec file for package dab-cmdline
#
# Copyright (c) 2025, 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/
#


Name:           dab-cmdline
Version:        0.8+git20251102
Release:        0
Summary:        Misc DAB commandline programs
License:        GPL-2.0-only
Group:          Productivity/Hamradio/Other
URL:            https://github.com/JvanKatwijk/dab-cmdline
#Git-Clone:     https://github.com/JvanKatwijk/dab-cmdline.git
Source:         %{name}-%{version}.tar.xz
BuildRequires:  gcc-c++
BuildRequires:  cmake
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(faad2)
BuildRequires:  pkgconfig(fftw3f)
BuildRequires:  pkgconfig(portaudio-2.0)
BuildRequires:  pkgconfig(samplerate)
BuildRequires:  pkgconfig(librtlsdr)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(libairspy)

%description
- example 1 is the example where the main program is linked to
  a precompiled shared library, 
  i.e. the DAB library should be pre-installed

- example 2 has the same functionality as example 1, the sources
      of the library are "compiled-in", however.

- example 3 has the same functionality as example 2, and here
  the library sources are "compiled in" as well. However, the
  PCM samples are being sent out to stdout.
  One might use one of the available programs to make the sound
  audible
  dab-example-3 .... | aplay -r 48000 -f S16_LE -t raw -c 2

- example 4 has the sample functionality as examples 2 and 3, and
  here the library sources are "compiled in" as well. However,
  no sound decoding takes place. The MP2 frames (in case of DAB)
  and the AAC frames (in case of DAB+) are just emitted
  into a file or to stdout. A flag "-f XXXX" to the command
  line of this example, if specified, output is written to
  the specified file, otherwise to stdout.
  The output can be processed by e.g. VLC.
  (Note that the AAC frames have 960 rather than 1024 samples,
   not all audio programs are capable of handling these).

- example 5 is a small experimental extension to example 2,
  It contains a simple "keyboard listener", that will react
  on entering a stroke on the return key. It will cause the
  "next" (audio) service to be selected.
  In example 5 there is support for tdc packet handling,
  and - thanks to stefan Juhl - support for FEC protected packets.

- example 6 is an experimental version where stdin is
  used as input device (and the command line parameters are
  adapted to that)

- the python example seems to work, the cmake file now expects
  python3.9 (it should work with other versions as well, adapt the
  CMakeLists.tct file)

- the scanner example is what the name suggests, it scans the band
  and shows the content of the channels that carry (detectable)
  DAB data.

%prep
%autosetup -p1
chmod -x README.md

%build
###############################
# dab-scanner (old and stable)
###############################
mkdir dab-scanner-mybuild

# dab-scanner-rtlsdr
pushd dab-scanner
%cmake \
  -DRTLSDR=ON
%make_jobs
popd

mv dab-scanner/build/dab-scanner-rtlsdr dab-scanner-mybuild/
rm -Rf dab-scanner/build/dab-scanner-rtlsdr

######################################
# scanner (new, based on QT-DAB 6.9.4
######################################
#mkdir scanner-mybuild
#
#pushd scanner
#%%cmake \
#  -DRTLSDR=ON
#%%make_jobs
#popd
#
#find scanner/build/
#mv scanner/build/scanner-rtlsdr scanner-mybuild/
#rm -Rf scanner/build/dab-scanner-rtlsdr


############
# example-2
############
mkdir example-2-mybuild

# dab-rtlsdr-2
pushd example-2
%cmake \
  -DRTLSDR=ON
%make_jobs
popd

mv example-2/build/dab-rtlsdr-2 example-2-mybuild/
rm -Rf example-2/build/dab-rtlsdr-2

%install
# dab-scanner
install -D -m0755 dab-scanner-mybuild/dab-scanner-rtlsdr %{buildroot}/%{_bindir}/dab-scanner-rtlsdr

# example-2
install -D -m0755 example-2-mybuild/dab-rtlsdr-2 %{buildroot}/%{_bindir}/dab-rtlsdr-2

%files
%license LICENSE
%doc README.md
%{_bindir}/dab-scanner-rtlsdr
%{_bindir}/dab-rtlsdr-2

%changelog
openSUSE Build Service is sponsored by