homebrew-core/Formula/noweb.rb
Jack Nagel 7c648d9732 Shore up a number of shell quoting issues
When interpolating in strings passed to Formula#system, it should be
done in such a way that if any interpolated variables contain spaces,
they are either (a) passed as part of a list or (b) protected by quotes
if they are part of a long string (which is subject to shell expansion).
Otherwise, they will be split on the space when expanded by the shell
and passed as multiple arguments to whatever process is being executed.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-15 14:03:11 -05:00

35 lines
1 KiB
Ruby

require 'formula'
class Noweb < Formula
homepage 'http://www.cs.tufts.edu/~nr/noweb/'
url 'ftp://www.eecs.harvard.edu/pub/nr/noweb.tgz'
version '2.11b'
md5 '1df580723497b2f2efde07646abf764c'
depends_on 'icon'
def install
cd "src" do
system "bash", "awkname", "awk"
system "make LIBSRC=icon ICONC=icont CFLAGS='-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=1'"
if which 'kpsewhich'
ohai 'TeX installation found. Installing TeX support files there might fail if your user does not have permission'
texmf = Pathname.new(`kpsewhich -var-value=TEXMFLOCAL`.chomp)
else
ohai 'No TeX installation found. Installing TeX support files in the noweb Cellar.'
texmf = prefix
end
bin.mkpath
lib.mkpath
man.mkpath
(texmf/'tex/generic/noweb').mkpath
system "make", "install", "BIN=#{bin}",
"LIB=#{lib}",
"MAN=#{man}",
"TEXINPUTS=#{texmf}/tex/generic/noweb"
end
end
end