homebrew-core/Formula/mad.rb

40 lines
942 B
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Mad < Formula
homepage 'http://www.underbit.com/products/mad/'
url 'http://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz'
md5 '1be543bc30c56fb6bea1d7bf6a64e66c'
def mad_pc
return <<-EOS
prefix=#{HOMEBREW_PREFIX}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: mad
Description: MPEG Audio Decoder
Version: #{@version}
Requires:
Conflicts:
Libs: -L${libdir} -lmad -lm
Cflags: -I${includedir}
EOS
end
def install
2011-03-18 17:30:47 +00:00
fpm = MacOS.prefer_64_bit? ? '64bit': 'intel'
system "./configure", "--disable-debugging", "--enable-fpm=#{fpm}", "--prefix=#{prefix}"
# See: https://github.com/mxcl/homebrew/issues/issue/1263
inreplace "Makefile" do |s|
2010-09-06 18:48:21 +00:00
s.change_make_var! "CFLAGS", ENV.cflags
s.change_make_var! "LDFLAGS", ENV.ldflags
end
system "make install"
2010-06-04 18:56:52 +00:00
(lib+'pkgconfig/mad.pc').write mad_pc
end
end