wok-next view zonecheck/stuff/patches/10installer-rb.patch @ rev 21312

inkscape: added build dependency dbus-glib-dev
author Hans-G?nter Theisgen
date Tue Dec 10 15:00:13 2019 +0100 (2019-12-10)
parents
children
line source
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## filecSt9Ia.dpatch by Sebastien Delafond <sdelafond@gmx.net>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: better handling of the CGI home.
7 if [ $# -lt 1 ]; then
8 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
9 exit 1
10 fi
12 [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
13 patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
15 case "$1" in
16 -patch) patch $patch_opts -p1 < $0;;
17 -unpatch) patch $patch_opts -p1 -R < $0;;
18 *)
19 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
20 exit 1;;
21 esac
23 exit 0
25 diff -urNad zonecheck-2.0.4/installer.rb /tmp/dpep.gXpF1A/zonecheck-2.0.4/installer.rb
26 --- zonecheck-2.0.4/installer.rb 2005-01-21 16:29:46.000000000 -0800
27 +++ /tmp/dpep.gXpF1A/zonecheck-2.0.4/installer.rb 2005-01-21 16:29:57.000000000 -0800
28 @@ -55,7 +55,8 @@
29 ENV['DOCDIR' ] ||= "#{ENV['PREFIX']}/share/doc"
30 ENV['ETCDIR' ] ||= "#{ENV['PREFIX']}/etc"
31 ENV['CGIDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/cgi-bin"
32 - ENV['WWWDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/www"
33 + ENV['WWWDIR' ] ||= "#{ENV['LIBEXEC']}/#{ENV['PROGNAME']}/www"
34 + ENV['WWWCGIDIR' ] ||= "#{ENV['HTML_PATH']}/cgi-bin"
36 ENV['VERSION' ] ||= VERSION
38 @@ -165,8 +166,11 @@
39 def inst_cli
40 puts "==> Installing CLI"
41 mkdir_p "#{ENV['CHROOT']}#{ENV['BINDIR']}", :verbose => @verbose
42 - ln_s @zc, "#{ENV['CHROOT']}#{ENV['BINDIR']}/#{ENV['PROGNAME']}",
43 + @p = pwd
44 + cd @ch_installdir, :verbose => @verbose
45 + ln_s "../share/zonecheck/zc/zc.rb", "../../bin/#{ENV['PROGNAME']}",
46 :force => true, :verbose => @verbose
47 + cd @p
48 mkdir_p "#{ENV['CHROOT']}#{ENV['MANDIR']}/man1",:verbose => @verbose
49 install "man/zonecheck.1",
50 "#{ENV['CHROOT']}#{ENV['MANDIR']}/man1/#{ENV['PROGNAME']}.1",
51 @@ -177,9 +181,11 @@
53 def patch_cgi
54 puts "==> Patching HTML pages"
55 - Dir["#{@ch_wwwdir}/www/html/*.html.*"].each { |page|
56 - page_content = File.readlines(page)
57 - page_content.each { |line|
58 + Dir["#{@ch_wwwdir}/*.html.*"].each { |page|
59 + page_content = File.readlines(page)
60 + page_content.each { |line|
61 + line.gsub!(/HTML_PATH\/cgi-bin/, ENV['WWWCGIDIR'])
62 + line.gsub!(/\/(fr|en)\/(.*)\"/, "/\\2.\\1\"" )
63 line.gsub!(/HTML_PATH/, ENV['HTML_PATH']) }
64 File::open(page, "w", 0644) { |io| io.puts page_content }
65 }
66 @@ -189,15 +195,22 @@
67 def inst_cgi
68 puts "==> Installing HTML pages"
69 mkdir_p @ch_wwwdir, :verbose => @verbose
70 - Dir["www/*"].each { |entry|
71 + ["www/img", "www/js", "www/style"].each { |entry|
72 cp_r entry, @ch_wwwdir, :verbose => @verbose
73 }
74 + Dir["www/html/*"].each { |entry|
75 + cp entry, @ch_wwwdir, :verbose => @verbose
76 + }
77 puts
79 puts "==> Installing CGI"
80 + mkdir_p @ch_installdir, :verbose => @verbose
81 mkdir_p "#{ENV['CHROOT']}#{ENV['CGIDIR']}", :verbose => @verbose
82 - ln_s @zc, "#{ENV['CHROOT']}#{ENV['CGIDIR']}/zc.cgi",
83 + @p = pwd
84 + cd @ch_installdir, :verbose => @verbose
85 + ln_s "../../share/zonecheck/zc/zc.rb", "../../lib/cgi-bin/zc.cgi",
86 :force => true, :verbose => @verbose
87 + cd @p
88 puts
89 end