aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/figlet.rb
diff options
context:
space:
mode:
authorErik Kastner2009-12-31 14:24:29 -0500
committerMax Howell2010-01-13 13:28:03 +0000
commit9197231321aaa5534fd2eea96f341b7a511807be (patch)
tree88276dba31185df09828bc2fae9f8713f58f8731 /Library/Formula/figlet.rb
parentc672023a92c44438522d20958f4fcd8b02a28200 (diff)
downloadhomebrew-9197231321aaa5534fd2eea96f341b7a511807be.tar.bz2
Formula for Figlet (fixed-with fonts)
Signed-off-by: Max Howell <max@methylblue.com> I moved the fonts into share/figlet and made the system calls at the start Ruby equivalents.
Diffstat (limited to 'Library/Formula/figlet.rb')
-rw-r--r--Library/Formula/figlet.rb79
1 files changed, 79 insertions, 0 deletions
diff --git a/Library/Formula/figlet.rb b/Library/Formula/figlet.rb
new file mode 100644
index 000000000..189f3a859
--- /dev/null
+++ b/Library/Formula/figlet.rb
@@ -0,0 +1,79 @@
+require 'formula'
+
+class ContribFonts <Formula
+ url 'ftp://ftp.figlet.org:21//pub/figlet/fonts/contributed.tar.gz'
+ version "2.2.2"
+ md5 '6e2dec4499f7a7fe178522e02e0b6cd1'
+end
+
+class InternationalFonts <Formula
+ url 'ftp://ftp.figlet.org:21//pub/figlet/fonts/international.tar.gz'
+ version "2.2.2"
+ md5 'b2d53f7e251014adcdb4d407c47f90ef'
+end
+
+class Figlet <Formula
+ url 'ftp://ftp.figlet.org:21//pub/figlet/program/unix/figlet222.tar.gz'
+ homepage 'http://www.figlet.org'
+ md5 '5f84ad52d092d5db4ad5916df767646b'
+ version "2.2.2"
+
+ def fonts
+ share + "figlet/fonts"
+ end
+
+ def man6
+ share + 'man/man6'
+ end
+
+ def patches
+ DATA
+ end
+
+ def install
+ File.chmod 0666, 'Makefile'
+ File.chmod 0666, 'showfigfonts'
+ man6.mkpath
+ bin.mkpath
+
+ ContribFonts.new.brew { fonts.install Dir['*'] }
+ InternationalFonts.new.brew { fonts.install Dir['*'] }
+
+ inreplace "Makefile" do |s|
+ s.gsub! "/usr/local/", "#{prefix}/"
+ s.change_make_var! 'DEFAULTFONTDIR', fonts
+ s.change_make_var! 'MANDIR', man6
+ end
+
+ system "make install"
+ end
+end
+
+__END__
+diff --git a/showfigfonts b/showfigfonts
+index 643c60b..543379c 100644
+--- a/showfigfonts
++++ b/showfigfonts
+@@ -14,6 +14,7 @@
+ DIRSAVE=`pwd`
+ cd `dirname "$0"`
+ PATH="$PATH":`pwd`
++FIGDIR=`pwd`
+ cd "$DIRSAVE"
+
+ # Get figlet version
+@@ -42,12 +43,12 @@ else
+ FONTDIR="`figlet -F | sed -e '1d' -e '3,$d' -e 's/Font directory: //'`"
+ else
+ # figlet 2.1 or later
+- FONTDIR="`figlet -I2`"
++ FONTDIR="`${FIGDIR}/figlet -I2`"
+ fi
+ fi
+
+ cd "$FONTDIR"
+-FONTLIST=`ls *.flf | sed s/\.flf$//`
++FONTLIST=`ls *.fl* | sed s/\.fl.$//`
+ cd $DIRSAVE
+ for F in $FONTLIST ; do
+ echo "$F" :