From 39fb1662dd0ae7442e1e35c4c2d15b71c43e0c6b Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Wed, 3 Jan 2018 23:49:56 -0800 Subject: [PATCH] nikto 2.1.6 (#22404) add a test --- Formula/nikto.rb | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/Formula/nikto.rb b/Formula/nikto.rb index 82340c64849..bf6da8fdedd 100644 --- a/Formula/nikto.rb +++ b/Formula/nikto.rb @@ -1,31 +1,39 @@ class Nikto < Formula desc "Web server scanner" homepage "https://cirt.net/nikto2" - url "https://cirt.net/nikto/nikto-2.1.5.tar.bz2" - sha256 "65b99c1fdec14d1d5e7cbc964f70fce162cbec50aee878e1500e2d22df079b34" + url "https://github.com/sullo/nikto/archive/2.1.6.tar.gz" + sha256 "c1731ae4133d3879718bb7605a8d395b2036668505effbcbbcaa4dae4e9f27f2" bottle :unneeded def install - inreplace "nikto.pl", "/etc/nikto.conf", "#{etc}/nikto.conf" + cd "program" do + inreplace "nikto.pl", "/etc/nikto.conf", "#{etc}/nikto.conf" - inreplace "nikto.conf" do |s| - s.gsub! "# EXECDIR=/opt/nikto", "EXECDIR=#{prefix}" - s.gsub! "# PLUGINDIR=/opt/nikto/plugins", "PLUGINDIR=#{prefix}/plugins" - s.gsub! "# DBDIR=/opt/nikto/databases", "DBDIR=#{var}/lib/nikto/databases" - s.gsub! "# TEMPLATEDIR=/opt/nikto/templates", "TEMPLATEDIR=#{prefix}/templates" - s.gsub! "# DOCDIR=/opt/nikto/docs", "DOCDIR=#{prefix}/docs" + inreplace "nikto.conf" do |s| + s.gsub! "# EXECDIR=/opt/nikto", "EXECDIR=#{prefix}" + s.gsub! "# PLUGINDIR=/opt/nikto/plugins", + "PLUGINDIR=#{pkgshare}/plugins" + s.gsub! "# DBDIR=/opt/nikto/databases", + "DBDIR=#{var}/lib/nikto/databases" + s.gsub! "# TEMPLATEDIR=/opt/nikto/templates", + "TEMPLATEDIR=#{pkgshare}/templates" + s.gsub! "# DOCDIR=/opt/nikto/docs", "DOCDIR=#{pkgshare}/docs" + end + + bin.install "nikto.pl" => "nikto" + bin.install "replay.pl" + etc.install "nikto.conf" + man1.install "docs/nikto.1" + pkgshare.install "docs", "plugins", "templates" end - bin.install "nikto.pl" => "nikto" - etc.install "nikto.conf" - man1.install "docs/nikto.1" - share.install "docs" - prefix.install "plugins", "templates" - (var+"lib/nikto/databases").mkpath + doc.install Dir["documentation/*"] + (var/"lib/nikto/databases").mkpath + cp_r Dir["program/databases/*"], var/"lib/nikto/databases" end - def post_install - system "#{bin}/nikto", "-update" + test do + system bin/"nikto", "-H" end end