File omphalos.spec of Package omphalos

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

%define omphalos_group omphalos
Name:           omphalos
Version:        0.99.12
Release:        0
Summary:        Network enumeration tool
License:        GPL-3.0-only
Group:          Productivity/Networking/Diagnostic
URL:            https://nick-black.com/dankwiki/index.php/Omphalos
Source:         https://github.com/dankamongmen/omphalos/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         omphalos-libiw.patch
Patch1:         0001-packet_sll_type-don-t-pass-NULL-to-l2categorize.patch
Patch2:         0002-wireless-add-channel-72-5360MHz.patch
Patch3:         0003-ncurses-don-t-set-stdscr-ESCDELAY-36.patch
Patch4:         0004-remove-last-lvalue-use-of-stdscr-36.patch
Patch5:         omphalos-no-setcap.patch
Patch6:         omphalos-no-march-native.patch
Patch7:         omphalos-obey-lflags.patch
BuildRequires:  autoconf
BuildRequires:  autoconf-archive
BuildRequires:  automake
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  fdupes
BuildRequires:  libiw-devel
BuildRequires:  libpcap-devel
BuildRequires:  libxslt-tools
BuildRequires:  man
BuildRequires:  pkgconfig
BuildRequires:  readline-devel
BuildRequires:  sysfsutils-devel
BuildRequires:  pkgconfig(libcap)
BuildRequires:  pkgconfig(libnl-3.0) >= 3.0
BuildRequires:  pkgconfig(libnl-genl-3.0) >= 3.0
BuildRequires:  pkgconfig(notcurses) >= 1.4.3
BuildRequires:  pkgconfig(pciaccess)
BuildRequires:  pkgconfig(zlib)
Requires:       arp-scan
Requires:       pciutils
Requires(pre):  permissions
Requires(pre):  shadow
Provides:       group(omphalos_group)

%description
Omphalos is a tool for visualizing and controlling a local network (though it
will also process pcap savefiles). Captured packets are analyzed to build a
database of hosts and services. Various scans can be performed to elicit
informative packets. Spoofing and redirection at several layers allows flows
to be redirected through the host machine, or silenced. Omphalos is fully IPv6
aware, and makes use of numerous service discovery protocols.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1

%build
export CFLAGS="%{optflags} $(pkg-config --cflags ncursesw) $(pkg-config --libs ncursesw) -fPIE"
export LDFLAGS="-pie"
autoreconf -fiv
%configure \
    --docdir="%{_docdir}/%{name}"
%make_build

%install
%make_install
install -D -m 0644 -t "%{buildroot}%{_datadir}/omphalos" usb.ids ieee-oui.txt
%fdupes %{buildroot}%{_docdir}/%{name}

%pre
getent group %{omphalos_group} >/dev/null || groupadd -r %{omphalos_group}

%verifyscript
%verify_permissions -e %{_bindir}/omphalos-coretest
%verify_permissions -e %{_bindir}/omphalos-ncurses
%verify_permissions -e %{_bindir}/omphalos-tty

%post
%set_permissions %{_bindir}/omphalos-coretest
%set_permissions %{_bindir}/omphalos-ncurses
%set_permissions %{_bindir}/omphalos-tty
exit 0

%check
#export LANG=en_US.UTF-8
#%%make_build test
# !!! no /etc/resolv.conf in OBS chroot !!!

%files
%license COPYING
%doc AUTHORS README.md
%doc %{_docdir}/%{name}
%verify(not mode caps) %attr(0750,root,%{omphalos_group}) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/omphalos-coretest
%verify(not mode caps) %attr(0750,root,%{omphalos_group}) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/omphalos-ncurses
%verify(not mode caps) %attr(0750,root,%{omphalos_group}) %caps(cap_net_raw,cap_net_admin=ep) %{_bindir}/omphalos-tty
%{_mandir}/man1/omphalos-coretest.1%{?ext_man}
%{_mandir}/man1/omphalos-ncurses.1%{?ext_man}
%{_mandir}/man1/omphalos-tty.1%{?ext_man}
%dir %{_datadir}/omphalos
%config(noreplace) %{_datadir}/omphalos/ieee-oui.txt
%config(noreplace) %{_datadir}/omphalos/usb.ids

%changelog
openSUSE Build Service is sponsored by