File gr-fcdproplus.spec of Package gr-fcdproplus

#
# spec file for package gr-fcdproplus
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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-fcdproplus
%define ver 3.8.0.0git20200811
%define sover 3_8_0
%define is_release 0

Name:           gr-fcdproplus
Version:        %{ver}
Release:        0
Summary:        Fcdproplus Linux addon for gnuradio
License:        GPL-3.0-only
Group:          Productivity/Hamradio/Other
URL:            https://github.com/dl1ksv/gr-fcdproplus
#Git-Clone:     https://github.com/dl1ksv/gr-fcdproplus.git
Source:         %{name}-%{version}.tar.gz
Source1:        gr-fcdproplus.rules
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gnuradio-devel
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  libboost_atomic-devel
BuildRequires:  libboost_date_time-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:  libhidapi-devel
BuildRequires:  orc
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(python2)
BuildRequires:  pkgconfig(jack)
BuildRequires:  portaudio-devel
BuildRequires:  python3-devel
Buildrequires:  python3-six
BuildRequires:  swig

%description
gr-fcdproplus is a Linux addon for gnuradio to implement a FUNcube Dongle
Pro+ source. It autodetects the correct soundcard from /proc/asound/cards.
This idea was taken from the osmosdr drivers.
To control the device, the hidraw code of the HID API is used.

%package -n %{libname}%{sover}
Summary:        Fcdproplus Linux addon for gnuradio
Group:          System/Libraries
Requires:       fcdproplus-udev

%description -n %{libname}%{sover}
gr-fcdproplus is a Linux addon for gnuradio to implement a FUNcube Dongle
Pro+ source. It autodetects the correct soundcard from /proc/asound/cards.
This idea was taken from the osmosdr drivers.
To control the device, the hidraw code of the HID API is used.

%package -n %{libname}-devel
Summary:        Development files for the fcdproplus gnuradio Linux addon
Group:          Development/Libraries/Other
Requires:       %{libname}%{sover} = %{version}

%description -n %{libname}-devel
gr-fcdproplus is a Linux addon for gnuradio to implement a FUNcube Dongle
Pro+ source. It autodetects the correct soundcard from /proc/asound/cards.
This idea was taken from the osmosdr drivers.
To control the device, the hidraw code of the HID API is used.

%package -n python-gr-fcdproplus
Summary:        Python bindings for gr-fcdproplus
Group:          Development/Libraries/Other
Requires:       %{libname}%{sover} = %{version}

%description -n python-gr-fcdproplus
gr-fcdproplus is a Linux addon for gnuradio to implement a FUNcube Dongle
Pro+ source. It autodetects the correct soundcard from /proc/asound/cards.
This idea was taken from the osmosdr drivers.
To control the device, the hidraw code of the HID API is used.

%package -n fcdproplus-udev
Summary:        Udev rules for funcube dongle pro+ devices
Group:          Hardware/Other
Requires(pre):  pwdutils
BuildArch:      noarch

%description -n fcdproplus-udev
Udev rules for funcube dongle pro+ devices.

%package doc
Summary:        Documentation for gnuradio-osmosdr
Group:          Documentation/Other
Requires:       %{libname}%{sover} = %{version}
BuildArch:      noarch

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

%prep
%if 0%{is_release}
%setup -q
%else
%setup -q -n %{name}
%endif


%build
%cmake \
    -DENABLE_DOXYGEN=1 \
    -DCMAKE_SHARED_LINKER_FLAGS=""
%cmake_build


%install
%cmake_install
%fdupes %{buildroot}/%{_prefix}

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

install -Dm 0644 "%{SOURCE1}" %{buildroot}%{_udevrulesdir}/10-gr-fcdproplus.rules

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

%post -n fcdproplus-udev
%udev_rules_update

%postun -n fcdproplus-udev
%udev_rules_update

%files
%license COPYING
%doc README*
%{_datadir}/gnuradio/grc/blocks/*.?ml
%exclude %{_docdir}/%{name}/html
%exclude %{_docdir}/%{name}/xml

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

%files -n %{libname}-devel
%{_includedir}/fcdproplus
%{_libdir}/libgnuradio-fcdproplus*.so
%{_libdir}/pkgconfig/gnuradio-fcdproplus.pc
%{_libdir}/cmake/gr-fcdproplus

%files -n python-gr-fcdproplus
%{python3_sitearch}/fcdproplus

%files -n fcdproplus-udev
%{_udevrulesdir}/10-gr-fcdproplus.rules

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

%changelog
openSUSE Build Service is sponsored by