Yasuhiro Horimoto 2019-04-15 11:39:06 +0900 (Mon, 15 Apr 2019) Revision: 854dd938ca45ddefc81517eb2d242b7630e614ec https://github.com/ranguba/rroonga/commit/854dd938ca45ddefc81517eb2d242b7630e614ec Message: Use "groonga-latest.tar.gz" for build Groonga (#149) * Use "groonga-latest.tar.gz" for build Groonga Currently, this feature is available only with Linux. * Remove unused variable * Remove needless "()" * Remove needless a path * Remove needless condition branch * Use a "--strip-components" instead of a "--strip" Because "--strip" isn't described in "man". Modified files: ext/groonga/extconf.rb Modified: ext/groonga/extconf.rb (+12 -9) =================================================================== --- ext/groonga/extconf.rb 2018-08-15 15:00:05 +0900 (bc05ebf3) +++ ext/groonga/extconf.rb 2019-04-15 11:39:06 +0900 (9ebeb0fc) @@ -71,7 +71,7 @@ def install_groonga_locally(major, minor, micro) if win32? extract_groonga_win32_binary(major, minor, micro) else - build_groonga(major, minor, micro) + build_groonga end end @@ -210,7 +210,7 @@ def install_for_gnu_build_system(install_dir) "#{make} install") end -def build_groonga_from_git(major, minor, micro) +def build_groonga_from_git message("removing old cloned repository...") FileUtils.rm_rf("groonga") message(" done\n") @@ -230,21 +230,24 @@ def build_groonga_from_git(major, minor, micro) message(" done\n") end -def build_groonga_from_tar_gz(major, minor, micro) - tar_gz = "groonga-#{major}.#{minor}.#{micro}.tar.gz" +def build_groonga_from_tar_gz + tar_gz = "groonga-latest.tar.gz" url = "http://packages.groonga.org/source/groonga/#{tar_gz}" + groonga_source_dir = "groonga-latest" download(url) + FileUtils.rm_rf(groonga_source_dir) + FileUtils.mkdir_p(groonga_source_dir) + message("extracting...") - if xsystem("tar xfz #{tar_gz}") + if xsystem("tar xfz #{tar_gz} -C #{groonga_source_dir} --strip-components=1") message(" done\n") else message(" failed\n") exit(false) end - groonga_source_dir = "groonga-#{major}.#{minor}.#{micro}" Dir.chdir(groonga_source_dir) do install_for_gnu_build_system(local_groonga_install_dir) end @@ -258,11 +261,11 @@ def build_groonga_from_tar_gz(major, minor, micro) message(" done\n") end -def build_groonga(major, minor, micro) +def build_groonga if RequiredGroongaVersion::RELEASED_DATE > Time.now - build_groonga_from_git(major, minor, micro) + build_groonga_from_git else - build_groonga_from_tar_gz(major, minor, micro) + build_groonga_from_tar_gz end end -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190415/22fe96c3/attachment-0001.html>