Use script helpers

This commit is contained in:
Adam Vandenberg 2012-08-07 11:20:52 -07:00
parent ee3b3ad90b
commit 0806504e0e
45 changed files with 71 additions and 327 deletions

View file

@ -7,20 +7,13 @@ class Activemq < Formula
skip_clean 'libexec/webapps/admin/WEB-INF/jsp'
def startup_script name
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{name}" "$@"
EOS
end
def install
rm_rf Dir['bin/linux-x86-*']
prefix.install %w{ LICENSE NOTICE README.txt }
libexec.install Dir['*']
(bin+'activemq-admin').write startup_script('activemq-admin')
(bin+'activemq').write startup_script('activemq')
bin.write_exec_script libexec/'bin/activemq'
bin.write_exec_script libexec/'bin/activemq-admin'
end
end

View file

@ -5,16 +5,9 @@ class AdobeAirSdk < Formula
url 'http://airdownload.adobe.com/air/mac/download/3.4/AdobeAIRSDK.tbz2'
sha1 '3bc90f619d9f1620187538b6f591675c7d6011d5'
def startup_script name
(bin+name).write <<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{name}" "$@"
EOS
end
def install
libexec.install Dir['*']
startup_script("adl")
startup_script("adt")
bin.write_exec_script libexec/'bin/adl'
bin.write_exec_script libexec/'bin/adt'
end
end

View file

@ -7,9 +7,6 @@ class Antlr < Formula
def install
prefix.install "antlr-3.4-complete.jar"
(bin+"antlr-3.4").write <<-EOS.undent
#!/bin/sh
java -jar #{prefix}/antlr-3.4-complete.jar "$@"
EOS
bin.write_jar_script prefix/"antlr-3.4-complete.jar", "antlr-3.4"
end
end

View file

@ -7,10 +7,7 @@ class Apgdiff < Formula
sha1 '1150d44e9da2c1417767d4106bdb297ed0adfed8'
def install
libexec.install "apgdiff-#{version}.jar"
(bin+'apgdiff').write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/apgdiff-#{version}.jar" "$@"
EOS
libexec.install "apgdiff-2.4.jar"
bin.write_jar_script libexec/"apgdiff-2.4.jar", "apgdiff"
end
end

View file

@ -39,10 +39,10 @@ class Apollo < Formula
end
end
(bin+'apollo').write <<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{name}" "$@"
EOS
bin.write_exec_script libexec/'bin/apollo'
plist_path.write startup_plist
plist_path.chmod 0644
end
def caveats; <<-EOS.undent

View file

@ -5,20 +5,9 @@ class AppEngineJavaSdk < Formula
url 'http://googleappengine.googlecode.com/files/appengine-java-sdk-1.7.2.zip'
sha1 '5adcecb9c76937de5afeb3cf1fe17a6cce24f130'
def shim_script target
<<-EOS.undent
#!/bin/bash
"#{libexec}/bin/#{target}" "$@"
EOS
end
def install
rm Dir['bin/*.cmd']
libexec.install Dir['*']
Dir["#{libexec}/bin/*"].each do |b|
n = Pathname.new(b).basename
(bin+n).write shim_script(n)
end
bin.write_exec_script "#{libexec}/bin/*"
end
end

View file

@ -7,10 +7,7 @@ class Arm < Formula
def install
(share+"arm").install Dir["*"]
(bin+'arm').write <<-EOS.undent
#!/bin/sh
exec "#{share}/arm/arm" "$@"
EOS
bin.write_exec_script share/'arm/arm'
end
def caveats; <<-EOS.undent

View file

@ -32,13 +32,7 @@ class BulkExtractor < Formula
# Install the GUI the Homebrew way
libexec.install 'java_gui/BEViewer.jar'
(bin+'BEViewer').write script
end
def script; <<-EOS.undent
#!/bin/sh
exec java -Xmx1g -jar #{libexec}/BEViewer.jar "$@"
EOS
bin.write_jar_script libexec/"BEViewer.jar", "BEViewer", "-Xmx1g"
end
def caveats; <<-EOS.undent

View file

