osquery-1/tools/provision/formula/lz4.rb

32 lines
1.1 KiB
Ruby

require File.expand_path("../Abstract/abstract-osquery-formula", __FILE__)
class Lz4 < AbstractOsqueryFormula
desc "Lossless compression algorithm"
homepage "http://www.lz4.info/"
url "https://github.com/Cyan4973/lz4/archive/r131.tar.gz"
version "r131"
sha256 "9d4d00614d6b9dec3114b33d1224b6262b99ace24434c53487a0c8fd0b18cfed"
head "https://github.com/Cyan4973/lz4.git"
bottle do
root_url "https://osquery-packages.s3.amazonaws.com/bottles"
cellar :any_skip_relocation
sha256 "893b7bd9c8e2c6bc7b3f7f6e8833cbf26a027ee750ad7970ed0b932272a05c45" => :sierra
sha256 "3e76610faa04e0ba81a8b58de3421be77f7e226db6d78bab88eac0df82a947bf" => :el_capitan
sha256 "684e6c315fa4a4ada277771559f5504c57363d5192c9252bffc6085dee9e04ec" => :x86_64_linux
end
def install
system "make", "install", "PREFIX=#{prefix}"
end
test do
input = "testing compression and decompression"
input_file = testpath/"in"
input_file.write input
output_file = testpath/"out"
system "sh", "-c", "cat #{input_file} | #{bin}/lz4 | #{bin}/lz4 -d > #{output_file}"
assert_equal output_file.read, input
end
end