$NetBSD: patch-aa,v 1.2 2010/09/10 07:34:35 taca Exp $ --- installer.rb.orig 2004-09-08 12:14:43.000000000 +0000 +++ installer.rb @@ -65,12 +65,13 @@ class Installer ENV['PROGNAME' ] ||= 'dnsdoctor' ENV['HTML_PATH' ] ||= "/#{ENV['PROGNAME']}" ENV['ETCDIST' ] ||= '' - ENV['CHROOT' ] ||= '' + ENV['CHROOT' ] ||= ENV['DESTDIR'] ENV['LIBEXEC' ] ||= "#{ENV['PREFIX']}/libexec" ENV['BINDIR' ] ||= "#{ENV['PREFIX']}/bin" ENV['MANDIR' ] ||= "#{ENV['PREFIX']}/man" ENV['DOCDIR' ] ||= "#{ENV['PREFIX']}/share/doc" + ENV['EGDIR' ] ||= "#{ENV['PREFIX']}/share/examples" ENV['ETCDIR' ] ||= "#{ENV['PREFIX']}/etc" ENV['CGIDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/cgi-bin" ENV['WWWDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/www" @@ -79,11 +80,13 @@ class Installer # Create some shortcut for later @installdir = "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}" + @egdir = "#{ENV['EGDIR']}/#{ENV['PROGNAME']}#{ENV['ETCDIST']}" @confdir = "#{ENV['ETCDIR']}/#{ENV['PROGNAME']}#{ENV['ETCDIST']}" @dnsdoctor = "#{@installdir}/dnsdoctor/zc.rb" @wwwdir = "#{ENV['WWWDIR']}" @ch_installdir = "#{ENV['CHROOT']}#{@installdir}" + @ch_egdir = "#{ENV['CHROOT']}#{@egdir}" @ch_confdir = "#{ENV['CHROOT']}#{@confdir}" @ch_dnsdoctor = "#{ENV['CHROOT']}#{@dnsdoctor}" @ch_wwwdir = "#{ENV['CHROOT']}#{@wwwdir}" @@ -141,8 +144,7 @@ class Installer def patch_common puts "==> Patching core components" dnsdoctor_content = File.readlines(@ch_dnsdoctor) - [ [ /^\#!.*ruby/, "#!#{ENV['RUBY']}" ], - [ 'DDOC_INSTALL_PATH', "\\1\"#{@installdir}\"" ], + [ [ 'DDOC_INSTALL_PATH', "\\1\"#{@installdir}\"" ], [ 'DDOC_CONFIG_DIR', "\\1\"#{ENV['ETCDIR']}/#{ENV['PROGNAME']}\""], [ 'DDOC_LOCALIZATION_DIR', "\\1\"#{@installdir}/locale\"" ], [ 'DDOC_TEST_DIR', "\\1\"#{@installdir}/test\"" ], @@ -181,10 +183,10 @@ class Installer puts puts "==> Installing default configuration file" - mkdir_p @ch_confdir, :verbose => @verbose - cp 'etc/dnsdoctor/dnsdoctor.conf', @ch_confdir, :verbose => @verbose - cp 'etc/dnsdoctor/rootservers', @ch_confdir, :verbose => @verbose - cp Dir['etc/dnsdoctor/*.profile'], @ch_confdir, :verbose => @verbose + mkdir_p @ch_egdir, :verbose => @verbose + cp 'etc/dnsdoctor/dnsdoctor.conf', @ch_egdir, :verbose => @verbose + cp 'etc/dnsdoctor/rootservers', @ch_egdir, :verbose => @verbose + cp Dir['etc/dnsdoctor/*.profile'], @ch_egdir, :verbose => @verbose puts end @@ -217,6 +219,7 @@ class Installer puts "==> Installing HTML pages" mkdir_p @ch_wwwdir, :verbose => @verbose Dir["www/*"].each { |entry| + next if entry =~ /dnsdoctor.conf.*/ cp_r entry, @ch_wwwdir, :verbose => @verbose } puts @@ -323,7 +326,7 @@ info = false # Sanity check # rubyver = `#{ENV['RUBY']} --version` -m = /^ruby\s+(\d+)\.(\d+)\.(\d+)\s+/.match(rubyver) +m = /^ruby\s+(\d+)\.(\d+)\.([p0-9]+)\s+/.match(rubyver) if m.nil? $stderr.puts "ERROR: Invalid interpreter: #{ENV['RUBY']}" exit EXIT_ERROR