$NetBSD: patch-aa,v 1.3 2005/12/04 17:02:54 kim Exp $

--- install.orig	2005-03-03 14:25:29.000000000 +0200
+++ install	2005-12-04 18:54:52.000000000 +0200
@@ -17,7 +17,7 @@
     $pathsep = ':';
     $dirsep = '/';
     $sys = 'unix';
-    $prefix = '/usr/local';
+    $prefix = $ARGV[0];
 } elsif (-e 'nul') {
     $pathsep = ';';
     $dirsep = '\\';
@@ -57,8 +57,8 @@
 the directories where the files should be placed.
 EOD
 
-&getval($goon, "y", "\nDo you want to proceed with the installation?");
-die "\n" if($goon!~/^y/i);
+#&getval($goon, "y", "\nDo you want to proceed with the installation?");
+#die "\n" if($goon!~/^y/i);
 
 print "\n";
 for $req (@perl) {
@@ -134,19 +134,22 @@
 
 chop ($cd = `pwd`);
 
-&getval($ans, "y",
- "\nBy default all files will be installed in subdirectories 'bin', 'lib',\n"
- ."and 'man' in a common directory. Is this OK?");
-$def = $ans=~/^y/i;
+$sharedir = "share";
 
-if($def) {
-    &getval($prefix, "$prefix", "\nEnter the name of this directory");
-    &fixdir($prefix);
-    while(!&goodprefix) {
-	&getval($prefix, "$prefix", "\nEnter a new directory name");
-    }
-    &makedir($prefix,0);
-}
+#&getval($ans, "y",
+# "\nBy default all files will be installed in subdirectories 'bin', '$sharedir',\n"
+# ."and 'man' in a common directory. Is this OK?");
+#$def = $ans=~/^y/i;
+$def = 1;
+
+#if($def) {
+#    &getval($prefix, "$prefix", "\nEnter the name of this directory");
+#    &fixdir($prefix);
+#    while(!&goodprefix) {
+#	&getval($prefix, "$prefix", "\nEnter a new directory name");
+#    }
+#    &makedir($prefix,0);
+#}
 
 if($def) {
     $bindir = "$prefix${dirsep}bin";
@@ -159,9 +162,9 @@
 &makedir($bindir,$def);
 
 if($def) {
-    $glob = "$prefix${dirsep}lib${dirsep}html2ps";
+    $glob = "$prefix${dirsep}${sharedir}${dirsep}html2ps";
 } else {
-    &getval($glob, "$prefix${dirsep}lib${dirsep}html2ps",
+    &getval($glob, "$prefix${dirsep}${sharedir}${dirsep}html2ps",
      "\nEnter the the directory where the global configuration file for\n"
     ."html2ps should be put");
     $glob =~ s|/$||g;
@@ -198,7 +201,7 @@
 if($exist{'TeX'}) {
     $hfile = "";
     ($texdir = $dir{'TeX'}) =~ s|/bin$||;
-    SW:for("texmf/tex/generic/hyphen","macros","inputs","lib/macros",
+    SW:for("share/texmf/tex/generic/hyphen","macros","inputs","lib/macros",
         "lib/inputs","lib/tex/macros","lib/tex/inputs") {
         if(-f "$texdir/$_/ushyph1.tex") {
             $hyph = "$texdir/$_";
@@ -212,15 +215,15 @@
         }
     }
     if($hfile) {
-        &getval($hdef, "y", "$ht I believe that I have found\nthe pattern "
-         ."file for English in your TeX installation:\n\n  "
-         ."$hfile\n\nWould you like to use this instead of the "
-         ."file included with html2ps?");
-        if($hdef=~/^y/i) {
+#        &getval($hdef, "y", "$ht I believe that I have found\nthe pattern "
+#         ."file for English in your TeX installation:\n\n  "
+#         ."$hfile\n\nWould you like to use this instead of the "
+#         ."file included with html2ps?");
+#        if($hdef=~/^y/i) {
             $cophy = 0;
-        } else {
-            $hfile = "";
-        }
+#        } else {
+#            $hfile = "";
+#        }
     } else {
         &getval($hfile, "", "$ht I cannot find the pattern\nfile for English "
          ."in your TeX installation. (It should be called\n'hyphen.tex', "
@@ -236,9 +239,9 @@
     }
     if(!$hfile) {
         if($def) {
-            $hyph = "$prefix${dirsep}lib${dirsep}html2ps";
+            $hyph = "$prefix${dirsep}${sharedir}${dirsep}html2ps";
         } else {
-            &getval($hyph, "$prefix${dirsep}lib${dirsep}html2ps",
+            &getval($hyph, "$prefix${dirsep}${sharedir}${dirsep}html2ps",
              "\nOK, I will use the supplied pattern file for English. Enter "
             ."the directory\nwhere this file should be put");
             &fixdir($hyph);
@@ -246,9 +249,9 @@
     }
 } else {
     if($def) {
-        $hyph = "$prefix${dirsep}lib${dirsep}html2ps";
+        $hyph = "$prefix${dirsep}${sharedir}${dirsep}html2ps";
     } else {
-    &getval($hyph, "$prefix${dirsep}lib${dirsep}html2ps", "$ht A pattern file for English is\n"
+    &getval($hyph, "$prefix${dirsep}${sharedir}${dirsep}html2ps", "$ht A pattern file for English is\n"
      ."included with html2ps (see the documentation how to install pattern\n"
      ."files for other languages). Enter the directory where this file\n"
      ."should be put");
@@ -260,20 +263,21 @@
 }
 
 if($def) {
-    $html = "$prefix${dirsep}lib${dirsep}html2ps";
+    $html = "$prefix${dirsep}${sharedir}${dirsep}html2ps";
 } else {
-    &getval($html, "$prefix${dirsep}lib${dirsep}html2ps",
+    &getval($html, "$prefix${dirsep}${sharedir}${dirsep}html2ps",
      "\nEnter a directory where to put the HTML document describing\nhtml2ps");
     &fixdir($html);
 }
 &makedir($html,$def);
 
-$paper = "";
-&getval($format, "A4",
- "\nEnter the default paper type, possible choices are:\nA0, A1, A2, A3, A4,"
- ." A5, A6, A7, A8, A9, A10,\nB0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10,\n"
- ."letter, legal, arche, archd, archc, archb, archa,\nflsa, flse, halfletter,"
- ." 11x17, ledger, other");
+$format = "letter";
+#$paper = "";
+#&getval($format, "A4",
+# "\nEnter the default paper type, possible choices are:\nA0, A1, A2, A3, A4,"
+# ." A5, A6, A7, A8, A9, A10,\nB0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10,\n"
+# ."letter, legal, arche, archd, archc, archb, archa,\nflsa, flse, halfletter,"
+# ." 11x17, ledger, other");
 if($format !~ /^other$/i) {
     $paper .= "    type: $format;";
 } else {
@@ -431,7 +435,7 @@
     copy $from => $_[0].$dirsep.$_[1] or die "*** Cannot write to $_[0]\n";
 }
 sub goodprefix {
-    for ($prefix, "$prefix${dirsep}bin", "$prefix${dirsep}lib",
+    for ($prefix, "$prefix${dirsep}bin", "$prefix${dirsep}${sharedir}",
 	 "$prefix${dirsep}man")
     {
 	if (-d $_ && !-w $_) {