@ -4,20 +4,14 @@ class Calabash < Formula
homepage 'http://xmlcalabash.com'
url 'http://xmlcalabash.com/download/calabash-1.0.3-94.zip'
sha1 '4f8329f2fc9cac1b03f161219a1a1b9987ac7ecf'
head 'https://github.com/ndw/xmlcalabash1.git'
depends_on 'saxon'
def install
libexec.install Dir["*"]
(bin+'calabash').write shim_script('calabash')
end
def shim_script target
<<-EOS.undent
#!/usr/bin/env bash
java -Xmx1024m -jar #{libexec}/calabash.jar "$@"
EOS
bin.write_jar_script libexec/'calabash.jar', 'calabash', '-Xmx1024m'
end
def test

View file

@ -6,16 +6,13 @@ class Checkstyle < Formula
sha1 '757f89f0bb6148718904577d230a9b4f8221b03c'
def install
# wrapper script
(bin/'checkstyle').write <<-EOS.undent
#! /usr/bin/env bash -e
java -jar "#{libexec}/checkstyle-5.5-all.jar" "$@"
EOS
libexec.install 'checkstyle-5.5-all.jar', 'sun_checks.xml'
bin.write_jar_script libexec/'checkstyle-5.5-all.jar', 'checkstyle'
end
def test
# Note this test "fails" because the audit has issues
# TODO - pipe through cat to ingore error code
mktemp do
# create test file
(Pathname.pwd/"Test.java").write <<-EOS.undent

View file

@ -13,10 +13,6 @@ class ClosureCompiler < Formula
system "ant"
libexec.install Dir['*']
(bin/'closure-compiler').write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/build/compiler.jar" "$@"
EOS
bin.write_jar_script libexec/'build/compiler.jar', 'closure-compiler'
end
end

View file

@ -1,15 +1,12 @@
require 'formula'
class Cssembed < Formula
url 'https://github.com/downloads/nzakas/cssembed/cssembed-0.4.5.jar'
homepage 'http://www.nczonline.net/blog/2009/11/03/automatic-data-uri-embedding-in-css-files/'
url 'https://github.com/downloads/nzakas/cssembed/cssembed-0.4.5.jar'
sha1 'c170f4a6a19f2f86ebd04208cc71d017b3a6f907'
def install
libexec.install "cssembed-0.4.5.jar"
(bin+'cssembed').write <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/cssembed-0.4.5.jar" "$@"
EOS
bin.write_jar_script libexec/'cssembed-0.4.5', 'cssembed'
end
end

View file

@ -1,15 +1,12 @@
require 'formula'
class Ditaa < Formula
url 'http://downloads.sourceforge.net/project/ditaa/ditaa/0.9/ditaa0_9.zip'
homepage 'http://ditaa.sourceforge.net/'
url 'http://downloads.sourceforge.net/project/ditaa/ditaa/0.9/ditaa0_9.zip'
sha1 '3efe5a3710627e19a414c305c82f0e58adf7c4f2'
def install
prefix.install "ditaa0_9.jar"
(bin+'ditaa').write <<-EOS.undent
#!/bin/sh
java -jar "#{prefix}/ditaa0_9.jar" "$@"
EOS
libexec.install "ditaa0_9.jar"
bin.write_jar_script libexec/'ditaa0_9.jar', 'ditaa'
end
end

View file

@ -11,30 +11,8 @@ class Epubcheck < Formula
end
def install
if build.devel?
libexec.install "epubcheck-3.0b5.jar", "lib"
(bin/'epubcheck').write <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/epubcheck-3.0b5.jar" "$@"
EOS
else
libexec.install "epubcheck-1.2.jar", "lib"
(bin/'epubcheck').write <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/epubcheck-1.2.jar" "$@"
EOS
end
end
def test
puts <<-EOS.undent
To test epubcheck, find a epub file that doesn't have any errors and then:
epubcheck file.epub
The reply should look like:
Epubcheck Version 1.2 or 3.0b5
No errors or warnings detected
EOS
jarname = build.devel? ? "epubcheck-3.0b5.jar" : "epubcheck-1.2.jar"
libexec.install jarname, "lib"
bin.write_jar_script libexec/jarname, 'epubcheck'
end
end

View file

