2010-03-01 13:09:52 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Yaws < Formula
|
|
|
|
homepage 'http://yaws.hyber.org'
|
2013-11-19 14:06:14 +00:00
|
|
|
url 'https://github.com/klacke/yaws/archive/yaws-1.98.tar.gz'
|
|
|
|
sha1 'a4628ef14f13ac33e4ace1b679e600a9fbd2f1ba'
|
2013-10-06 14:50:11 +00:00
|
|
|
head 'https://github.com/klacke/yaws.git'
|
2010-03-01 13:09:52 +00:00
|
|
|
|
2012-08-10 04:35:08 +00:00
|
|
|
option "without-yapp", "Omit yaws applications"
|
|
|
|
option '32-bit'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2012-08-10 04:35:08 +00:00
|
|
|
depends_on 'erlang'
|
2013-10-06 14:50:11 +00:00
|
|
|
depends_on 'autoconf' => :build
|
2010-03-01 13:09:52 +00:00
|
|
|
|
2013-06-09 01:35:09 +00:00
|
|
|
# the default config expects these folders to exist
|
|
|
|
skip_clean 'var/log/yaws'
|
|
|
|
skip_clean 'lib/yaws/examples/ebin'
|
|
|
|
skip_clean 'lib/yaws/examples/include'
|
|
|
|
|
2010-03-01 13:09:52 +00:00
|
|
|
def install
|
2012-08-10 04:35:08 +00:00
|
|
|
if build.build_32_bit?
|
2012-01-01 04:19:57 +00:00
|
|
|
%w{ CFLAGS LDFLAGS }.each do |compiler_flag|
|
2013-08-02 03:40:42 +00:00
|
|
|
ENV.remove compiler_flag, "-arch #{Hardware::CPU.arch_64_bit}"
|
|
|
|
ENV.append compiler_flag, "-arch #{Hardware::CPU.arch_32_bit}"
|
2012-01-01 04:19:57 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-10-06 14:50:11 +00:00
|
|
|
system "autoconf"
|
|
|
|
system "./configure", "--prefix=#{prefix}"
|
|
|
|
system "make install"
|
2010-03-01 13:09:52 +00:00
|
|
|
|
2014-03-06 20:40:26 +00:00
|
|
|
if build.with? "yapp"
|
2013-10-06 14:50:11 +00:00
|
|
|
cd 'applications/yapp' do
|
|
|
|
system "make"
|
|
|
|
system "make install"
|
2010-03-01 13:09:52 +00:00
|
|
|
end
|
|
|
|
end
|
2013-06-09 01:35:09 +00:00
|
|
|
|
|
|
|
# the default config expects these folders to exist
|
|
|
|
(lib/'yaws/examples/ebin').mkpath
|
|
|
|
(lib/'yaws/examples/include').mkpath
|
2013-10-06 14:50:11 +00:00
|
|
|
|
|
|
|
(var/'log/yaws').mkpath
|
|
|
|
(var/'yaws/www').mkpath
|
|
|
|
end
|
|
|
|
|
2014-02-23 21:31:41 +00:00
|
|
|
test do
|
2013-10-06 14:50:11 +00:00
|
|
|
system bin/'yaws', '--version'
|
2010-03-01 13:09:52 +00:00
|
|
|
end
|
2013-10-06 14:50:11 +00:00
|
|
|
|
2010-03-01 13:09:52 +00:00
|
|
|
end
|