~ubuntu-branches/ubuntu/feisty/zonecheck/feisty

« back to all changes in this revision

Viewing changes to debian/patches/10installer-rb.dpatch

  • 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
#!/bin/sh -e
 
2
##  by Sebastien Delafond <sdelafond@gmx.net>
 
3
##
 
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.
 
12
 
 
13
if [ $# -lt 1 ]; then
 
14
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
15
    exit 1
 
16
fi
 
17
 
 
18
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
 
19
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
 
20
 
 
21
case "$1" in
 
22
       -patch) patch $patch_opts -p1 < $0;;
 
23
       -unpatch) patch $patch_opts -p1 -R < $0;;
 
24
        *)
 
25
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
26
                exit 1;;
 
27
esac
 
28
 
 
29
exit 0
 
30
 
 
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
 
33
@@ -55,7 +55,8 @@
 
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"
 
40
 
 
41
        ENV['VERSION'   ] ||= VERSION
 
42
 
 
43
@@ -177,9 +178,11 @@
 
44
 
 
45
     def patch_cgi
 
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 }
 
57
        }
 
58
@@ -189,9 +192,12 @@
 
59
     def inst_cgi
 
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
 
65
        }
 
66
+       Dir["www/html/*"].each { |entry|
 
67
+           cp entry, @ch_wwwdir,                       :verbose => @verbose
 
68
+       }
 
69
        puts
 
70
 
 
71
        puts "==> Installing CGI"