@ -5,21 +5,14 @@ class Findbugs < Formula
url 'http://sourceforge.net/projects/findbugs/files/findbugs/2.0.1/findbugs-2.0.1.tar.gz'
sha1 '8358d28d90baecbf8590ef00b69c194ff1a8475c'
def startup_script name
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{name}" "$@"
EOS
end
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
prefix.install 'README.txt'
libexec.install Dir['*']
(bin+'fb').write startup_script('fb')
(bin+'findbugs').write startup_script('findbugs')
bin.write_exec_script libexec/'bin/fb'
bin.write_exec_script libexec/'bin/findbugs'
end
def caveats; <<-EOS.undent

View file

@ -10,16 +10,9 @@ class Fop < Formula
DATA
end
def shim_script target
<<-EOS.undent
#!/bin/bash
"#{libexec}/#{target}" "$@"
EOS
end
def install
libexec.install Dir["*"]
(bin+'fop').write shim_script('fop')
bin.write_exec_script libexec/'fop'
end
end

View file

@ -8,9 +8,6 @@ class Frege < Formula
def install
libexec.install Dir['*']
(bin+'fregec').write <<-EOS.undent
#!/bin/sh
exec java -Xss1m -jar "#{libexec}/frege3.19.112a.jar" "$@"
EOS
bin.write_jar_script libexec/'frege3.19.112a.jar', 'fregec', '-Xss1m'
end
end

View file

@ -5,22 +5,11 @@ class Hadoop < Formula
url 'http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.0.4/hadoop-1.0.4.tar.gz'
sha1 '1ab6f3271289ff83ba7b44a090ec1a3e6b77d1dd'
def shim_script target
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{target}" "$@"
EOS
end
def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin conf lib webapps contrib]
libexec.install Dir['*.jar']
bin.mkpath
Dir["#{libexec}/bin/*"].each do |b|
n = Pathname.new(b).basename
(bin+n).write shim_script(n)
end
bin.write_exec_script Dir["#{libexec}/bin/*"]
inreplace "#{libexec}/conf/hadoop-env.sh",
"# export JAVA_HOME=/usr/lib/j2sdk1.5-sun",

View file

@ -1,28 +1,17 @@
require 'formula'
class Hbase < Formula
url 'http://www.apache.org/dyn/closer.cgi?path=hbase/hbase-0.94.0/hbase-0.94.0.tar.gz'
homepage 'http://hbase.apache.org'
url 'http://www.apache.org/dyn/closer.cgi?path=hbase/hbase-0.94.0/hbase-0.94.0.tar.gz'
sha1 'a77f4b70bddbf8555bfe11e4db197d3cbb0c20d1'
depends_on 'hadoop'
def shim_script target
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{target}" "$@"
EOS
end
def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin conf docs lib hbase-webapps]
libexec.install Dir['*.jar']
bin.mkpath
Dir["#{libexec}/bin/*"].each do |b|
n = Pathname.new(b).basename
(bin+n).write shim_script(n)
end
bin.write_exec_script Dir["#{libexec}/bin/*"]
inreplace "#{libexec}/conf/hbase-env.sh",
"# export JAVA_HOME=/usr/java/jdk1.6.0/",

View file

@ -6,24 +6,11 @@ class Hive < Formula
sha1 '8c8086ff9ec5de5c661d98d926bbedac62c28a61'
depends_on 'hadoop'
def shim_script target
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{target}" "$@"
EOS
end
def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin conf examples lib ]
libexec.install Dir['*.jar']
bin.mkpath
Dir["#{libexec}/bin/*"].each do |b|
n = Pathname.new(b).basename
(bin+n).write shim_script(n)
end
bin.write_exec_script Dir["#{libexec}/bin/*"]
end
def caveats; <<-EOS.undent

View file

@ -17,7 +17,6 @@ class Hornetq < Formula
def install
libexec.install Dir['*']
bin.mkpath
(bin+'hornet-start').write wrapper_script('run.sh')
(bin+'hornet-stop').write wrapper_script('stop.sh')
end

View file

