File libopenvizsla.spec of Package libopenvizsla

#
# spec file for package libopenvizsla
#
# Copyright (c) 2024 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 https://bugs.opensuse.org/
#


%define sover 3

Name:           libopenvizsla
Version:        0.2.0
Release:        0
Summary:        Open hardware USB sniffer host library
License:        LGPL-3.0-or-later
URL:            https://github.com/matwey/libopenvizsla
Source:         https://github.com/matwey/libopenvizsla/archive/refs/tags/%{version}/%{name}-%{version}.tar.gz
Group:          Hardware/Other
BuildRequires:  check-devel
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  gperf
BuildRequires:  make
BuildRequires:  pkgconfig(libftdi1)
BuildRequires:  pkgconfig(libzip)

%description
Host library for OpenVizsla, an open hardware USB sniffer tool
(http://openvizsla.org). The library provides an interface to configure
sniffing settings and receive the data.

%package -n %{name}%{sover}
Summary:        Open hardware USB sniffer host library
Group:          System/Libraries

%description -n %{name}%{sover}
Host library for OpenVizsla, an open hardware USB sniffer tool
(http://openvizsla.org). The library provides an interface to configure
sniffing settings and receive the data.

%package devel
Summary:        Development libraries and header files for libopenvizsla
Group:          Development/Libraries/C and C++
Requires:       %{name}%{sover} = %{version}

%description devel
This package contains the header files and libraries for building programs
using the libopenvizsla library.

%package -n ovextcap
Summary:        Open hardware USB sniffer WireShark extcap
Group:          Productivity/Networking/Diagnostic
License:        MIT
Requires:       wireshark

%description -n ovextcap
This package contains WireShark extcap binary for OpenVizsla, an open hardware
USB sniffer tool.

%prep
%setup -q

%build
%cmake
%cmake_build

%install
%cmake_install

mkdir -p %{buildroot}%{_libdir}/wireshark/extcap
mv %{buildroot}%{_bindir}/ovextcap %{buildroot}%{_libdir}/wireshark/extcap/ovextcap

%check
%ctest

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

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

%files devel
%license LICENSE
%doc README.md
%{_includedir}/openvizsla
%{_libdir}/libopenvizsla.so
%{_libdir}/pkgconfig/*.pc

%files -n ovextcap
%license LICENSE.ovextcap
%dir %{_libdir}/wireshark
%dir %{_libdir}/wireshark/extcap
%{_libdir}/wireshark/extcap/ovextcap

%changelog
openSUSE Build Service is sponsored by