Added formula for odt2txt tool.

Created a new Homebrew formula for the odt2txt command-line document-to-text conversion tool.  Installs
to a snapshot version with Mac support in the Makefile.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>

* Remove "/opt" paths from Makefile
master
Ryan Barnard 2010-06-23 23:58:01 -04:00 committed by Adam Vandenberg
parent a7a80ccb90
commit f56489cd11
1 changed files with 20 additions and 0 deletions

20
Formula/odt2txt.rb Normal file
View File

@ -0,0 +1,20 @@
require 'formula'
class Odt2txt <Formula
# Retrieve the HEAD because no releases have been made since the commit that
# includes Makefile rules for Mac OS X.
head 'git://repo.or.cz/odt2txt.git'
homepage 'http://stosberg.net/odt2txt/'
def install
inreplace "Makefile" do |s|
# Don't add /opt on OS X
s.gsub! "CFLAGS += -I/opt/local/include", ""
s.gsub! "LDFLAGS += -L/opt/local/lib", ""
end
# Uses a custom makefile instead of autoconf; we set DESTDIR to the prefix value
# Use the -B flag to force make the install target to circumvent bugs in the Makefile
system "make", "-B", "DESTDIR=#{prefix}", "install"
end
end