homebrew-core/Formula/lynis.rb
2019-03-18 12:04:22 +01:00

36 lines
1.3 KiB
Ruby

class Lynis < Formula
desc "Security and system auditing tool to harden systems"
homepage "https://cisofy.com/lynis/"
url "https://downloads.cisofy.com/lynis/lynis-2.7.2.tar.gz"
sha256 "fde6ccf8d6ec0ae1e9c9f4a6d640cddcde4bf7a92f8437d47d16a5477e21bfda"
bottle :unneeded
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