File nikto.spec of Package nikto

#
# spec file for package nikto
#
# Copyright (c) 2023 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/
#


Name:           nikto
Version:        2.5.0
Release:        0
Summary:        Web server scanner
License:        GPL-2.0-only
Group:          Productivity/Networking/Security
URL:            https://cirt.net/Nikto2
Source:         https://github.com/sullo/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE nikto-config.patch -- Make paths FHS compliant
Patch0:         %{name}-config.patch
BuildRequires:  fdupes
Requires:       nmap
Requires:       perl-Net-SSLeay
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Nikto 2.5 is an Open Source (GPL) web server scanner which performs
comprehensive tests against web servers for multiple items, including over
7,000 potentially dangerous files/programs, checks for outdated versions of
over 1250 servers, and version specific problems on over 270 servers. It also
checks for server configuration items such as the presence of multiple index
files, HTTP server options, and will attempt to identify installed web servers
and software. Scan items and plugins are frequently updated and can be
automatically updated.


%prep
%setup -q
%patch0 -p1
sed -i 's,/usr/bin/env perl,/usr/bin/perl,g' program/nikto.pl
sed -i 's,/usr/bin/env perl,/usr/bin/perl,g' program/replay.pl

%build
# Nothing to build.

%install
install -Dm 0755 program/%{name}.pl %{buildroot}%{_bindir}/%{name}
install -Dm 0644 program/%{name}.conf.default %{buildroot}%{_sysconfdir}/%{name}.conf
install -Dm 0644 program/docs/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/
cp -a program/{databases,plugins,templates} %{buildroot}%{_localstatedir}/lib/%{name}/

%files
%defattr(-,root,root)
%doc program/docs/{*.txt,%{name}.dtd,%{name}_manual.html}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config %{_localstatedir}/lib/%{name}/
%{_bindir}/%{name}
%{_mandir}/man?/%{name}.?%{?ext_man}

%changelog
openSUSE Build Service is sponsored by