diff --git a/ChangeLog b/ChangeLog index 22d23f6e07..908efafecc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Thu Sep 21 22:56:20 2006 Nobuyoshi Nakada + + * common.mk (no-install): not install rdoc actually. + + * common.mk (install-doc, no-install-doc): use instruby.rb. + + * instruby.rb: rdoc installation. + + * ext/extmk.rb: expand ruby executable names. + Thu Sep 21 13:55:07 2006 Yukihiro Matsumoto * ext/etc/etc.c (etc_getpwuid): uid integer should be wraped in diff --git a/common.mk b/common.mk index dd8813b367..e379ad5bd9 100644 --- a/common.mk +++ b/common.mk @@ -144,7 +144,7 @@ do-install-man: post-install-man:: what-where: no-install -no-install: no-install-nodoc $(RDOCTARGET) +no-install: no-install-nodoc no-install-doc what-where-all: no-install-all no-install-all: no-install-nodoc @@ -219,17 +219,21 @@ dont-install-man: post-no-install-man:: install-doc: rdoc pre-install-doc do-install-doc post-install-doc +pre-install-doc:: install-prereq do-install-doc: $(PROGRAM) - $(RUNRUBY) -run -e cp -- -p -r -v "$(RDOCOUT)" "$(RIDATADIR)" + $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)" +post-install-doc:: rdoc: $(PROGRAM) PHONY @echo Generating RDoc documentation $(RUNRUBY) "$(srcdir)/bin/rdoc" --all --ri --op "$(RDOCOUT)" "$(srcdir)" -pre-install-doc:: PHONY - $(RUNRUBY) -run -e mkdir -- -p "$(RIDATADIR)" - -post-install-doc:: PHONY +what-where-doc: no-install-doc +no-install-doc: pre-no-install-doc dont-install-doc post-no-install-doc +pre-no-install-doc:: install-prereq +dont-install-doc:: + $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)" +post-no-install-doc:: install-prereq: @exit > $(INSTALLED_LIST) diff --git a/ext/extmk.rb b/ext/extmk.rb index fb28fb11ce..809f2fb038 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -487,7 +487,7 @@ rubies = [] %w[RUBY RUBYW STATIC_RUBY].each {|r| n = r if r = arg_config("--"+r.downcase) || config_string(r+"_INSTALL_NAME") - rubies << r+EXEEXT + rubies << Config.expand(r+=EXEEXT) $mflags << "#{n}=#{r}" end } diff --git a/instruby.rb b/instruby.rb index fa1624d254..ca592ede5b 100644 --- a/instruby.rb +++ b/instruby.rb @@ -37,11 +37,11 @@ def parse_args() $mflags.concat(v) end opt.on('-i', '--install=TYPE', - [:local, :bin, :lib, :man, :ext, :"ext-arch", :"ext-comm"]) do |ins| + [:local, :bin, :lib, :man, :ext, :"ext-arch", :"ext-comm", :rdoc]) do |ins| $install << ins end opt.on('--installed-list [FILENAME]') {|name| $installed_list = name} - opt.on('--rdoc-output') {|dir| $rdocdir = dir} + opt.on('--rdoc-output [DIR]') {|dir| $rdocdir = dir} opt.parse! rescue abort [$!.message, opt].join("\n") @@ -81,7 +81,6 @@ end parse_args() -include FileUtils::Verbose include FileUtils::NoWrite if $dryrun @fileutils_output = STDOUT @fileutils_label = '' @@ -115,10 +114,11 @@ def makedirs(dirs) realdir = with_destdir(dir) realdir unless $made_dirs.fetch(dir) do $made_dirs[dir] = true + $installed_list.puts(File.join(dir, "")) if $installed_list File.directory?(realdir) end end.compact! - super(dirs, :mode => 0755, :verbose => true) unless dirs.empty? + super(dirs, :mode => 0755) unless dirs.empty? end def install_recursive(src, dest, options = {}) @@ -169,6 +169,8 @@ lib = CONFIG["LIBRUBY"] arc = CONFIG["LIBRUBY_A"] install?(:local, :arch, :bin) do + puts "installing binary commands" + makedirs [bindir, libdir, archlibdir] install ruby_install_name+exeext, bindir, :mode => 0755 @@ -198,6 +200,7 @@ end if $extout extout = "#$extout" install?(:ext, :arch, :'ext-arch') do + puts "installing extension objects" makedirs [archlibdir, sitearchlibdir] if noinst = CONFIG["no_install_files"] and noinst.empty? noinst = nil @@ -205,6 +208,7 @@ if $extout install_recursive("#{extout}/#{CONFIG['arch']}", archlibdir, :no_install => noinst) end install?(:ext, :comm, :'ext-comm') do + puts "installing extension scripts" makedirs [rubylibdir, sitelibdir] install_recursive("#{extout}/common", rubylibdir) end @@ -212,7 +216,9 @@ end install?(:rdoc) do if $rdocdir - ridatadir = File.join(Config['datadir'], 'ri/$(MAJOR).$(MINOR)/system') + puts "installing rdoc" + + ridatadir = File.join(CONFIG['datadir'], 'ri/$(MAJOR).$(MINOR)/system') Config.expand(ridatadir) makedirs [ridatadir] install_recursive($rdocdir, ridatadir) @@ -220,6 +226,8 @@ install?(:rdoc) do end install?(:local, :comm, :bin) do + puts "installing command scripts" + Dir.chdir srcdir makedirs [bindir, rubylibdir] @@ -269,6 +277,13 @@ EOF } end end +end + +install?(:local, :comm, :lib) do + puts "installing library scripts" + + Dir.chdir srcdir + makedirs [rubylibdir] for f in Dir["lib/**/*{.rb,help-message}"] dir = File.dirname(f).sub!(/\Alib/, rubylibdir) || rubylibdir @@ -277,7 +292,9 @@ EOF end end -install?(:local, :arch, :bin) do +install?(:local, :arch, :lib) do + puts "installing headers" + Dir.chdir(srcdir) makedirs [archlibdir] for f in Dir["*.h"] @@ -292,6 +309,8 @@ install?(:local, :arch, :bin) do end install?(:local, :comm, :man) do + puts "installing manpages" + Dir.chdir(srcdir) for mdoc in Dir["*.[1-9]"] next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == '.'}