homebrew-core/Formula/lynis.rb
2017-07-10 22:50:47 -07:00

36 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.5.2.tar.gz"
sha256 "6b4dc74ec0faa009fc5d34f8ab85895e53c6f4f02bc160377905dcb95b0585a1"
bottle do
cellar :any_skip_relocation
sha256 "191aaa47304a649d973607526ed626d5018ce23a3ff40a57a7cd752f58788b3f" => :sierra
sha256 "2090c33d07ed3a1c86e66420f3a1cd6ef9fce5173d9809bf8144080fabc802f6" => :el_capitan
sha256 "2090c33d07ed3a1c86e66420f3a1cd6ef9fce5173d9809bf8144080fabc802f6" => :yosemite
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