noninteractive_install.diff 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. diff -Naur html2ps-1.0b7/install html2ps-1.0b7.patched/install
  2. --- html2ps-1.0b7/install 2010-05-07 07:22:12.000000000 -0400
  3. +++ html2ps-1.0b7.patched/install 2014-09-12 13:31:05.000000000 -0400
  4. @@ -33,33 +33,6 @@
  5. }
  6. @perl = ("Image${dirsep}Magick.pm", "LWP${dirsep}UserAgent.pm");
  7. -print <<EOD;
  8. -
  9. -This is the installation script for html2ps. To get full functionality, some
  10. -external program packages need to be installed. You may wish to install these
  11. -first (see the enclosed documentation for addresses):
  12. -
  13. - * For conversion on inline images, any of the packages ImageMagick, pbmplus
  14. - or netpbm.
  15. -
  16. - * To retrieve remote documents you must have libwww-perl. Alternatively,
  17. - some program like wget or lynx.
  18. -
  19. - * To be able to generate cross references and DSC PostScript, you must
  20. - have Ghostscript installed.
  21. -
  22. - * To be able to convert documents using the MATH element from HTML 3.0,
  23. - you need both TeX and dvips.
  24. -
  25. -This script creates a file describing the local configuration. To make this
  26. -accurate, you should have your search PATH set to include the directories
  27. -where the abovementioned packages are. You must also have write access to
  28. -the directories where the files should be placed.
  29. -EOD
  30. -
  31. -&getval($goon, "y", "\nDo you want to proceed with the installation?");
  32. -die "\n" if($goon!~/^y/i);
  33. -
  34. print "\n";
  35. for $req (@perl) {
  36. print "Searching for $req: ";
  37. @@ -103,30 +76,10 @@
  38. $pack .= " check: weblint;\n";
  39. }
  40. -if($module{"LWP${dirsep}UserAgent.pm"}) {
  41. - $pack .= " libwww-perl: 1;\n";
  42. -} else {
  43. - if(&exist("lynx",0)) {
  44. - $lynx = 1;
  45. - $lynxcmd = "lynx -source -mime_header";
  46. - $getdef = $lynxcmd;
  47. - }
  48. - if(&exist("wget",0)) {
  49. - $wget = 1;
  50. - $ugcmd = "wget -s -q -O-";
  51. - $getdef = $ugcmd;
  52. - }
  53. - $both = $wget && $lynx? " (for example '$ugcmd' or\n'$lynxcmd')": "";
  54. - $none = $wget || $lynx? "":
  55. - ", or press <return> to convert local files only";
  56. - &getval($geturl, $getdef,
  57. - "\nBy default html2ps uses libwww-perl to retrieve remote documents, "
  58. - ."I cannot\nfind this on your system. You may instead use some command "
  59. - ."that can retrieve\ndocuments _with_a_complete_MIME_header_$both\.\n"
  60. - ."Enter such a command$none");
  61. - $geturl = "/bin/true" if(!$geturl);
  62. - $pack .= " geturl: \"$geturl\";\n";
  63. -}
  64. +$lynx = 1;
  65. +$lynxcmd = "lynx -source -mime_header";
  66. +$geturl = $lynxcmd;
  67. +$pack .= " geturl: \"$geturl\";\n";
  68. if(@reqpath) {
  69. $pack .= ' path: "'.join($pathsep, @reqpath).'";';
  70. @@ -134,155 +87,22 @@
  71. chop ($cd = `pwd`);
  72. -&getval($ans, "y",
  73. - "\nBy default all files will be installed in subdirectories 'bin', 'lib',\n"
  74. - ."and 'man' in a common directory. Is this OK?");
  75. -$def = $ans=~/^y/i;
  76. -
  77. -if($def) {
  78. - &getval($prefix, "$prefix", "\nEnter the name of this directory");
  79. - &fixdir($prefix);
  80. - while(!&goodprefix) {
  81. - &getval($prefix, "$prefix", "\nEnter a new directory name");
  82. - }
  83. - &makedir($prefix,0);
  84. -}
  85. -
  86. -if($def) {
  87. - $bindir = "$prefix${dirsep}bin";
  88. -} else {
  89. - &getval($bindir, "$prefix${dirsep}bin",
  90. - "\nEnter the directory where the html2ps script should be put");
  91. - &fixdir($bindir);
  92. - ($prefix) = $bindir=~m|(.*)\Q$dirsep\E[^\Q$dirsep\E]+|;
  93. -}
  94. -&makedir($bindir,$def);
  95. +$bindir = "$ENV{PKG}/usr/bin";
  96. -if($def) {
  97. - $glob = "$prefix${dirsep}lib${dirsep}html2ps";
  98. -} else {
  99. - &getval($glob, "$prefix${dirsep}lib${dirsep}html2ps",
  100. - "\nEnter the the directory where the global configuration file for\n"
  101. - ."html2ps should be put");
  102. - $glob =~ s|/$||g;
  103. - &fixdir($glob);
  104. -}
  105. -&makedir($glob,$def);
  106. $repl = "y";
  107. -if(-f "$glob${dirsep}html2psrc") {
  108. - &getval($repl, "y", "\nA file $glob${dirsep}html2psrc already exists, replace?");
  109. -}
  110. +$glob = "$ENV{PKG}/usr/share/html2ps";
  111. -if($def) {
  112. - $man1 = "$prefix${dirsep}man${dirsep}man1";
  113. -} else {
  114. - &getval($man1, "$prefix${dirsep}man${dirsep}man1",
  115. - "\nEnter the directory for the html2ps manual page");
  116. - &fixdir($man1);
  117. -}
  118. -&makedir($man1,$def);
  119. -
  120. -if($def) {
  121. - $man5 = "$prefix${dirsep}man${dirsep}man5";
  122. -} else {
  123. - &getval($man5, "$prefix${dirsep}man${dirsep}man5",
  124. - "\nEnter the directory for the manual page describing the configuration\n"
  125. - ."file format for html2ps");
  126. - &fixdir($man5);
  127. -}
  128. -&makedir($man5,$def);
  129. +$man1 = "$ENV{PKG}/usr/man/man1";
  130. +$man5 = "$ENV{PKG}/usr/man/man5";
  131. -$ht = "\nTo use the automatic hyphenation feature, hyphenation pattern files\n"
  132. - ."from the TeX distribution are needed.";
  133. $cophy = 1;
  134. -if($exist{'TeX'}) {
  135. - $hfile = "";
  136. - ($texdir = $dir{'TeX'}) =~ s|/bin$||;
  137. - SW:for("texmf/tex/generic/hyphen","macros","inputs","lib/macros",
  138. - "lib/inputs","lib/tex/macros","lib/tex/inputs") {
  139. - if(-f "$texdir/$_/ushyph1.tex") {
  140. - $hyph = "$texdir/$_";
  141. - $hfile = "$hyph/ushyph1.tex";
  142. - last SW;
  143. - }
  144. - if(-f "$texdir/$_/hyphen.tex") {
  145. - $hyph = "$texdir/$_";
  146. - $hfile = "$hyph/hyphen.tex";
  147. - last SW;
  148. - }
  149. - }
  150. - if($hfile) {
  151. - &getval($hdef, "y", "$ht I believe that I have found\nthe pattern "
  152. - ."file for English in your TeX installation:\n\n "
  153. - ."$hfile\n\nWould you like to use this instead of the "
  154. - ."file included with html2ps?");
  155. - if($hdef=~/^y/i) {
  156. - $cophy = 0;
  157. - } else {
  158. - $hfile = "";
  159. - }
  160. - } else {
  161. - &getval($hfile, "", "$ht I cannot find the pattern\nfile for English "
  162. - ."in your TeX installation. (It should be called\n'hyphen.tex', "
  163. - ."or perhaps 'ushyph1.tex', somewhere in the directory\ntree "
  164. - ."'$texdir'.)\n\nIf you know where this file is and want to use it "
  165. - ."instead of the\nfile included with html2ps, enter the full path "
  166. - ."name for this file,\notherwise press <return>");
  167. - while($hfile && !-f $hfile) {
  168. - &getval($hfile, "", "\nNo such file: $hfile\nEnter new name, or "
  169. - ."press <return> to use the supplied file");
  170. - }
  171. - $cophy = $hfile !~ /\S/;
  172. - }
  173. - if(!$hfile) {
  174. - if($def) {
  175. - $hyph = "$prefix${dirsep}lib${dirsep}html2ps";
  176. - } else {
  177. - &getval($hyph, "$prefix${dirsep}lib${dirsep}html2ps",
  178. - "\nOK, I will use the supplied pattern file for English. Enter "
  179. - ."the directory\nwhere this file should be put");
  180. - &fixdir($hyph);
  181. - }
  182. - }
  183. -} else {
  184. - if($def) {
  185. - $hyph = "$prefix${dirsep}lib${dirsep}html2ps";
  186. - } else {
  187. - &getval($hyph, "$prefix${dirsep}lib${dirsep}html2ps", "$ht A pattern file for English is\n"
  188. - ."included with html2ps (see the documentation how to install pattern\n"
  189. - ."files for other languages). Enter the directory where this file\n"
  190. - ."should be put");
  191. - }
  192. -}
  193. -if($cophy) {
  194. - &makedir($hyph,0);
  195. - $hfile = "$hyph${dirsep}hyphen.tex";
  196. -}
  197. +$hyph = $glob;
  198. +$hfile = $glob . "/hyphen.tex";
  199. -if($def) {
  200. - $html = "$prefix${dirsep}lib${dirsep}html2ps";
  201. -} else {
  202. - &getval($html, "$prefix${dirsep}lib${dirsep}html2ps",
  203. - "\nEnter a directory where to put the HTML document describing\nhtml2ps");
  204. - &fixdir($html);
  205. -}
  206. -&makedir($html,$def);
  207. +$html = "$ENV{PKG}/usr/doc/html2ps-$ENV{VERSION}";
  208. -$paper = "";
  209. -&getval($format, "A4",
  210. - "\nEnter the default paper type, possible choices are:\nA0, A1, A2, A3, A4,"
  211. - ." A5, A6, A7, A8, A9, A10,\nB0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10,\n"
  212. - ."letter, legal, arche, archd, archc, archb, archa,\nflsa, flse, halfletter,"
  213. - ." 11x17, ledger, other");
  214. -if($format !~ /^other$/i) {
  215. - $paper .= " type: $format;";
  216. -} else {
  217. - &getval($height, "",
  218. - "\nDefault paper height i centimeters (1 inch = 2.54 centimeters)");
  219. - &getval($width, "", "\nDefault paper width i centimeters");
  220. - $paper .= " height: $height;\n";
  221. - $paper .= " width: $width;";
  222. -}
  223. +$format = "letter";
  224. +$paper = " type: $format;";
  225. open(RC,">html2psrc") || die "*** Error opening html2psrc\n";
  226. print RC "/* Global configuration file for html2ps */\n\n"