2
## by Sebastien Delafond <sdelafond@gmx.net>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: zonecheck-installer-rb.dpatch
6
## DP: - Adds a 'WWWCGIDIR' variable, in case the user wants to install the CGI
7
## DP: script in the system-wide cgi-bin directory, rather than in a sub. dir
8
## DP: of the application webroot.
9
## DP: Parses the *.html.* files accordingly.
10
## DP: - Installs HTML pages directly in the application webroot, rather than in
11
## DP: an html/ subdir.
14
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
18
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
19
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
22
-patch) patch $patch_opts -p1 < $0;;
23
-unpatch) patch $patch_opts -p1 -R < $0;;
25
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
31
--- zonecheck-2.0.4.orig/installer.rb 2004-03-05 09:22:56.000000000 -0800
32
+++ zonecheck-2.0.4/installer.rb 2004-09-15 21:45:11.000000000 -0700
34
ENV['DOCDIR' ] ||= "#{ENV['PREFIX']}/share/doc"
35
ENV['ETCDIR' ] ||= "#{ENV['PREFIX']}/etc"
36
ENV['CGIDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/cgi-bin"
37
- ENV['WWWDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/www"
38
+ ENV['WWWDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/www"
39
+ ENV['WWWCGIDIR' ] ||= "#{ENV['HTML_PATH']}/cgi-bin"
41
ENV['VERSION' ] ||= VERSION
46
puts "==> Patching HTML pages"
47
- Dir["#{@ch_wwwdir}/www/html/*.html.*"].each { |page|
48
- page_content = File.readlines(page)
49
- page_content.each { |line|
50
+ Dir["#{@ch_wwwdir}/*.html.*"].each { |page|
51
+ page_content = File.readlines(page)
52
+ page_content.each { |line|
53
+ line.gsub!(/HTML_PATH\/cgi-bin/, ENV['WWWCGIDIR'])
54
+ line.gsub!(/\/(fr|en)\/(.*)\"/, "/\\2.\\1\"" )
55
line.gsub!(/HTML_PATH/, ENV['HTML_PATH']) }
56
File::open(page, "w", 0644) { |io| io.puts page_content }
60
puts "==> Installing HTML pages"
61
mkdir_p @ch_wwwdir, :verbose => @verbose
62
- Dir["www/*"].each { |entry|
63
+ ["www/img", "www/js", "www/style"].each { |entry|
64
cp_r entry, @ch_wwwdir, :verbose => @verbose
66
+ Dir["www/html/*"].each { |entry|
67
+ cp entry, @ch_wwwdir, :verbose => @verbose
71
puts "==> Installing CGI"