Navigation Menu

Skip to content

Commit

Permalink
Extract prefix information
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 5, 2014
1 parent 349f3fa commit b310270
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Rakefile
Expand Up @@ -2,6 +2,20 @@ require "octokit"

task :default => :build

@top_dir = Dir.pwd

def top_dir
@top_dir
end

def relative_install_prefix
File.join("vendor", "groonga")
end

def absolete_install_prefix
File.join(top_dir, relative_install_prefix)
end

def github_token
ENV["GITHUB_TOKEN"]
end
Expand Down Expand Up @@ -47,14 +61,13 @@ def build_groonga
sh("curl", "-O", "http://packages.groonga.org/source/groonga/#{archive_name}")
sh("tar", "xf", archive_name)

install_dir = File.join(Dir.pwd, "vendor", "groonga")
Dir.chdir(base_name) do
configure_args = []
if ENV["DEBUG"] == "yes"
configure_args << "--enable-debug"
end
sh("./configure",
"--prefix=#{install_dir}",
"--prefix=#{absolete_install_prefix}",
"--disable-static",
"--disable-document",
*configure_args)
Expand All @@ -63,7 +76,7 @@ def build_groonga
end

built_archive_name = "heroku-#{base_name}.tar.xz"
sh("tar", "cJf", built_archive_name, "vendor/groonga")
sh("tar", "cJf", built_archive_name, relative_install_prefix)

build_archive_name
end
Expand Down

0 comments on commit b310270

Please sign in to comment.