aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/dos2unix.rb
diff options
context:
space:
mode:
authorJustin Hahn2011-06-29 11:47:52 -0400
committerJack Nagel2011-09-08 17:48:38 -0500
commit3895d58748e78f9cd418df06a524bc61e81fed12 (patch)
treeb0404a1f8818cdf779c5e12b8e928bff8b54b680 /Library/Formula/dos2unix.rb
parent9ef83210d1efb89559ef71db9dfedd10cdbaa13d (diff)
downloadhomebrew-3895d58748e78f9cd418df06a524bc61e81fed12.tar.bz2
dos2unix 5.3.1
This change upgrades dos2unix to release 5.3.1, eliminating the now duplicate unix2dos formula. This also introduces optional NLS support for dos2unix through the --enable-nls option. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula/dos2unix.rb')
-rw-r--r--Library/Formula/dos2unix.rb27
1 files changed, 20 insertions, 7 deletions
diff --git a/Library/Formula/dos2unix.rb b/Library/Formula/dos2unix.rb
index 238856cd8..efe6ca898 100644
--- a/Library/Formula/dos2unix.rb
+++ b/Library/Formula/dos2unix.rb
@@ -1,16 +1,29 @@
require 'formula'
class Dos2unix < Formula
- url 'http://sourceforge.net/projects/dos2unix/files/dos2unix/3.2/dos2unix-3.2.tar.gz'
- md5 'db3902feba8a4bae26e9a1bd27c7ce53'
+ url 'http://sourceforge.net/projects/dos2unix/files/dos2unix/5.3.1/dos2unix-5.3.1.tar.gz'
+ md5 '438c48ebd6891b80b58de14c022ca69e'
homepage 'http://dos2unix.sourceforge.net/'
+ depends_on "gettext" if ARGV.include? "--enable-nls"
+
+ def options
+ [["--enable-nls", "Enable NLS support."]]
+ end
+
def install
- # we don't use the Makefile as it doesn't optimize
- system "#{ENV.cc} #{ENV.cflags} dos2unix.c -o dos2unix"
+ args = ["prefix=#{prefix}"]
+
+ if ARGV.include? "--enable-nls"
+ gettext = Formula.factory("gettext")
+ args << "CFLAGS_OS=-I#{gettext.include}"
+ args << "LDFLAGS_EXTRA=-L#{gettext.lib} -lintl"
+ else
+ args << "ENABLE_NLS="
+ end
+
+ args << "install"
- bin.install %w[dos2unix]
- ln_sf bin+'dos2unix', bin+'mac2unix'
- man1.install %w[mac2unix.1 dos2unix.1]
+ system "make", *args
end
end