@ -10,12 +10,8 @@ class Htmlcompressor < Formula
depends_on "yuicompressor" => :optional if build.include? 'yuicompressor'
def install
libexec.install "htmlcompressor-#{version}.jar"
(bin+'htmlcompressor').write <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/htmlcompressor-#{version}.jar" "$@"
EOS
libexec.install "htmlcompressor-1.5.3.jar"
bin.write_jar_script libexec/"htmlcompressor-1.5.3.jar", "htmlcompressor"
if build.include? 'yuicompressor'
yui = Formula.factory('yuicompressor')

View file

@ -9,10 +9,6 @@ class Ivy < Formula
def install
libexec.install Dir['ivy*']
doc.install Dir['doc/*']
(bin+'ivy').write <<-EOS.undent
#!/bin/sh
java $JAVA_OPTS -jar "#{libexec}/ivy-#{version}.jar" "$@"
EOS
bin.write_jar_script libexec/'ivy-2.3.0-rc1.jar', 'ivy', '$JAVA_OPTS'
end
end

View file

@ -5,19 +5,13 @@ class Jasmin < Formula
url 'http://downloads.sourceforge.net/project/jasmin/jasmin/jasmin-2.4/jasmin-2.4.zip'
sha1 'c66400680144e0da4efdcf4a084e42e2355189fe'
def script; <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/jasmin.jar" "$@"
EOS
end
def install
# Remove Windows scripts
rm_rf Dir['*.bat']
libexec.install Dir['*.jar']
prefix.install %w[Readme.txt license-ant.txt license-jasmin.txt]
(bin+"jasmin").write script
bin.write_jar_script libexec/'jasmin.jar', 'jasmin'
end
def test

View file

@ -7,9 +7,6 @@ class Jing < Formula
def install
libexec.install Dir["*"]
(bin+'jing').write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/bin/jing.jar" "$@"
EOS
bin.write_jar_script libexec/'bin/jing.jar', 'jing'
end
end

View file

@ -5,18 +5,11 @@ class Jmeter < Formula
url 'http://apache.webxcreen.org/jmeter/binaries/apache-jmeter-2.8.tgz'
sha1 'e18cac4ab2b73dfcfe5d11e857905fa31c638563'
def startup_script name
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{name}" "$@"
EOS
end
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
prefix.install %w{ LICENSE NOTICE README }
libexec.install Dir['*']
(bin/'jmeter').write startup_script('jmeter')
bin.write_exec_script libexec/'bin/jmeter'
end
end

View file

@ -4,13 +4,9 @@ class JsTestDriver < Formula
homepage 'http://code.google.com/p/js-test-driver/'
url 'https://js-test-driver.googlecode.com/files/JsTestDriver-1.3.4.b.jar'
sha1 'ce036e7c0973ff0588a52f0d3730b5c938404ed1'
sha1 'ce036e7c0973ff0588a52f0d3730b5c938404ed1'
def install
libexec.install "JsTestDriver-1.3.4.b.jar"
(bin+'js-test-driver').write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/JsTestDriver-1.3.4.b.jar" "$@"
EOS
libexec.install 'JsTestDriver-1.3.4.b.jar'
bin.write_jar_script libexec/'JsTestDriver-1.3.4.b.jar', 'js-test-driver'
end
end

View file

@ -1,15 +1,12 @@
require 'formula'
class Jslint4java < Formula
url "http://jslint4java.googlecode.com/files/jslint4java-2.0.2-dist.zip"
homepage 'http://code.google.com/p/jslint4java/'
url "http://jslint4java.googlecode.com/files/jslint4java-2.0.2-dist.zip"
sha1 'a632bc96c82dbaf11372f46649175e46bd0c3a47'
def install
libexec.install Dir['*']
(bin+'jslint4java').write <<-EOF.undent
#!/bin/bash
java -jar "#{libexec}/jslint4java-2.0.2.jar" "$@"
EOF
bin.write_jar_script libexec/'jslint4java-2.0.2.jar', 'jslint4java'
end
end

View file

@ -6,11 +6,7 @@ class Languagetool < Formula
sha1 'eed879e201f13dd98d585e945b21cd7ba3eacd20'
def install
(bin+"languagetool").write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/LanguageTool.jar" "$@"
EOS
libexec.install Dir["*"]
bin.write_jar_script libexec/'LanguageTool.jar', 'languagetool'
end
end

