aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/scala.rb
diff options
context:
space:
mode:
authorinkytonik2010-12-31 14:53:13 +1100
committerAdam Vandenberg2010-12-30 20:24:05 -0800
commit332b779b9cde9e9eb2af73b8d94b0dd15b5074ec (patch)
tree641ad80aa81bb8103c93e4fd48d552a7238cb457 /Library/Formula/scala.rb
parentbff1d6cf910fb825d29c1c62e0496f32ed3ee2b3 (diff)
downloadhomebrew-332b779b9cde9e9eb2af73b8d94b0dd15b5074ec.tar.bz2
Add --with-docs option to scala formula
The Scala distributions do not include documentation for library APIs and tools. That documentation is distributed separately. This change makes the formula install this documentation when the --with-docs option is given. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/scala.rb')
-rw-r--r--Library/Formula/scala.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/Library/Formula/scala.rb b/Library/Formula/scala.rb
index f34b6cc40..e32e500ad 100644
--- a/Library/Formula/scala.rb
+++ b/Library/Formula/scala.rb
@@ -1,11 +1,22 @@
require 'formula'
+class ScalaDocs <Formula
+ homepage 'http://www.scala-lang.org/'
+ url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.final-devel-docs.tgz'
+ version '2.8.1'
+ md5 'afd5c7d3073bd735a25cfc4ed61f3543'
+end
+
class Scala <Formula
homepage 'http://www.scala-lang.org/'
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.8.1.final.tgz'
version '2.8.1'
md5 '4fa66742341b5c9f6877ce64d409cb92'
+ def options
+ [['--with-docs', 'Also install library documentation']]
+ end
+
def install
rm_f Dir["bin/*.bat"]
doc.install Dir['doc/*']
@@ -13,5 +24,9 @@ class Scala <Formula
libexec.install Dir['*']
bin.mkpath
Dir["#{libexec}/bin/*"].each { |f| ln_s f, bin }
+
+ if ARGV.include? '--with-docs'
+ ScalaDocs.new.brew { doc.install Dir['*'] }
+ end
end
end