homebrew-core/Formula/dos2unix.rb

35 lines
1,003 B
Ruby
Raw Normal View History

require 'formula'
2009-06-08 15:00:25 +00:00
2011-03-10 05:11:03 +00:00
class Dos2unix < Formula
homepage 'http://waterlan.home.xs4all.nl/dos2unix.html'
url 'http://waterlan.home.xs4all.nl/dos2unix/dos2unix-6.0.4.tar.gz'
sha1 '93d73148c09908a42dcbf5339312c9aa1f18ba7c'
2009-06-08 15:00:25 +00:00
depends_on 'gettext'
devel do
url 'http://waterlan.home.xs4all.nl/dos2unix/dos2unix-6.0.5-beta1.tar.gz'
sha1 'bc00e0eb920c1aa02f7c99ccb355837ecce31b03'
end
2009-06-08 15:00:25 +00:00
def install
gettext = Formula.factory("gettext")
system "make", "prefix=#{prefix}",
"CC=#{ENV.cc}",
"CPP=#{ENV.cc}",
"CFLAGS=#{ENV.cflags}",
"CFLAGS_OS=-I#{gettext.include}",
"LDFLAGS_EXTRA=-L#{gettext.lib} -lintl",
"install"
2009-06-08 15:00:25 +00:00
end
test do
(testpath/'dosfile.txt').write("File with CRLFs\r\nThey will be converted")
system "#{bin}/dos2unix", 'dosfile.txt'
open('dosfile.txt') do |f|
converted = f.read(64)
fail if converted.include?("\r")
end
end
2009-06-08 15:00:25 +00:00
end