View file

@ -35,12 +35,10 @@ class OpenMpi < Formula
# If Fortran bindings were built, there will be a stray `.mod` file
# (Fortran header) in `lib` that needs to be moved to `include`.
mv "#{lib}/mpi.mod", include if File.exists? "#{lib}/mpi.mod"
include.install lib/'mpi.mod' if File.exists? "#{lib}/mpi.mod"
mv "#{bin}/vtsetup.jar", libexec
(bin+'vtsetup.jar').write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/vtsetup.jar" "$@"
EOS
# Not sure why the wrapped script has a jar extension - adamv
libexec.install bin/'vtsetup.jar'
bin.write_jar_script libexec/'vtsetup.jar', 'vtsetup.jar'
end
end

View file

@ -7,9 +7,6 @@ class Proguard < Formula
def install
libexec.install 'lib/proguard.jar'
(bin+"proguard").write <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/proguard.jar" "$@"
EOS
bin.write_jar_script libexec/'proguard.jar', 'proguard'
end
end

View file

@ -8,10 +8,7 @@ class RestShell < Formula
def install
libexec.install Dir['*']
(bin/'rest-shell').write <<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/rest-shell" "$@"
EOS
bin.write_exec_script libexec/'bin/rest-shell'
end
def test

View file

@ -8,9 +8,6 @@ class Rhino < Formula
def install
libexec.install 'js.jar'
(bin+'rhino').write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/js.jar" "$@"
EOS
bin.write_jar_script libexec/'js.jar', 'rhino'
end
end

View file

@ -5,20 +5,9 @@ class Ringojs < Formula
homepage 'http://ringojs.org'
sha1 '28fd76fce28b41e2abcbe27a8b1731744d340e94'
def shim_script target
<<-EOS.undent
#!/bin/bash
"#{libexec}/bin/#{target}" "$@"
EOS
end
def install
rm Dir['bin/*.cmd']
libexec.install Dir['*']
Dir["#{libexec}/bin/*"].each do |b|
n = Pathname.new(b).basename
(bin+n).write shim_script(n)
end
bin.write_exec_script Dir["#{libexec}/bin/*"]
end
end

View file

@ -5,18 +5,11 @@ class Rsense < Formula
url 'http://cx4a.org/pub/rsense/rsense-0.3.tar.bz2'
sha1 '497510e7048120af01bac619e50aa72ebd825c49'
def startup_script(name)
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{name}" "$@"
EOS
end
def install
prefix.install 'README.txt'
libexec.install Dir['*']
(libexec+'bin/rsense').chmod 0755
(bin+'rsense').write startup_script('rsense')
bin.write_exec_script libexec/'bin/rsense'
end
def caveats

View file

@ -13,10 +13,7 @@ class Savana < Formula
# lib/* and logging.properties are loaded relative to bin
libexec.install %w[bin lib logging.properties]
(bin+'sav').write <<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/sav" "$@"
EOS
bin.write_exec_script libexec/'bin/sav'
(prefix+'etc/bash_completion.d').install 'etc/bash_completion' => 'savana-completion.bash'
end

View file

@ -6,15 +6,8 @@ class Saxon < Formula
sha1 '7383d2504f45582f94c0d9c9ca2f4fa322fad7a1'
version "9.4.0.2"
def shim_script target
<<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/saxon9he.jar" "$@"
EOS
end
def install
libexec.install Dir["*"]
(bin+'saxon').write shim_script('saxon')
bin.write_jar_script libexec/'saxon9he.jar', 'saxon'
end
end

View file

@ -6,14 +6,6 @@ class Scalate < Formula
version '1.5.3'
sha1 '17e3cd6252b36c9cf80566738299c7e19df957bf'
# This startup script for Scalate calls the real startup script installed
# to Homebrew's cellar. This avoids issues with local vs. absolute symlinks.
def startup_script; <<-EOS.undent
#!/bin/bash
"#{libexec}/bin/scalate" "$@"
EOS
end
def install
# Recursively fix the permissions of extracted regular files
# excluding the bin directory contents.
@ -23,7 +15,7 @@ class Scalate < Formula
prefix.install %w{ license.txt readme.html }
libexec.install Dir['*']
(bin+'scalate').write startup_script
bin.write_exec_sript libexec/'bin/scalate'
end
def caveats; <<-EOS.undent

