35 lines
1.5 KiB
Ruby
35 lines
1.5 KiB
Ruby
class Lynis < Formula
|
|
desc "Security and system auditing tool to harden systems"
|
|
homepage "https://cisofy.com/lynis/"
|
|
url "https://cisofy.com/files/lynis-2.6.3.tar.gz"
|
|
sha256 "df75f39abdbcf921d949dc9b8b1348fefb2ccca27bda9089a702312b0a7c3f31"
|
|
|
|
bottle do
|
|
sha256 "9f1cc0d41b264d0427f9fd1f52e57f57086809e4fb720594e96033ad33705391" => :high_sierra
|
|
sha256 "9f1cc0d41b264d0427f9fd1f52e57f57086809e4fb720594e96033ad33705391" => :sierra
|
|
sha256 "9f1cc0d41b264d0427f9fd1f52e57f57086809e4fb720594e96033ad33705391" => :el_capitan
|
|
end
|
|
|
|
def install
|
|
inreplace "lynis" do |s|
|
|
s.gsub! 'tINCLUDE_TARGETS="/usr/local/include/lynis /usr/local/lynis/include /usr/share/lynis/include ./include"',
|
|
%Q(tINCLUDE_TARGETS="#{include}")
|
|
s.gsub! 'tPLUGIN_TARGETS="/usr/local/lynis/plugins /usr/local/share/lynis/plugins /usr/share/lynis/plugins /etc/lynis/plugins ./plugins"',
|
|
%Q(tPLUGIN_TARGETS="#{prefix}/plugins")
|
|
s.gsub! 'tDB_TARGETS="/usr/local/share/lynis/db /usr/local/lynis/db /usr/share/lynis/db ./db"',
|
|
%Q(tDB_TARGETS="#{prefix}/db")
|
|
end
|
|
inreplace "include/functions" do |s|
|
|
s.gsub! 'tPROFILE_TARGETS="/usr/local/etc/lynis /etc/lynis /usr/local/lynis ."',
|
|
%Q(tPROFILE_TARGETS="#{prefix}")
|
|
end
|
|
|
|
prefix.install "db", "include", "plugins", "default.prf"
|
|
bin.install "lynis"
|
|
man8.install "lynis.8"
|
|
end
|
|
|
|
test do
|
|
assert_match "lynis", shell_output("#{bin}/lynis --invalid 2>&1", 64)
|
|
end
|
|
end
|