aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBen Alpert2009-08-31 22:34:42 -0600
committerMax Howell2009-09-01 11:15:25 +0100
commitbebbd8e0dca3d85d7f813071c23207d73cae45c1 (patch)
tree5415787eb9e5e08aa6e935dd3be598ceef377864 /Library
parentcba07d66677dc1564c8ffdb0f27fd3c212df4a74 (diff)
downloadhomebrew-bebbd8e0dca3d85d7f813071c23207d73cae45c1.tar.bz2
Dict.org client formula
Added Formula::etc() Added Pathname::write() convenience function which can write a string out to the file it points too, raising if it would have to overwrite.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/dict.rb36
-rw-r--r--Library/Homebrew/formula.rb1
-rw-r--r--Library/Homebrew/pathname+yeast.rb7
3 files changed, 44 insertions, 0 deletions
diff --git a/Library/Formula/dict.rb b/Library/Formula/dict.rb
new file mode 100644
index 000000000..8333c09fe
--- /dev/null
+++ b/Library/Formula/dict.rb
@@ -0,0 +1,36 @@
+require 'brewkit'
+
+DICT_CONF=<<-EOS
+# /etc/dict.conf Written by Bob Hilliard <hilliard@debian.org>
+# 1998/03/20. Last revised Sun, 22 Nov 1998 18:10:04 -0500 This is
+# the configuration file for /usr/bin/dict. In most cases only the
+# server keyword need be specified.
+
+# This default configuration will try to access a dictd server on the
+# local host, failing that, it will try the public server. In many
+# cases this will be slow, so you should comment out the line for the
+# server that you don't want to use. To use any other server, enter
+# its IP address in place of "dict.org".
+
+# Refer to the dict manpage (man dict) for other options that could
+# be inserted in here.
+
+server localhost
+server dict.org
+EOS
+
+class Dict <Formula
+ @url='ftp://ftp.dict.org/dict/dictd-1.9.15.tar.gz'
+ @homepage='http://www.dict.org/'
+ @md5='68c1cffa952012ba85a7271311de55e9'
+
+ def install
+ system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--sysconfdir=#{prefix}/etc"
+
+ # install the client
+ system "make install.dict"
+
+ # set up the conf file
+ (etc+'dict.conf').write DICT_CONF
+ end
+end
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 282876df4..0d9503599 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -80,6 +80,7 @@ class Formula
def bin; prefix+'bin' end
def sbin; prefix+'sbin' end
def doc; prefix+'share'+'doc'+name end
+ def etc; prefix+'etc' end
def lib; prefix+'lib' end
def libexec; prefix+'libexec' end
def man; prefix+'share'+'man' end
diff --git a/Library/Homebrew/pathname+yeast.rb b/Library/Homebrew/pathname+yeast.rb
index c34b6684f..a24532db1 100644
--- a/Library/Homebrew/pathname+yeast.rb
+++ b/Library/Homebrew/pathname+yeast.rb
@@ -53,6 +53,13 @@ class Pathname
return self+src
end
end
+
+ # we assume this pathname object is a file obviously
+ def write content
+ raise "Will not overwrite #{f}" if exist? and not ARGV.force?
+ dirname.mkpath
+ File.open(self, 'w') {|f| f.write content }
+ end
def cp dst
if file?