aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mydumper.rb
blob: 215d3377c76f74ea5ae8476360602bed67649c60 (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
35
36
37
38
39
40
41
42
43
44
45
require 'formula'

class MySqlInstalled < Requirement
  def message; <<-EOS.undent
    MySQL is required to install.

    You can install this with Homebrew using:
      brew install mysql-connector-c
        For MySQL client libraries only.

      brew install mysql
        For MySQL server.

    Or you can use an official installer from:
      http://dev.mysql.com/downloads/mysql/
    EOS
  end
  def satisfied?
    which 'mysql_config'
  end
  def fatal?
    true
  end
end

class Mydumper < Formula
  homepage 'http://www.mydumper.org/'
  url 'http://launchpadlibrarian.net/77098505/mydumper-0.5.1.tar.gz'
  md5 'b4df42dfe23f308ab13eb6ecb73a0d21'

  depends_on MySqlInstalled.new
  depends_on 'pkg-config' => :build
  depends_on 'cmake' => :build
  depends_on 'glib'
  depends_on 'pcre'

  def install
    system "cmake", ".", *std_cmake_args
    system "make install"
  end

  def test
    system "#{bin}/mydumper", "--version"
  end
end