aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/yaws.rb
blob: 8c3de1e52cc6e232c464721cced1ad85423fa26b (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
require 'formula'

class Yaws < Formula
  homepage 'http://yaws.hyber.org'
  url 'http://yaws.hyber.org/download/yaws-1.94.tar.gz'
  sha1 '36295e40bb4db1812901c31d41152f942a63b5cc'

  option "without-yapp", "Omit yaws applications"
  option '32-bit'

  depends_on 'erlang'

  def install
    if build.build_32_bit?
      %w{ CFLAGS LDFLAGS }.each do |compiler_flag|
        ENV.remove compiler_flag, "-arch x86_64"
        ENV.append compiler_flag, "-arch i386"
      end
    end

    cd 'yaws' do
      system "./configure", "--prefix=#{prefix}"
      system "make install"

      unless build.include? 'without-yapp'
        cd 'applications/yapp' do
          system "make"
          system "make install"
        end
      end
    end
  end
end