View file

@ -9,9 +9,6 @@ class Sshuttle < Formula
def install
libexec.install Dir['*']
(bin+'sshuttle').write <<-EOS.undent
#!/bin/bash
exec #{libexec}/sshuttle "$@"
EOS
bin.write_exec_script libexec/'sshuttle'
end
end

View file

@ -6,19 +6,9 @@ class StanfordParser < Formula
sha1 '1d67ec99f473b59600e5698083ce518ada4dd1b2'
version '2.0.3'
def shim_script target_script
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/#{target_script}" "$@"
EOS
end
def install
libexec.install Dir['*']
Dir["#{libexec}/*.sh"].each do |f|
f = File.basename(f)
(bin+f).write shim_script(f)
end
bin.write_exec_script Dir["#{libexec}/*.sh"]
end
def test

View file

@ -10,21 +10,12 @@ class Tika < Formula
url 'http://www.apache.org/dyn/closer.cgi/tika/tika-app-1.2.jar'
sha1 '22c7110997d8ec114c6713cca1aadbbab6472c07'
def script; <<-EOS.undent
#!/bin/sh
java -jar #{libexec}/tika-app-1.2.jar "$@"
EOS
end
def install
libexec.install 'tika-app-1.2.jar'
(bin+'tika').write script
bin.write_jar_script libexec/'tika-app-1.2.jar', 'tika'
TikaRestServer.new.brew {
libexec.install 'tika-server-1.2.jar'
(bin+'tika-rest-server').write <<-EOS.undent
#!/bin/sh
java -jar #{libexec}/tika-server-1.2.jar "$@"
EOS
bin.write_jar_script libexec/'tika-server-1.2.jar', 'tika-rest-server'
}
end

View file

@ -7,9 +7,6 @@ class Trang < Formula
def install
libexec.install Dir["*"]
(bin+'trang').write <<-EOS.undent
#!/bin/bash
java -jar "#{libexec}/trang.jar" "$@"
EOS
bin.write_jar_script libexec/'trang.jar', 'trang'
end
end

View file

@ -5,20 +5,16 @@ class Voldemort < Formula
url 'https://github.com/downloads/voldemort/voldemort/voldemort-0.90.1.tar.gz'
sha1 '8a8d33e3a5904f3aeea66bc0503fb12e449e0969'
skip_clean 'libexec/config'
def install
system "ant"
libexec.install %w(bin lib dist contrib)
libexec.install "config" => "config-examples"
(libexec+"config").mkpath
(libexec/"config").mkpath
# Write shim scripts for all utilities
Dir["#{libexec}/bin/*.sh"].each do |p|
script = File.basename(p)
(bin+script).write <<-EOS.undent
#!/bin/bash
exec #{p} "$@"
EOS
end
bin.write_exec_script Dir["#{libexec}/bin/*.sh"]
end
def caveats; <<-EOS.undent

View file

@ -5,16 +5,8 @@ class Whirr < Formula
url 'http://www.apache.org/dyn/closer.cgi?path=whirr/whirr-0.8.0/whirr-0.8.0.tar.gz'
sha1 '44056fee1fd0e83a7257772d1a20faeae8f5cd1d'
def shim_script target
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{target}" "$@"
EOS
end
def install
libexec.install %w[bin conf lib]
# Leave "examples" script in libexec
(bin/'whirr').write shim_script('whirr')
bin.write_exec_script libexec/'bin/whirr'
end
end

View file

@ -6,10 +6,7 @@ class Yuicompressor < Formula
sha1 '64d209cae769cee2b89217ba226543001c59d27b'
def install
libexec.install "build/yuicompressor-#{version}.jar"
(bin+'yuicompressor').write <<-EOS.undent
#!/bin/sh
java -jar "#{libexec}/yuicompressor-#{version}.jar" "$@"
EOS
libexec.install "build/yuicompressor-2.4.7.jar"
bin.write_jar_script libexec/'yuicompressor-2.4.7.jar', 'yuicompressor'
end
end