aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorZac Stewart2012-07-31 16:29:58 -0400
committerAdam Vandenberg2012-09-04 19:39:00 -0700
commit9e7c115bb77d39e06348357d424861042613da23 (patch)
treea207be66c83f14e503a2fd7dfc51e076036ce030 /Library/Formula
parentf79538a566af9ecab487837b7879cf28d43ce983 (diff)
downloadhomebrew-9e7c115bb77d39e06348357d424861042613da23.tar.bz2
Mallet 2.0.7
This formula installs the MALLET machine learning for language toolkit. It is a Java utility, so the formula basically just deals with copying the libraries and wrapping the scripts. Closes #13825. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/mallet.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/Library/Formula/mallet.rb b/Library/Formula/mallet.rb
new file mode 100644
index 000000000..77dee9f6b
--- /dev/null
+++ b/Library/Formula/mallet.rb
@@ -0,0 +1,28 @@
+require 'formula'
+
+class Mallet < Formula
+ homepage 'http://mallet.cs.umass.edu/'
+ url 'http://mallet.cs.umass.edu/dist/mallet-2.0.7.tar.gz'
+ sha1 '45f6ad87ad7605d9f009be5f47b0bbf2ca47d89e'
+
+ # Creates a wrapper to set the classpath before executing
+ # the utility.
+ def startup_script(name)
+ <<-EOS.undent
+ #!/bin/sh
+ CLASSPATH=$CLASSPATH:#{libexec}/class:#{libexec}/lib/mallet-deps.jar "#{libexec}/bin/#{name}" "$@"
+ EOS
+ end
+
+ def install
+ rm Dir['bin/*.{bat,dll,exe}'] # Remove all windows files
+ prefix.install 'LICENSE'
+ libexec.install Dir['*']
+ cd libexec+'bin' do
+ Dir['*'].each do |file|
+ fn = File.basename(file)
+ (bin+fn).write startup_script(fn)
+ end
+ end
+ end
+end