blob: f4fdf499eea5fd4f2b3c240966f2904b63a332d3 (
plain)
| 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
35
36
37
38
39
40
 | # Upstream project has requested we use a mirror as the main URL
# https://github.com/Homebrew/homebrew/pull/21419
class Xz < Formula
  homepage "http://tukaani.org/xz/"
  url "https://fossies.org/linux/misc/xz-5.2.1.tar.gz"
  mirror "http://tukaani.org/xz/xz-5.2.1.tar.gz"
  sha256 "b918b6648076e74f8d7ae19db5ee663df800049e187259faf5eb997a7b974681"
  bottle do
    cellar :any
    sha1 "fedcee4af6aae52f4ee471fad0071aefa442887b" => :yosemite
    sha1 "42f6a1501db4f6a298ba037bbd50ebfb7aa79d39" => :mavericks
    sha1 "8f9bb2675c7e967e2adc1679cb7190f697689075" => :mountain_lion
  end
  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
 |