instead of setuid man, how about this?  a number of people got back to me, 
so i know i'm not the only one irked by the fact that packages don't have 
cat pages.  probably a better way to solve this problem is to make them 
before the package is created.

this diff isn't complete, because i don't know enough about how the 
packaging code works.  i think this is about the right place to create the 
man pages.  i think my tree's a little behind, the bsd.port.mk chunk goes 
near the end of FAKE_COOKIE.

marc, is something like this doable?


Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.893
diff -u -r1.893 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       1 May 2007 17:17:54 -0000       1.893
+++ infrastructure/mk/bsd.port.mk       15 May 2007 05:58:42 -0000
@@ -2159,6 +2159,7 @@
 .if target(post-install)
        @cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${MAKE} post-install 
${_FAKE_SETUP}
 .endif
+       ${PORTSDIR}/infrastructure/package/makeman ${WRKINST}${TRUEPREFIX}/man
 .for _p in ${PROTECT_MOUNT_POINTS}
        @${SUDO} mount -u -w ${_p}
 .endfor
--- /dev/null   Mon May 14 23:01:07 2007
+++ infrastructure/package/makeman      Mon May 14 23:00:54 2007
@@ -0,0 +1,38 @@
+#! /usr/bin/perl -w
+
+# Copyright (c) 2007 Ted Unangst
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+use strict;
+
+my $base = "/usr/local/man";
+if (defined($ARGV[0])) {
+       $base = $ARGV[0];
+}
+
+my $file;
+foreach my $i (1 .. 9) {
+       my $dirname = "$base/man$i";
+       opendir(DIR, $dirname) or die "can't open dir";
+       while (defined($file = readdir(DIR))) {
+               next if ($file !~ /([[:alnum:]]*)\.$i/);
+               my $man = $1;
+               my $cat = "$base/cat$i/$man.0";
+               if (! -e $cat && -f "$dirname/$file" && -s _ > 64) {
+                       system("/usr/bin/nroff -man $dirname/$file > $cat");
+               }
+               
+       }
+       closedir(DIR);
+}

Reply via email to