aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/nikto.rb
blob: 463e5e7c30ec0350d6bc14277fdf1d0ee77d5248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Nikto < Formula
  homepage "http://cirt.net/nikto2"
  url "https://www.cirt.net/nikto/nikto-2.1.5.tar.bz2"
  sha1 "9fafa51f630ce241aff58b217882e514d577939f"

  def install
    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"
    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
  end

  def post_install
    system "#{bin}/nikto", "-update"
  end
end