From 3895d58748e78f9cd418df06a524bc61e81fed12 Mon Sep 17 00:00:00 2001 From: Justin Hahn Date: Wed, 29 Jun 2011 11:47:52 -0400 Subject: 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 --- Library/Formula/dos2unix.rb | 27 ++++++++++++++++++++------- Library/Formula/unix2dos.rb | 14 -------------- 2 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 Library/Formula/unix2dos.rb (limited to 'Library/Formula') 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 diff --git a/Library/Formula/unix2dos.rb b/Library/Formula/unix2dos.rb deleted file mode 100644 index 0056a09df..000000000 --- a/Library/Formula/unix2dos.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'formula' - -class Unix2dos < Formula - url 'http://trac.macports.org/export/31021/distfiles/unix2dos/unix2dos-2.2.src.tar.gz' - md5 'caf9f33155073d3efd310eff9103170b' - homepage 'http://en.wikipedia.org/wiki/Unix2dos' - - def install - # Don't use the Makefile as it doesn't optimize - system "#{ENV.cc} #{ENV.cflags} unix2dos.c -o unix2dos" - bin.install "unix2dos" - man1.install "unix2dos.1" - end -end -- cgit v1.2.3