forked from pool/rtl-sdr

121 lines
3.0 KiB

# spec file for package rtl-sdr
# Copyright (c) 2023 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
%define sover 2
%define libname librtlsdr%{sover}
%define rtlsdr_group rtlsdr
Name: rtl-sdr
Version: 2.0.1
Release: 0
Summary: Support programs for RTL2832
License: GPL-2.0-or-later
Group: Productivity/Hamradio/Other
Patch0: 0001-Better-udev-handling.patch
BuildRequires: cmake >= 3.7.2
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(udev)
Programs that controls Realtek RTL2832 based DVB dongle in raw mode, so
it can be used as a SDR receiver.
%package -n %{libname}
Summary: SDR driver for RTL2832
Group: System/Libraries
Requires: %{name}-udev
%description -n %{libname}
Library to run Realtek RTL2832 based DVB dongle as a SDR receiver.
%package udev
Summary: Udev rules for RTL2832
Group: Hardware/Other
Requires(pre): shadow
%description udev
Udev rules for rtl-sdr driver
%package devel
Summary: Development files for rtl-sdr
Group: Development/Libraries/Other
Requires: %{libname} = %{version}
%description devel
Library headers for rtl-sdr driver.
%autosetup -p1 -n librtlsdr-%{version}
%cmake \
-DUDEV_RULES_PATH=%{_udevrulesdir} \
-DUDEV_RULES_GROUP=%{rtlsdr_group} \
rm %{buildroot}%{_libdir}/librtlsdr.a
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%pre udev
getent group %{rtlsdr_group} >/dev/null || groupadd -r %{rtlsdr_group}
%post udev
%postun udev
%license COPYING
%files -n %{libname}
%files udev
%files devel