aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/wget.rb
blob: 1d1e31ffa9e7d2d540d2ed72564a43b5f51a3e84 (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
require 'formula'

class Wget < Formula
  homepage 'http://www.gnu.org/software/wget/'
  url 'http://ftpmirror.gnu.org/wget/wget-1.13.4.tar.bz2'
  mirror 'http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.bz2'
  md5 '12115c3750a4d92f9c6ac62bac372e85'

  head 'git://git.savannah.gnu.org/wget.git'

  depends_on "openssl" if MacOS.leopard?
  depends_on "libidn" if ARGV.include? "--enable-iri"

  if ARGV.build_head?
    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "gettext"
  end

  def options
    [["--enable-iri", "Enable iri support."]]
  end

  def install
    system "./bootstrap" if ARGV.build_head?
    args = ["--disable-debug",
            "--prefix=#{prefix}",
            "--sysconfdir=#{etc}",
            "--with-ssl=openssl"]

    args << "--disable-iri" unless ARGV.include? "--enable-iri"

    system "./configure", *args
    system "make install"
  end

  def test
    system "#{bin}/wget", "-O", "-", "www.google.com"
  end
end