From 2d968193976234fd9e29eecb745ce08f98f8f4fd Mon Sep 17 00:00:00 2001
From: bigbes <bigbes@gmail.com>
Date: Wed, 28 May 2014 18:09:37 +0400
Subject: [PATCH] Fix warnings and broken spec's fields for brew test-bot

---
 extra/tarantool.rb | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/extra/tarantool.rb b/extra/tarantool.rb
index cd6a7aa55d..8bdc0fe8dd 100644
--- a/extra/tarantool.rb
+++ b/extra/tarantool.rb
@@ -10,9 +10,9 @@ class Tarantool < Formula
   option 'with-tests', "Run Tests after building"
 
   stable do
-    url 'https://github.com/tarantool/tarantool.git', :using => :git, :branch => "stable"
+    url 'https://github.com/tarantool/tarantool.git', :branch => "stable", :shallow => false
     depends_on 'e2fsprogs' => :recommended
-    if build.include? 'with-tests'
+    if build.with? 'tests'
       depends_on 'python-daemon' => [:python, "daemon",  :build]
       depends_on 'pyyaml'        => [:python, "yaml",    :build]
       depends_on 'pexpect'       => [:python, "pexpect", :build]
@@ -21,9 +21,9 @@ class Tarantool < Formula
   end
 
   devel do
-    url 'https://github.com/tarantool/tarantool.git', :using => :git, :branch => "master"
+    url 'https://github.com/tarantool/tarantool.git', :branch => "master", :shallow => false
     depends_on 'e2fsprogs' => :build
-    if build.include? 'with-tests'
+    if build.with? 'tests'
       depends_on 'python-daemon' => [:python, "daemon", :build]
       depends_on 'pyyaml'        => [:python, "yaml",   :build]
     end
@@ -32,7 +32,7 @@ class Tarantool < Formula
 
   def install
     args = []
-    if build.include? 'with-debug'
+    if build.with? 'debug'
       ENV.enable_warnings
       ENV.deparallelize
       args << ["-DCMAKE_BUILD_TYPE=Debug"]
@@ -42,11 +42,14 @@ class Tarantool < Formula
       ohai "Building with Release"
     end
     args << "-DENABLE_CLIENT=True" if build.stable?
+    args << "-DCMAKE_INSTALL_SYSCONFDIR=#{prefix}/etc"
+    args << "-DCMAKE_INSTALL_LOCALSTATEDIR=#{prefix}/var"
     args += std_cmake_args
-    
+
     ohai "Preparing"
     version = `git -C #{cached_download} describe HEAD`
-    File.open("#{buildpath}/VERSION", 'w') {|file| file.write(version)}
+
+    File.open(buildpath/"VERSION", 'w') {|file| file.write(version)}
 
     ohai "Configuring:"
     system "cmake", ".", *args
@@ -65,7 +68,7 @@ class Tarantool < Formula
 
     ohai "Installing config"
     if build.stable?
-      inreplace etc/"tarantool.cfg", /^work_dir =.*/, "work_dir = #{prefix}/var/lib/tarantool"
+      inreplace prefix/"etc/tarantool.cfg", /^work_dir =.*/, "work_dir = #{prefix}/var/lib/tarantool"
     else
       doc.install "test/box/box.lua"
       inreplace doc/"box.lua" do |s|
@@ -77,13 +80,13 @@ class Tarantool < Formula
       end
     end
 
-    if build.include? 'with-tests'
+    if build.with? 'tests'
         ohai "Testing Tarantool with internal test suite:"
-        system "/usr/bin/env", "python", "#{buildpath}/test/test-run.py", "--builddir", "#{buildpath}", "--vardir", "#{buildpath}/test/var"
+        system "/usr/bin/env", "python", buildpath/"test/test-run.py", "--builddir", buildpath, "--vardir", buildpath/"test/var"
     end
   end
 
   def test
-    system "#{bin}/tarantool", "--version"
+    system bin/"tarantool", "--version"
   end
 end
-- 
GitLab