homebrew-core/Formula/mad.rb
Jack Nagel 9a39338aca Fix some issues with generated pc files
- Use #opt_prefix instead of #prefix or HOMEBREW_PREFIX
 - Use #version rather than hardcoded strings or @version
 - Unify pc file method naming
 - Use String#undent

Closes Homebrew/homebrew#18695.
2013-03-24 21:12:30 -05:00

30 lines
842 B
Ruby

require 'formula'
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'
sha1 'cac19cd00e1a907f3150cc040ccc077783496d76'
def install
fpm = MacOS.prefer_64_bit? ? '64bit': 'intel'
system "./configure", "--disable-debugging", "--enable-fpm=#{fpm}", "--prefix=#{prefix}"
system "make", "CFLAGS=#{ENV.cflags}", "LDFLAGS=#{ENV.ldflags}", "install"
(lib+'pkgconfig/mad.pc').write pc_file
end
def pc_file; <<-EOS.undent
prefix=#{opt_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
end