File spectools.spec of Package spectools

#
# spec file for package spectools
#
# Copyright (c) 2017, 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/
#


%define spectools_group wispy
Name:           spectools
Version:        0.0.0+git.20160315
Release:        0
Summary:        Spectrum Analyzer for Meta-Geek Wi-Spy and GSG Ubertooth hardware
License:        GPL-2.0
Group:          Productivity/Hamradio/Other
Url:            https://www.kismetwireless.net/spectools/
#Git-Clone:     https://www.kismetwireless.net/spectools.git
Source:         %{name}-%{version}.tar.xz
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  ncurses-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libusb)
BuildRequires:  pkgconfig(udev)
Requires(pre):  shadow
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A set of utilities for using various spectrum analyzer hardware. It supports
the suite of Wi-Spy devices (original, 24x, 24x2, DBX, DBX2, 900, 24i)
by Metageek LLC and the Ubertooth.
Spectools includes userspace drivers for the hardware itself, a graphing UI
built GTK and Cairo, network protocols for remote device capture, and simple
utilities for developing additional tools.

%prep
%setup -q
# HACK: set udev group to airspy
sed -i 's|GROUP="plugdev"|GROUP="wispy"|g' 99-wispy.rules

%build
export CFLAGS='%{optflags} -Wno-return-type'
%configure
make %{?_smp_mflags}

%install
%make_install
install -Dm644 99-wispy.rules %{buildroot}/%{_udevrulesdir}/99-wispy.rules

%pre
%{_sbindir}/groupadd -r %{spectools_group} 2> /dev/null || :

%post
%udev_rules_update

%postun
%udev_rules_update

%files
%defattr(-,root,root)
%doc GPL README
%{_bindir}/spectool_*
%{_udevrulesdir}/99-wispy.rules

%changelog
openSUSE Build Service is sponsored by