brew-audit - check inreplace block var name

This commit is contained in:
Adam Vandenberg 2010-09-08 09:07:59 -07:00
parent 204d3c8505
commit b732e6c299
6 changed files with 33 additions and 36 deletions

View file

@ -6,9 +6,9 @@ class Avanor <Formula
md5 '20067962b9635b1789933ddd7933d142'
def install
inreplace 'Makefile' do |contents|
contents.gsub! "CC = gpp", "CC = cpp"
contents.gsub! "LD = gpp", "LD = cpp"
inreplace 'Makefile' do |s|
s.gsub! "CC = gpp", "CC = cpp"
s.gsub! "LD = gpp", "LD = cpp"
end
system "make DATA_DIR=#{share}/avanor/"

View file

@ -12,15 +12,15 @@ class Fortune <Formula
def install
ENV.deparallelize
inreplace 'Makefile' do |contents|
contents.change_make_var! 'FORTDIR', "/usr/local/bin" # indeed, correct
contents.gsub! '/usr/local/man', '/usr/local/share/man'
contents.gsub! '/usr/local', prefix
contents.change_make_var! 'CC', ENV.cc
inreplace 'Makefile' do |s|
s.change_make_var! 'FORTDIR', "/usr/local/bin" # indeed, correct
s.gsub! '/usr/local/man', '/usr/local/share/man'
s.gsub! '/usr/local', prefix
s.change_make_var! 'CC', ENV.cc
# OS X only supports POSIX regexes
contents.change_make_var! 'REGEXDEFS', '-DHAVE_REGEX_H -DPOSIX_REGEX'
s.change_make_var! 'REGEXDEFS', '-DHAVE_REGEX_H -DPOSIX_REGEX'
# Don't install offensive fortunes
contents.change_make_var! 'OFFENSIVE', '0' if ARGV.include? '--no-offensive'
s.change_make_var! 'OFFENSIVE', '0' if ARGV.include? '--no-offensive'
end
system "make install"

View file

@ -9,26 +9,26 @@ class Pbrt <Formula
depends_on 'ilmbase'
def install
# Configure the Makefile
inreplace 'src/Makefile' do |contents|
openexr = Formula.factory('openexr')
libtiff = Formula.factory('libtiff')
ilmbase = Formula.factory('ilmbase')
openexr = Formula.factory('openexr')
libtiff = Formula.factory('libtiff')
ilmbase = Formula.factory('ilmbase')
# Configure the Makefile
inreplace 'src/Makefile' do |s|
# Enable Tiff support
contents.change_make_var! "HAVE_LIBTIFF", "1"
s.change_make_var! "HAVE_LIBTIFF", "1"
# Set LibTiff path
contents.change_make_var! "TIFF_INCLUDES", "-I#{libtiff.include}"
contents.change_make_var! "TIFF_LIBDIR", "-L#{libtiff.lib}"
s.change_make_var! "TIFF_INCLUDES", "-I#{libtiff.include}"
s.change_make_var! "TIFF_LIBDIR", "-L#{libtiff.lib}"
# Set OpenEXR path
contents.change_make_var! "EXR_INCLUDES", "-I#{openexr.include}/OpenEXR -I#{ilmbase.include}/OpenEXR"
contents.change_make_var! "EXR_LIBDIR", "-L#{openexr.lib} -L#{ilmbase.lib}"
s.change_make_var! "EXR_INCLUDES", "-I#{openexr.include}/OpenEXR -I#{ilmbase.include}/OpenEXR"
s.change_make_var! "EXR_LIBDIR", "-L#{openexr.lib} -L#{ilmbase.lib}"
# Change settings if we are using a 32bit system
if MACOS_VERSION <= 10.5 or Hardware.is_32_bit?
contents.change_make_var! "MARCH", "-m32 -msse2 -mfpmath=sse"
if MACOS_VERSION < 10.6 or Hardware.is_32_bit?
s.change_make_var! "MARCH", "-m32 -msse2 -mfpmath=sse"
end
end

View file

@ -26,10 +26,10 @@ class Rabbitmq <Formula
(var+'log/rabbitmq').mkpath
%w{rabbitmq-server rabbitmq-multi rabbitmqctl rabbitmq-env}.each do |script|
inreplace sbin+script do |contents|
contents.gsub! '/etc/rabbitmq', "#{etc}/rabbitmq"
contents.gsub! '/var/lib/rabbitmq', "#{var}/lib/rabbitmq"
contents.gsub! '/var/log/rabbitmq', "#{var}/log/rabbitmq"
inreplace sbin+script do |s|
s.gsub! '/etc/rabbitmq', "#{etc}/rabbitmq"
s.gsub! '/var/lib/rabbitmq', "#{var}/lib/rabbitmq"
s.gsub! '/var/log/rabbitmq', "#{var}/log/rabbitmq"
end
end

View file

@ -9,11 +9,10 @@ class Ssss <Formula
depends_on 'xmltoman'
def install
inreplace 'Makefile' do |contents|
inreplace 'Makefile' do |s|
# Compile with -DNOMLOCK to avoid warning on every run on OS X.
contents.gsub! /\-W/, '-W -DNOMLOCK $(CFLAGS) $(LDFLAGS)'
contents.change_make_var! "CC", ENV.cc
s.gsub! /\-W/, '-W -DNOMLOCK $(CFLAGS) $(LDFLAGS)'
s.change_make_var! "CC", ENV.cc
end
ENV.append 'CFLAGS', "-I#{HOMEBREW_PREFIX}/include"
@ -22,6 +21,4 @@ class Ssss <Formula
man1.install %w{ ssss.1 }
bin.install %w{ ssss-combine ssss-split }
end
end
end

View file

@ -11,11 +11,11 @@ class Tmux <Formula
ENV['PREFIX'] = prefix
system "./configure"
inreplace "GNUmakefile" do |f|
inreplace "GNUmakefile" do |s|
# Fix 'install' flags
f.gsub! " -g bin -o root", ""
s.gsub! " -g bin -o root", ""
# Put docs in the right place
f.gsub! "man/man1", "share/man/man1"
s.gsub! "man/man1", "share/man/man1"
end
system "make install"