[Groonga-commit] groonga/gcs [master] package: support creating tar.gz

Zurück zum Archiv-Index

null+****@clear***** null+****@clear*****
2012年 6月 21日 (木) 17:13:21 JST


Kouhei Sutou	2012-06-21 17:13:21 +0900 (Thu, 21 Jun 2012)

  New Revision: 77f7699e1a8a2eeb645a87e6ef268cb3e74a2261
  https://github.com/groonga/gcs/commit/77f7699e1a8a2eeb645a87e6ef268cb3e74a2261

  Log:
    package: support creating tar.gz

  Modified files:
    packages/all-in-one/Rakefile

  Modified: packages/all-in-one/Rakefile (+20 -1)
===================================================================
--- packages/all-in-one/Rakefile    2012-06-21 17:12:57 +0900 (4962612)
+++ packages/all-in-one/Rakefile    2012-06-21 17:13:21 +0900 (e3cc1a0)
@@ -4,6 +4,7 @@ require "rbconfig"
 require "uri"
 require "pathname"
 require "open-uri"
+require "json"
 
 build_debug_p = ENV["BUILD_DEBUG"] == "yes"
 debug_flags = ["CFLAGS=-ggdb3 -O0", "CXXFLAGS=-ggdb3 -O0"]
@@ -167,7 +168,25 @@ namespace(:gcs) do
   end
 end
 
-task(:default => gcs_path.to_s)
+gcs_package_json = top_dir + "package.json"
+gcs_version = JSON.parse(gcs_package_json.read)["version"]
+gcs_package_basename = "gcs-#{gcs_version}"
+gcs_package_tar_gz = "#{gcs_package_basename}.tar.gz"
+gcs_package_path = tmp_dir + gcs_package_basename
+gcs_package_tar_gz_path = tmp_dir + gcs_package_tar_gz
+file(gcs_package_tar_gz_path.to_s) do
+  Rake::Task["package"]
+end
+
+task(:package => gcs_path.to_s) do
+  rm_rf(gcs_package_path.to_s)
+  cp_r(@dist_dir.to_s, gcs_package_path.to_s)
+  Dir.chdir(gcs_package_path.dirname.to_s) do
+    sh("tar", "czf", gcs_package_tar_gz, gcs_package_basename)
+  end
+end
+
+task(:default => :package)
 
 desc("Remove all auto generated files")
 task(:clean) do
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Zurück zum Archiv-Index