-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxz-beta.rb
34 lines (27 loc) · 926 Bytes
/
xz-beta.rb
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
29
30
31
32
33
34
require "formula"
class XzBeta < Formula
homepage "http://tukaani.org/xz/"
url "http://tukaani.org/xz/xz-5.1.4beta.tar.gz"
sha256 "7c47b9e2cfb5be93245d9fcf2bec5b459412b7628c333896dded373dcd0cf0e0"
conflicts_with 'xz', :because => 'both install xz binaries'
option :universal
def install
ENV.universal_binary if build.universal?
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
path = testpath/"data.txt"
original_contents = "." * 1000
path.write original_contents
# compress: data.txt -> data.txt.xz
system bin/"xz", path
assert !path.exist?
# decompress: data.txt.xz -> data.txt
system bin/"xz", "-d", "#{path}.xz"
assert_equal original_contents, path.read
end
end