~ubuntu-branches/ubuntu/hoary/zonecheck/hoary

« back to all changes in this revision

Viewing changes to installer.rb

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Delafond
  • Date: 2004-09-22 21:20:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040922212012-uk2rrn8in6mjaroj
Tags: 2.0.4-3
* Added missing files to the installed documentation (Closes: #272964)
* Modified debian/rules to include /usr/share/dpatch/dpatch/make
* Patched doc/zonecheck.1 to escape '-' signs where needed (per 
  http://lists.debian.org/debian-devel/2003/03/msg01481.html) and sent
  patch to upstream.
  Package is now lintian/linda clean.
* Renamed dpatch files
* Changed last incorrect timestamp in changelog.Debian
* Added note to README.Debian in zonecheck-cgi, poiting to documentation
  in /usr/share/doc/zonecheck

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: installer.rb,v 1.14 2003/11/17 17:59:32 sdalu Exp $
 
1
# $Id: installer.rb,v 1.18 2004/03/05 17:22:56 sdalu Exp $
2
2
 
3
3
4
4
# CONTACT     : zonecheck@nic.fr
5
5
# AUTHOR      : Stephane D'Alu <sdalu@nic.fr>
6
6
#
7
7
# CREATED     : 2003/10/23 21:04:09
8
 
# REVISION    : $Revision: 1.14 $ 
9
 
# DATE        : $Date: 2003/11/17 17:59:32 $
 
8
# REVISION    : $Revision: 1.18 $ 
 
9
# DATE        : $Date: 2004/03/05 17:22:56 $
10
10
#
11
11
 
12
12
 
15
15
 
16
16
 
17
17
class Installer
18
 
    CVS_NAME    = %q$Name: ZC-2_0_2 $
 
18
    CVS_NAME    = %q$Name: ZC-2_0_4 $
19
19
    VERSION     = (Proc::new { 
20
20
                       n = CVS_NAME.split[1]
21
21
                       n = /^ZC-(.*)/.match(n) unless n.nil?
55
55
        ENV['DOCDIR'    ] ||= "#{ENV['PREFIX']}/share/doc"
56
56
        ENV['ETCDIR'    ] ||= "#{ENV['PREFIX']}/etc"
57
57
        ENV['CGIDIR'    ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/cgi-bin"
 
58
        ENV['WWWDIR'    ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/www"
58
59
 
59
60
        ENV['VERSION'   ] ||= VERSION
60
61
 
61
62
        @installdir    = "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}"
62
63
        @confdir       = "#{ENV['ETCDIR']}/#{ENV['PROGNAME']}#{ENV['ETCDIST']}"
63
64
        @zc            = "#{@installdir}/zc/zc.rb"
 
65
        @wwwdir        = "#{ENV['WWWDIR']}"
64
66
 
65
67
        @ch_installdir = "#{ENV['CHROOT']}#{@installdir}"
66
68
        @ch_confdir    = "#{ENV['CHROOT']}#{@confdir}"
67
69
        @ch_zc         = "#{ENV['CHROOT']}#{@zc}"
 
70
        @ch_wwwdir     = "#{ENV['CHROOT']}#{@wwwdir}"
68
71
 
69
72
        @verbose       = true
70
73
    end
122
125
                when Regexp
123
126
                    line.gsub!(pattern, value)
124
127
                when String
125
 
                    line.gsub!(/^(#{pattern}\s*=\s*).*/, value)
 
128
                    line.gsub!(/^(#{pattern}\s*=\s*(?:ENV\[[^\]]+\]\s*\|\|\s*)?).*/, value)
126
129
                end
127
130
            }
128
131
        }
174
177
 
175
178
    def patch_cgi
176
179
        puts "==> Patching HTML pages"
177
 
        Dir["#{@ch_installdir}/www/html/*.html.*"].each { |page|
 
180
        Dir["#{@ch_wwwdir}/www/html/*.html.*"].each { |page|
178
181
            page_content = File.readlines(page)
179
182
            page_content.each { |line| 
180
183
                line.gsub!(/HTML_PATH/, ENV['HTML_PATH']) }
185
188
 
186
189
    def inst_cgi
187
190
        puts "==> Installing HTML pages"
188
 
        cp_r "www", @ch_installdir,                     :verbose => @verbose
 
191
        mkdir_p @ch_wwwdir,                             :verbose => @verbose
 
192
        Dir["www/*"].each { |entry|
 
193
            cp_r entry, @ch_wwwdir,                     :verbose => @verbose
 
194
        }
189
195
        puts
190
196
 
191
197
        puts "==> Installing CGI"