aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/gnu-getopt.rb
blob: 3d4fc3b62886aec588ab1329d09351505b123d3b (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
class GnuGetopt < Formula
  homepage "http://software.frodo.looijaard.name/getopt/"
  url "http://frodo.looijaard.name/system/files/software/getopt/getopt-1.1.6.tar.gz"
  sha1 "98725b4878d19ab6b126cd16263fed1f6090f6a7"

  bottle do
    sha1 "a9028999ae9bb3e606df3ff6a1b246311b77fae5" => :yosemite
    sha1 "6e8df00f7607127df705d7c1eb6a046e599f7825" => :mavericks
    sha1 "cbd65e8f5e2c613d48dfefdcb801aa0a7ecdc10f" => :mountain_lion
  end

  depends_on "gettext"

  keg_only :provided_by_osx

  def install
    inreplace "Makefile" do |s|
      gettext = Formula["gettext"]
      s.change_make_var! "CPPFLAGS", "\\1 -I#{gettext.include}"
      s.change_make_var! "LDFLAGS", "\\1 -L#{gettext.lib} -lintl"
    end
    system "make", "prefix=#{prefix}", "mandir=#{man}", "install"
  end

  test do
    system "#{bin}/getopt", "-o", "--test"
  end
end