File zmap.spec of Package zmap

#
# spec file for package zmap
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 Georg Pfuetzenreuter
#
# 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/
#

Name:           zmap
Version:        4.3.4
Release:        0
Summary:        Network scanner for Internet-wide network studies
License:        Apache-2.0
Group:          Productivity/Networking/Diagnostic
URL:            https://zmap.io/
Source0:        https://github.com/zmap/zmap/archive/v%{version}.tar.gz
# https://github.com/zmap/zmap/pull/945
Patch0:         0001-Add-dummy-return-to-get_group.patch
BuildRequires:  byacc
BuildRequires:  cmake
BuildRequires:  dos2unix
BuildRequires:  flex
BuildRequires:  gengetopt
# the ones below do not provide pkgconfig
BuildRequires:  judy-devel
BuildRequires:  libunistring-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(json)
BuildRequires:  pkgconfig(libpcap)
%if 0%{?suse_version} < 1600
BuildRequires:  gmp-devel
%else
BuildRequires:  pkgconfig(gmp)
%endif

%description
ZMap is an open-source network scanner that enables researchers to easily
perform Internet-wide network studies. With a single machine and a well
provisioned network up-link, ZMap is capable of performing a complete scan of
the IPv4 address space in under 45 minutes, approaching the theoretical limit
of gigabit Ethernet.

ZMap can be used to study protocol adoption over time, monitor service
availability, and help us better understand large systems distributed across
the Internet.

While ZMap is a powerful tool for researchers, please keep in mind that by
running ZMap, you are potentially scanning the ENTIRE IPv4 address space and
some users may not appreciate your scanning. We encourage ZMap users to respect
requests to stop scanning and to exclude these networks from ongoing scanning.

Developers suggest that users coordinate with local network administrators
before performing any scans and they have developed a set of scanning best
practices [https://zmap.io/documentation.html#bestpractices], which they
encourage researchers to consider. It should go without saying that researchers
should refrain from exploiting vulnerabilities or accessing protected
resources, and should comply with any special legal requirements in their
jurisdictions.

%prep
%autosetup -p1

# no longer contains any code
rm -r examples/forge-socket

# wrong line endings
dos2unix examples/udp-probes/*

%build
%cmake \
  -DENABLE_DEVELOPMENT=OFF -DENABLE_LOG_TRACE=OFF \
%{nil}

%make_build

%install
%make_install -C build

%files
%defattr(0644,root,root,0755)
%license LICENSE
%doc AUTHORS CHANGELOG.md README.md
%doc examples

%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}/blocklist.conf
%attr(0755,-,-) %{_sbindir}/%{name}
%attr(0755,-,-) %{_sbindir}/zblocklist
%attr(0755,-,-) %{_sbindir}/ziterate
%attr(0755,-,-) %{_sbindir}/ztee
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_mandir}/man1/zblocklist.1%{?ext_man}
%{_mandir}/man1/ziterate.1%{?ext_man}
%{_mandir}/man1/ztee.1%{?ext_man}

%changelog
openSUSE Build Service is sponsored by