aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/gnu-chess.rb
blob: f04a2e51fe0a798081aff51107f3d4e5f15a593e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'formula'

class GnuChess < Formula
  homepage 'http://www.gnu.org/software/chess/'
  url 'http://ftpmirror.gnu.org/chess/gnuchess-6.0.1.tar.gz'
  mirror 'http://ftp.gnu.org/gnu/chess/gnuchess-6.0.1.tar.gz'
  md5 '041888218f73886f146fa7fbf92190de'

  def install
    # Opening book for gnuchess.  This can be put in the doc directory and the
    # user can optionally add the opening book.  The README has details on
    # adding the opening book.
    book_url = "http://ftpmirror.gnu.org/chess/book_1.02.pgn.gz"
    ohai "Downloading #{book_url}"
    curl book_url, "-O"

    system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"
    system "make"
    ENV.j1 # Prevents a "file already exists" warning
    system "make install"
    doc.install Dir['doc/*', 'TODO', 'book_1.02.pgn.gz', 'book']
  end

  def caveats; <<-EOS.undent
    The README file contains a manual for use:
      #{doc}/README

    This formula also downloads the additional opening book.  The opening
    book is a gzipped PGN file that can be added using gnuchess commands.
    The book_*.pgn.gz file is located in the same directory as the README.
    See the README for using the `book add' command.
    EOS
  end
end