#vim: set fileencoding:utf-8 AUTHOR = "dearblue" EMAIL = "dearblue@users.sourceforge.jp" WEBSITE = "http://sourceforge.jp/projects/rutsubo/" LICENSE = "2-clause BSD License" PACKAGE = "extattr" VERSION = "0.2" PLATFORM_NATIVE = Gem::Platform.local.to_s GEMFILE = "#{PACKAGE}-#{VERSION}.gem" GEMFILE_NATIVE = "#{PACKAGE}-#{VERSION}-#{PLATFORM_NATIVE}.gem" GEMSPEC = "#{PACKAGE}.gemspec" GEMSPEC_NATIVE = "#{PACKAGE}-#{PLATFORM_NATIVE}.gemspec" SUMMARY = "extended attribute operation library for ruby" DESCRIPTION = < 2.14" s.add_development_dependency "rake", "~> 10.0" end task :default => :gem task :gem => [GEMFILE_NATIVE, GEMFILE] task :gemspec => GEMSPEC task :gemspec_native => GEMSPEC_NATIVE task :gemfile => GEMFILE task :gemfile_native => GEMFILE_NATIVE task :rdoc do sh "yardoc --charset UTF-8 --locale ja --main README.md README.md LICENSE.md #{(EXTFILES + LIBFILES).join(" ")}" end file GEMFILE => [GEMSPEC] + BINFILES + EXTFILES + LIBFILES do sh "gem build #{GEMSPEC}" end file GEMFILE_NATIVE => [GEMSPEC_NATIVE] + BINFILES + EXTFILES + LIBFILES + SOFILES do sh "gem build #{GEMSPEC_NATIVE}" end file GEMSPEC => __FILE__ do s = SPECSTUB.dup s.extensions += EXTCONF File.write(GEMSPEC, s.to_ruby, mode: "wb") end file GEMSPEC_NATIVE => __FILE__ do s = SPECSTUB.dup s.files += SOFILES s.platform = PLATFORM_NATIVE File.write(GEMSPEC_NATIVE, s.to_ruby, mode: "wb") end SOFILES_SET.each do |(soname, ruby)| sodir = File.dirname(soname) makefile = File.join(sodir, "Makefile") directory sodir file soname => [makefile] + EXTFILES do cd sodir do sh "make" end end file makefile => [sodir] + EXTCONF do cd sodir do sh "#{ruby} ../../ext/extconf.rb" end end end