summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-10-03 07:52:42 +0000
committerMike Frysinger <vapier@gentoo.org>2004-10-03 07:52:42 +0000
commit16db29ab7956084de73ac8613b83a848f1286849 (patch)
tree7c972e46816ae69dab8207ef7deeff4e9b2596e3 /sys-apps/man
parentclean up (Manifest recommit) (diff)
downloadgentoo-2-16db29ab7956084de73ac8613b83a848f1286849.tar.gz
gentoo-2-16db29ab7956084de73ac8613b83a848f1286849.tar.bz2
gentoo-2-16db29ab7956084de73ac8613b83a848f1286849.zip
fix locale support #37778
Diffstat (limited to 'sys-apps/man')
-rw-r--r--sys-apps/man/ChangeLog8
-rw-r--r--sys-apps/man/files/digest-man-1.5m-r21
-rw-r--r--sys-apps/man/files/man-1.5k-groff-1.18.patch23
-rw-r--r--sys-apps/man/files/man-1.5k-locale-debug-info.patch57
-rw-r--r--sys-apps/man/files/man-1.5k-redhat-patches.patch247
-rw-r--r--sys-apps/man/files/man-1.5k-search-order.patch16
-rw-r--r--sys-apps/man/files/man-1.5k-util_c-segfault.patch67
-rw-r--r--sys-apps/man/files/man-1.5k-wrong-quotes.patch11
-rw-r--r--sys-apps/man/files/man-1.5l-LL-linelength.patch10
-rw-r--r--sys-apps/man/files/man-1.5l-groff-1.18.patch24
-rw-r--r--sys-apps/man/files/man-1.5l-locale-debug-info.patch57
-rw-r--r--sys-apps/man/files/man-1.5l-redhat-patches.patch241
-rw-r--r--sys-apps/man/files/man-1.5l-search-order.patch16
-rw-r--r--sys-apps/man/files/man-1.5l-security.patch22
-rw-r--r--sys-apps/man/files/man-1.5l-util_c-segfault.patch67
-rw-r--r--sys-apps/man/files/man-1.5l-wrong-quotes-v2.patch11
-rw-r--r--sys-apps/man/files/man-1.5l-wrong-quotes.patch11
-rw-r--r--sys-apps/man/files/man-1.5m-locale-order.patch11
-rw-r--r--sys-apps/man/man-1.5m-r2.ebuild146
19 files changed, 165 insertions, 881 deletions
diff --git a/sys-apps/man/ChangeLog b/sys-apps/man/ChangeLog
index 91c2f2a4cea0..2aeae7ce5b28 100644
--- a/sys-apps/man/ChangeLog
+++ b/sys-apps/man/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-apps/man
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/ChangeLog,v 1.58 2004/09/25 06:10:02 kumba Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/ChangeLog,v 1.59 2004/10/03 07:52:42 vapier Exp $
+
+*man-1.5m-r2 (03 Oct 2004)
+
+ 03 Oct 2004; Mike Frysinger <vapier@gentoo.org>
+ +files/man-1.5m-locale-order.patch, +man-1.5m-r2.ebuild:
+ Add patch to fix locale support #37778 by Magnus Lind / Antti Mäkelä.
25 Sep 2004; Joshua Kinard <kumba@gentoo.org> man-1.5m-r1.ebuild:
Marked stable on mips.
diff --git a/sys-apps/man/files/digest-man-1.5m-r2 b/sys-apps/man/files/digest-man-1.5m-r2
new file mode 100644
index 000000000000..40276c035044
--- /dev/null
+++ b/sys-apps/man/files/digest-man-1.5m-r2
@@ -0,0 +1 @@
+MD5 d27867e59d3bbb971b00058f20ef8ea4 man-1.5m2.tar.gz 228145
diff --git a/sys-apps/man/files/man-1.5k-groff-1.18.patch b/sys-apps/man/files/man-1.5k-groff-1.18.patch
deleted file mode 100644
index 57d8d9c32e66..000000000000
--- a/sys-apps/man/files/man-1.5k-groff-1.18.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- man-1.5k/configure.orig 2002-12-26 06:23:53.000000000 +0200
-+++ man-1.5k/configure 2002-12-26 06:25:14.000000000 +0200
-@@ -427,9 +427,9 @@
- then
- if test $Fnroff = "missing"
- then
-- nroff="nroff -mandoc"
-+ nroff="nroff -c -mandoc"
- else
-- nroff="$Fnroff -mandoc"
-+ nroff="$Fnroff -c -mandoc"
- fi
- troff="troff -mandoc"
- echo "Warning: could not find groff"
-@@ -438,7 +438,7 @@
- then
- nroff="$Fgroff -Tlatin1 -mandoc"
- else
-- nroff="$Fnroff -mandoc"
-+ nroff="$Fnroff -c -mandoc"
- fi
- troff="$Fgroff -Tps -mandoc"
- jnroff="$Fgroff -Tnippon -mandocj"
diff --git a/sys-apps/man/files/man-1.5k-locale-debug-info.patch b/sys-apps/man/files/man-1.5k-locale-debug-info.patch
deleted file mode 100644
index bf51f46a9a71..000000000000
--- a/sys-apps/man/files/man-1.5k-locale-debug-info.patch
+++ /dev/null
@@ -1,57 +0,0 @@
- Do not print the 'man: No such file or directory' error if
- 'man -d' was called and the NLS catalogue was not found, as
- it confuses people, and be more informative. More info at:
-
- http://bugs.gentoo.org/show_bug.cgi?id=
-
-
- Martin Schlemmer <azarah@gentoo.org> (26 Dec 2002).
-
---- man-1.5k/catopen/catopen.c.orig 2002-12-26 08:25:07.000000000 +0200
-+++ man-1.5k/catopen/catopen.c 2002-12-26 10:25:06.000000000 +0200
-@@ -10,7 +10,11 @@
- extern char *my_malloc(int); /* in util.c */
-
- #ifndef DEFAULT_NLSPATH
--#define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L"
-+# if __GLIBC__ >= 2
-+# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N"
-+# else
-+# define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L"
-+# endif
- #endif
-
- static nl_catd my_catopenpath(char *name, char *path);
---- man-1.5k/src/gripes.c.orig 2002-12-26 08:13:53.000000000 +0200
-+++ man-1.5k/src/gripes.c 2002-12-26 10:29:46.000000000 +0200
-@@ -47,14 +47,25 @@
- if (!lg)
- lg = getenv("LC_ALL");
- if ((s || lg) && (!lg || strncmp(lg, "en", 2))) {
-- perror(mantexts);
-+ /* This prints 'man: No such file or directory' which
-+ * confuses people. The fprintf message should really
-+ * be enouth ...
-+ */
-+/* perror(mantexts); */
-+
- fprintf(stderr,
--"Failed to open the message catalog %s on the path NLSPATH=%s\n\n",
-- mantexts, s ? s : "<none>");
-+"Failed to open the message catalog \"%s\" for locale \"%s\"\n\
-+(NLSPATH=\"%s\")\n\n",
-+ mantexts, lg ? lg : "<none>",
-+ s ? s : DEFAULT_NLSPATH);
- } else if (debug) {
-- perror(mantexts);
-+ /* This prints 'man: No such file or directory' which
-+ * confuses people. The fprintf message should really
-+ * be enouth ...
-+ */
-+/* perror(mantexts); */
- fprintf(stderr,
--"Looked whether there exists a message catalog %s, but there is none
-+"Looked whether there exists a message catalog \"%s\", but there is none\n\
- (and for English messages none is needed)\n\n",
- mantexts);
- }
diff --git a/sys-apps/man/files/man-1.5k-redhat-patches.patch b/sys-apps/man/files/man-1.5k-redhat-patches.patch
deleted file mode 100644
index 99fbc3442832..000000000000
--- a/sys-apps/man/files/man-1.5k-redhat-patches.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-diff -Narup man-1.5k.orig/gencat/genlib.c man-1.5k/gencat/genlib.c
---- man-1.5k.orig/gencat/genlib.c 1997-12-02 08:23:30.000000000 -0500
-+++ man-1.5k/gencat/genlib.c 2002-12-19 09:16:38.000000000 -0500
-@@ -47,6 +47,7 @@ up-to-date. Many thanks.
- 01/14/91 4 nazgul Off by one on number specified entries
- */
-
-+#undef _GNU_SOURCE
- #include <stdio.h>
- #ifdef SYSV
- #include <sys/types.h>
-diff -Narup man-1.5k.orig/src/apropos.sh man-1.5k/src/apropos.sh
---- man-1.5k.orig/src/apropos.sh 2001-11-22 18:30:42.000000000 -0500
-+++ man-1.5k/src/apropos.sh 2002-12-19 09:16:09.000000000 -0500
-@@ -18,9 +18,9 @@ program=`basename $0`
-
- # When man pages in your favorite locale look to grep like binary files
- # (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
--aproposgrepopt1='i'
-+aproposgrepopt1='ia'
- aproposgrepopt2=''
--whatisgrepopt1='iw'
-+whatisgrepopt1='iwa'
- whatisgrepopt2='^'
- grepopt1=$%apropos_or_whatis%grepopt1
- grepopt2=$%apropos_or_whatis%grepopt2
-@@ -69,7 +69,7 @@ nothing=
- found=0
- while [ $found = 0 -a -n "$1" ]
- do
-- for d in $manpath /usr/lib
-+ for d in /var/cache/man /usr/lib
- do
- if [ -f $d/whatis ]
- then
-@@ -103,7 +103,7 @@ do
- done
- nothing=
- found=0
-- for d in $manpath /usr/lib
-+ for d in /var/cache/man $manpath /usr/lib
- do
- if [ -f $d/whatis ]
- then
-diff -Narup man-1.5k.orig/src/makewhatis.sh man-1.5k/src/makewhatis.sh
---- man-1.5k.orig/src/makewhatis.sh 2002-07-17 14:59:05.000000000 -0400
-+++ man-1.5k/src/makewhatis.sh 2002-12-19 09:24:14.000000000 -0500
-@@ -36,8 +36,8 @@ program=`basename $0`
- # In case both /usr/man and /usr/share/manexist, the former is local
- # and should be first.
- # It is a bug to add /var/cache/man to DEFCATPATH.
--DEFMANPATH=/usr/man:/usr/share/man
--DEFCATPATH=/usr/man/preformat:/usr/man:/usr/share/man/preformat:/usr/share/man
-+DEFMANPATH=/usr/share/man:/usr/X11R6/man:/usr/local/man:/usr/man
-+DEFCATPATH=/var/cache/man:/usr/share/man/preformat:/usr/man/preformat:$DEFMANPATH
-
- # In case /usr is read-only, make /usr/man/whatis (etc) a symlink to
- # something like /var/cache/man/whatis.
-@@ -52,12 +52,12 @@ AWK=%awk%
- # We try here to be careful (and avoid preconstructed symlinks)
- # in case makewhatis is run as root, by creating a subdirectory of /tmp.
-
--TMPFILEDIR=/tmp/whatis.tmp.dir.$$
--rm -rf TMPFILEDIR
--if ! mkdir -m 0700 $TMPFILEDIR; then
-- echo Could not create $TMPFILEDIR
-- exit 1;
-+TMPFILEDIR=`mktemp -d /tmp/makewhatisXXXXXX`
-+if [ $? -ne 0 ]; then
-+ echo "$0: Can't create temp file, exiting..."
-+ exit 1
- fi
-+chmod 0700 $TMPFILEDIR
- TMPFILE=$TMPFILEDIR/w
-
- # make sure TMPFILEDIR is deleted if program is killed or terminates
-@@ -88,8 +88,10 @@ case $name in
- continue;;
- -s) setsections=1
- continue;;
-- -u) findarg="-ctime 0"
-- update=1
-+ -u) if [ -e /var/cache/man/whatis ]; then
-+ findarg="-newer /var/cache/man/whatis"
-+ update=1
-+ fi
- continue;;
- -v) verbose=1
- continue;;
-@@ -128,14 +130,7 @@ catpath=`echo ${catpath} | tr : ' '`
- # first truncate all the whatis files that will be created new,
- # then only update - we might visit the same directory twice
- if [ x$update = x ]; then
-- for pages in man cat
-- do
-- eval path="\$$pages"path
-- for mandir in $path
-- do
-- cp /dev/null $mandir/whatis
-- done
-- done
-+ cp /dev/null /var/cache/man/whatis
- fi
-
- for pages in man cat
-@@ -144,14 +139,10 @@ do
- eval path="\$$pages"path
- for mandir in $path
- do
-- if [ x$verbose != x ]; then
-- echo "about to enter $mandir" > /dev/tty
-- fi
-- if [ -s ${mandir}/whatis -a $pages = man -a x$update = x ]; then
-- if [ x$verbose != x ]; then
-- echo skipping $mandir - we did it already > /dev/tty
-- fi
-- else
-+ [ -d "$mandir" ] || continue
-+ if [ x$verbose != x ]; then
-+ echo "about to enter $mandir" > /dev/stderr
-+ fi
- here=`pwd`
- cd $mandir
- for i in $sections
-@@ -192,7 +183,7 @@ do
- entire_line = "";
-
- if (verbose) {
-- print "adding " filename > "/dev/tty"
-+ print "adding " filename > "/dev/stderr"
- }
-
- use_zcat = match(filename,"\\.Z$") ||
-@@ -211,10 +202,10 @@ do
- }
- sub(/\..*/, "", progname);
- if (use_zcat) {
-- pipe_cmd = "zcat " filename;
-+ pipe_cmd = "zcat \"" filename "\"";
- # try to avoid suspicious stuff
- if (filename ~ /[;&|`$(]/) {
-- print "ignored strange file name " filename " in " curdir > "/dev/tty";
-+ print "ignored strange file name " filename " in " curdir > "/dev/stderr";
- return;
- }
- }
-@@ -360,23 +351,14 @@ do
-
- cd $here
-
-- # kludge for Slackware's /usr/man/preformat
-- if [ $mandir = /usr/man/preformat ]
-- then
-- mandir1=/usr/man
-- else
-- mandir1=$mandir
-- fi
--
-- if [ -f ${mandir1}/whatis ]
-+ if [ -f /var/cache/man/whatis ]
- then
-- cat ${mandir1}/whatis >> $TMPFILE
-+ cat /var/cache/man/whatis >> $TMPFILE
- fi
-- sed '/^$/d' < $TMPFILE | sort | uniq > ${mandir1}/whatis
-+ sed '/^$/d' < $TMPFILE | sort | uniq > /var/cache/man/whatis
-
-- chmod 644 ${mandir1}/whatis
-+ chmod 644 /var/cache/man/whatis
- rm $TMPFILE
-- fi
- done
- done
-
-diff -Narup man-1.5k.orig/src/man-getopt.c man-1.5k/src/man-getopt.c
---- man-1.5k.orig/src/man-getopt.c 2002-07-17 15:32:32.000000000 -0400
-+++ man-1.5k/src/man-getopt.c 2002-12-19 09:25:36.000000000 -0500
-@@ -171,7 +171,7 @@ get_options_from_string(const char *s) {
- char **argvec;
- int optindsv;
-
-- if (!s)
-+ if (!s || *s==0)
- return;
-
- /* In order to avoid having a list of options in two places,
-diff -Narup man-1.5k.orig/src/man.c man-1.5k/src/man.c
---- man-1.5k.orig/src/man.c 2002-07-17 17:33:20.000000000 -0400
-+++ man-1.5k/src/man.c 2002-12-19 09:19:05.000000000 -0500
-@@ -300,7 +300,7 @@ ultimate_source (const char *name0) {
-
- if (strlen(name0) >= sizeof(ultname))
- return name0;
-- strcpy(ultname, name0);
-+ strncpy(ultname, name0, BUFSIZE-32);
- name = ultname;
-
- again:
-@@ -332,7 +332,7 @@ again:
- * .so files - we could glob for all possible extensions,
- * for now: only try .gz
- */
-- else if (fp == NULL && get_expander(".gz") &&
-+ if (fp == NULL && get_expander(".gz") &&
- strlen(name)+strlen(".gz") < BUFSIZE) {
- strcat(name, ".gz");
- fp = fopen (name, "r");
-@@ -361,7 +361,7 @@ again:
- beg++;
-
- end = beg;
-- while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0')
-+ while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0' && (end-buf)<BUFSIZE)
- end++; /* note that buf is NUL-terminated */
- /* hence the RH patch is superfluous */
-
-@@ -394,6 +394,9 @@ again:
- strcat(name, "/");
- strcat(name, beg);
- }
-+ /* If this is too long, bad things have already happened. *
-+ * we should quit IMMEDIATELY. */
-+ if(strlen(name)>sizeof(ultname)) _exit(1);
-
- goto again;
- }
-@@ -1197,6 +1200,20 @@ main (int argc, char **argv) {
- #endif
-
-
-+ char *s;
-+#define CHECK(p, l) s=getenv(p); if(s && (strlen(s)>l)) { fprintf(stderr, "ERROR: Environment variable %s too long!\n", p); exit(1); }
-+
-+ CHECK("LANG", 32);
-+ CHECK("MANPAGER", 128);
-+ CHECK("PAGER", 128);
-+ CHECK("SYSTEM", 64);
-+ CHECK("MANROFFSEQ", 128);
-+ CHECK("MANSECT", 128);
-+ CHECK("MANPL", 128);
-+ CHECK("MAN_HP_DIREXT", 128);
-+ CHECK("LANGUAGE", 128);
-+ CHECK("LC_MESSAGES", 128);
-+
- #ifndef __FreeBSD__
- /* Slaven Rezif: FreeBSD-2.2-SNAP does not recognize LC_MESSAGES. */
- setlocale(LC_CTYPE, ""); /* used anywhere? maybe only isdigit()? */
diff --git a/sys-apps/man/files/man-1.5k-search-order.patch b/sys-apps/man/files/man-1.5k-search-order.patch
deleted file mode 100644
index 49af2be2beae..000000000000
--- a/sys-apps/man/files/man-1.5k-search-order.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -Narup man-1.5k.orig/src/man.conf.in man-1.5k/src/man.conf.in
---- man-1.5k.orig/src/man.conf.in 2002-07-17 15:08:40.000000000 -0400
-+++ man-1.5k/src/man.conf.in 2002-12-19 09:04:28.000000000 -0500
-@@ -36,10 +36,10 @@
- #
- # Every automatically generated MANPATH includes these fields
- #
--MANPATH /usr/man
- MANPATH /usr/share/man
--MANPATH /usr/local/man
- MANPATH /usr/X11R6/man
-+MANPATH /usr/local/man
-+MANPATH /usr/man
- #
- # Uncomment if you want to include one of these by default
- #
diff --git a/sys-apps/man/files/man-1.5k-util_c-segfault.patch b/sys-apps/man/files/man-1.5k-util_c-segfault.patch
deleted file mode 100644
index c5ee207f4572..000000000000
--- a/sys-apps/man/files/man-1.5k-util_c-segfault.patch
+++ /dev/null
@@ -1,67 +0,0 @@
- When calling man for instance with:
-
- $ man -k "foo bar"
-
- will result in the following crash:
-
- $ man -k "foo bar"
- sh: line 1: unsafe: command not found
- Error executing formatting or display command.
- System command unsafe exited with status 127.
- Segmentation fault
-
- The reason for this is that my_xsprintf() in util.c passes
- NOT_SAFE as the result if the string is not shell safe.
- When do_appros() (or whatever) then calls 'free(command)',
- free() tries to free a constant, and segfault.
-
- The attached solution are not eligant, but works without
- breaking the API. Basically we redefine NOT_SAFE as a
- message that we want to display, prepended with 'echo'.
- When the command is then executed, our message are displayed,
- and not the the line containing:
-
- sh: line 1: unsafe: command not found
-
- Further more, we do not return NOT_SAFE, but rather a string
- that we malloc, and then fill with the contents of NOT_SAFE,
- which will solve us trying to free a constant.
-
- More info can be found at:
-
- http://bugs.gentoo.org/show_bug.cgi?id=9761
-
- Alternatively it is possible to redefine what is "shell safe",
- but that will me a much more comprehensive fix ...
-
-
- Martin Schlemmer <azarah@gentoo.org> (26 Dec 2002).
-
---- man-1.5k/src/util.c.orig 2002-12-26 07:41:03.000000000 +0200
-+++ man-1.5k/src/util.c 2002-12-26 07:51:48.000000000 +0200
-@@ -261,7 +261,7 @@
- * The %S parameters are checked for being shell safe.
- * The %Q parameters are checked for being shell safe inside single quotes.
- */
--#define NOT_SAFE "unsafe"
-+#define NOT_SAFE "echo Cannot run command, as it is not shell safe!\necho Check that you do not quote search strings, etc."
-
- static int
- is_shell_safe(const char *ss, int quoted) {
-@@ -295,8 +295,14 @@
- case 'Q':
- case 'S': /* check and turn into 's' */
- ss = va_arg(p, char *);
-- if (!is_shell_safe(ss, (s[1] == 'Q')))
-- return NOT_SAFE;
-+ if (!is_shell_safe(ss, (s[1] == 'Q'))) {
-+ /* we cannot return NOT_SAFE, as it will cause
-+ * free to segfault in trying to free a constant
-+ */
-+ s = my_malloc(sizeof(NOT_SAFE) + 1);
-+ s = strncpy(s, NOT_SAFE, sizeof(NOT_SAFE));
-+ return s;
-+ }
- len += strlen(ss);
- s[1] = 's';
- break;
diff --git a/sys-apps/man/files/man-1.5k-wrong-quotes.patch b/sys-apps/man/files/man-1.5k-wrong-quotes.patch
deleted file mode 100644
index aa18805549e5..000000000000
--- a/sys-apps/man/files/man-1.5k-wrong-quotes.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- man-1.5k/src/Makefile.in.orig 2002-12-26 06:43:39.000000000 +0200
-+++ man-1.5k/src/Makefile.in 2002-12-26 06:48:18.000000000 +0200
-@@ -16,7 +16,7 @@
-
- pager = @pager@
-
--GS = -DGREPSILENT=\'@grepsilent@\'
-+GS = -DGREPSILENT="'@grepsilent@'"
- DEFS = @DEFS@ $(GS)
- CWARN = -Wall -Wstrict-prototypes -Wmissing-prototypes
- CWARNNP = -Wall
diff --git a/sys-apps/man/files/man-1.5l-LL-linelength.patch b/sys-apps/man/files/man-1.5l-LL-linelength.patch
deleted file mode 100644
index 10fcd0603a71..000000000000
--- a/sys-apps/man/files/man-1.5l-LL-linelength.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- man-1.5l/src/man.c.orig 2003-06-10 16:40:16.000000000 +0100
-+++ man-1.5l/src/man.c 2003-06-10 16:40:57.000000000 +0100
-@@ -550,6 +550,7 @@
- /* however, a .lt command here fails, only
- .ev 1; .lt ...; .ev helps for my version of groff */
- sprintf(eos(bufh), "echo \".ll %d.%di\"; ", ll/10, ll%10);
-+ sprintf(eos(bufh), "echo \".nr LL %d.%di\"; ", ll/10, ll%10);
- #if 0
- sprintf(eos(bufh), "echo \".lt %d.%di\"; ", ll/10, ll%10);
- #endif
diff --git a/sys-apps/man/files/man-1.5l-groff-1.18.patch b/sys-apps/man/files/man-1.5l-groff-1.18.patch
deleted file mode 100644
index 26a65b8dd8c8..000000000000
--- a/sys-apps/man/files/man-1.5l-groff-1.18.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- man-1.5k/configure.orig 2002-12-26 06:23:53.000000000 +0200
-+++ man-1.5k/configure 2002-12-26 06:25:14.000000000 +0200
-@@ -473,9 +473,9 @@
- then
- if test $Fnroff = "missing"
- then
-- nroff="nroff -Tlatin1 -mandoc"
-+ nroff="nroff -Tlatin1 -c -mandoc"
- else
-- nroff="$Fnroff -Tlatin1 -mandoc"
-+ nroff="$Fnroff -Tlatin1 -c -mandoc"
- fi
- troff="troff -mandoc"
- echo "Warning: could not find groff"
-@@ -484,7 +484,7 @@
- then
- nroff="$Fgroff -Tlatin1 -mandoc"
- else
-- nroff="$Fnroff -Tlatin1 -mandoc"
-+ nroff="$Fnroff -Tlatin1 -c -mandoc"
- fi
- troff="$Fgroff -Tps -mandoc"
- jnroff="$Fgroff -Tnippon -mandocj"
-
diff --git a/sys-apps/man/files/man-1.5l-locale-debug-info.patch b/sys-apps/man/files/man-1.5l-locale-debug-info.patch
deleted file mode 100644
index 26df852b3d1e..000000000000
--- a/sys-apps/man/files/man-1.5l-locale-debug-info.patch
+++ /dev/null
@@ -1,57 +0,0 @@
- Do not print the 'man: No such file or directory' error if
- 'man -d' was called and the NLS catalogue was not found, as
- it confuses people, and be more informative. More info at:
-
- http://bugs.gentoo.org/show_bug.cgi?id=
-
-
- Martin Schlemmer <azarah@gentoo.org> (26 Dec 2002).
-
---- man-1.5k/catopen/catopen.c.orig 2002-12-26 08:25:07.000000000 +0200
-+++ man-1.5k/catopen/catopen.c 2002-12-26 10:25:06.000000000 +0200
-@@ -10,7 +10,11 @@
- extern char *my_malloc(int); /* in util.c */
-
- #ifndef DEFAULT_NLSPATH
--#define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L"
-+# if __GLIBC__ >= 2
-+# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N"
-+# else
-+# define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L"
-+# endif
- #endif
-
- static nl_catd my_catopenpath(char *name, char *path);
---- man-1.5k/src/gripes.c.orig 2002-12-26 08:13:53.000000000 +0200
-+++ man-1.5k/src/gripes.c 2002-12-26 10:29:46.000000000 +0200
-@@ -47,14 +47,25 @@
- if (!lg)
- lg = getenv("LC_ALL");
- if ((s || lg) && (!lg || strncmp(lg, "en", 2))) {
-- perror(mantexts);
-+ /* This prints 'man: No such file or directory' which
-+ * confuses people. The fprintf message should really
-+ * be enouth ...
-+ */
-+/* perror(mantexts); */
-+
- fprintf(stderr,
--"Failed to open the message catalog %s on the path NLSPATH=%s\n\n",
-- mantexts, s ? s : "<none>");
-+"Failed to open the message catalog \"%s\" for locale \"%s\"\n\
-+(NLSPATH=\"%s\")\n\n",
-+ mantexts, lg ? lg : "<none>",
-+ s ? s : DEFAULT_NLSPATH);
- } else if (debug) {
-- perror(mantexts);
-+ /* This prints 'man: No such file or directory' which
-+ * confuses people. The fprintf message should really
-+ * be enouth ...
-+ */
-+/* perror(mantexts); */
- fprintf(stderr,
--"Looked whether there exists a message catalog %s, but there is none\n"
-+"Looked whether there exists a message catalog \"%s\", but there is none\n\n"
- "(and for English messages none is needed)\n\n",
- mantexts);
- }
diff --git a/sys-apps/man/files/man-1.5l-redhat-patches.patch b/sys-apps/man/files/man-1.5l-redhat-patches.patch
deleted file mode 100644
index 7959ce7d1fb4..000000000000
--- a/sys-apps/man/files/man-1.5l-redhat-patches.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-diff -Narup man-1.5k.orig/gencat/genlib.c man-1.5k/gencat/genlib.c
---- man-1.5k.orig/gencat/genlib.c 1997-12-02 08:23:30.000000000 -0500
-+++ man-1.5k/gencat/genlib.c 2002-12-19 09:16:38.000000000 -0500
-@@ -47,6 +47,7 @@ up-to-date. Many thanks.
- 01/14/91 4 nazgul Off by one on number specified entries
- */
-
-+#undef _GNU_SOURCE
- #include <stdio.h>
- #ifdef SYSV
- #include <sys/types.h>
-diff -Narup man-1.5k.orig/src/apropos.sh man-1.5k/src/apropos.sh
---- man-1.5k.orig/src/apropos.sh 2001-11-22 18:30:42.000000000 -0500
-+++ man-1.5k/src/apropos.sh 2002-12-19 09:16:09.000000000 -0500
-@@ -18,9 +18,9 @@ program=`basename $0`
-
- # When man pages in your favorite locale look to grep like binary files
- # (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
--aproposgrepopt1='i'
-+aproposgrepopt1='ia'
- aproposgrepopt2=''
--whatisgrepopt1='iw'
-+whatisgrepopt1='iwa'
- whatisgrepopt2='^'
- grepopt1=$%apropos_or_whatis%grepopt1
- grepopt2=$%apropos_or_whatis%grepopt2
-@@ -69,7 +69,7 @@ nothing=
- found=0
- while [ $found = 0 -a -n "$1" ]
- do
-- for d in $manpath /usr/lib
-+ for d in /var/cache/man /usr/lib
- do
- if [ -f $d/whatis ]
- then
-@@ -103,7 +103,7 @@ do
- done
- nothing=
- found=0
-- for d in $manpath /usr/lib
-+ for d in /var/cache/man $manpath /usr/lib
- do
- if [ -f $d/whatis ]
- then
-
-diff -Narup man-1.5k.orig/src/man-getopt.c man-1.5k/src/man-getopt.c
---- man-1.5k.orig/src/man-getopt.c 2002-07-17 15:32:32.000000000 -0400
-+++ man-1.5k/src/man-getopt.c 2002-12-19 09:25:36.000000000 -0500
-@@ -171,7 +171,7 @@ get_options_from_string(const char *s) {
- char **argvec;
- int optindsv;
-
-- if (!s)
-+ if (!s || *s==0)
- return;
-
- /* In order to avoid having a list of options in two places,
-diff -Narup man-1.5k.orig/src/man.c man-1.5k/src/man.c
---- man-1.5k.orig/src/man.c 2002-07-17 17:33:20.000000000 -0400
-+++ man-1.5k/src/man.c 2002-12-19 09:19:05.000000000 -0500
-@@ -300,7 +300,7 @@ ultimate_source (const char *name0) {
-
- if (strlen(name0) >= sizeof(ultname))
- return name0;
-- strcpy(ultname, name0);
-+ strncpy(ultname, name0, BUFSIZE-32);
- name = ultname;
-
- again:
-@@ -332,7 +332,7 @@ again:
- * .so files - we could glob for all possible extensions,
- * for now: only try .gz
- */
-- else if (fp == NULL && get_expander(".gz") &&
-+ if (fp == NULL && get_expander(".gz") &&
- strlen(name)+strlen(".gz") < BUFSIZE) {
- strcat(name, ".gz");
- fp = fopen (name, "r");
-@@ -361,7 +361,7 @@ again:
- beg++;
-
- end = beg;
-- while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0')
-+ while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0' && (end-buf)<BUFSIZE)
- end++; /* note that buf is NUL-terminated */
- /* hence the RH patch is superfluous */
-
-@@ -394,6 +394,9 @@ again:
- strcat(name, "/");
- strcat(name, beg);
- }
-+ /* If this is too long, bad things have already happened. *
-+ * we should quit IMMEDIATELY. */
-+ if(strlen(name)>sizeof(ultname)) _exit(1);
-
- goto again;
- }
-@@ -1197,6 +1200,20 @@ main (int argc, char **argv) {
- #endif
-
-
-+ char *s;
-+#define CHECK(p, l) s=getenv(p); if(s && (strlen(s)>l)) { fprintf(stderr, "ERROR: Environment variable %s too long!\n", p); exit(1); }
-+
-+ CHECK("LANG", 32);
-+ CHECK("MANPAGER", 128);
-+ CHECK("PAGER", 128);
-+ CHECK("SYSTEM", 64);
-+ CHECK("MANROFFSEQ", 128);
-+ CHECK("MANSECT", 128);
-+ CHECK("MANPL", 128);
-+ CHECK("MAN_HP_DIREXT", 128);
-+ CHECK("LANGUAGE", 128);
-+ CHECK("LC_MESSAGES", 128);
-+
- #ifndef __FreeBSD__
- /* Slaven Rezif: FreeBSD-2.2-SNAP does not recognize LC_MESSAGES. */
- setlocale(LC_CTYPE, ""); /* used anywhere? maybe only isdigit()? */
-
-diff -Narup man-1.5k.orig/src/makewhatis.sh man-1.5k/src/makewhatis.sh
---- man-1.5k.orig/src/makewhatis.sh 2002-07-17 14:59:05.000000000 -0400
-+++ man-1.5k/src/makewhatis.sh 2002-12-19 09:24:14.000000000 -0500
-@@ -41,7 +41,7 @@
- # and should be first.
- # It is a bug to add /var/cache/man to DEFCATPATH.
- dm=
--for d in /usr/man /usr/share/man
-+for d in /usr/share/man /usr/X11R6/man /usr/local/man /usr/man
- do
- if [ -d $d ]; then
- if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
-@@ -49,13 +49,13 @@
- done
- DEFMANPATH=$dm
- dc=
--for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man
-+for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat
- do
- if [ -d $d ]; then
- if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
- fi
- done
--DEFCATPATH=$dc
-+DEFCATPATH=$dc:$DEFMANPATH
-
- # In case /usr is read-only, make /usr/man/whatis (etc) a symlink to
- # something like /var/cache/man/whatis.
-@@ -70,12 +70,12 @@
- # We try here to be careful (and avoid preconstructed symlinks)
- # in case makewhatis is run as root, by creating a subdirectory of /tmp.
-
--TMPFILEDIR=/tmp/whatis.tmp.dir.$$
--rm -rf TMPFILEDIR
--if ! mkdir -m 0700 $TMPFILEDIR; then
-- echo Could not create $TMPFILEDIR
-- exit 1;
-+TMPFILEDIR=`mktemp -d /tmp/makewhatisXXXXXX`
-+if [ $? -ne 0 ]; then
-+ echo "$0: Can't create temp file, exiting..."
-+ exit 1
- fi
-+chmod 0700 $TMPFILEDIR
- TMPFILE=$TMPFILEDIR/w
-
- # make sure TMPFILEDIR is deleted if program is killed or terminates
-@@ -109,8 +109,10 @@
- continue;;
- -s) setsections=1
- continue;;
-- -u) findarg="-ctime 0"
-- update=1
-+ -u) if [ -e /var/cache/man/whatis ]; then
-+ findarg="-newer /var/cache/man/whatis"
-+ update=1
-+ fi
- continue;;
- -v) verbose=1
- continue;;
-@@ -149,14 +151,7 @@
- # first truncate all the whatis files that will be created new,
- # then only update - we might visit the same directory twice
- if [ x$update = x ]; then
-- for pages in man cat
-- do
-- eval path="\$$pages"path
-- for mandir in $path
-- do
-- cp /dev/null $mandir/whatis
-- done
-- done
-+ cp /dev/null /var/cache/man/whatis
- fi
-
- for pages in man cat
-@@ -165,14 +160,10 @@
- eval path="\$$pages"path
- for mandir in $path
- do
-- if [ x$verbose != x ]; then
-- echo "about to enter $mandir" > /dev/stderr
-- fi
-- if [ -s ${mandir}/whatis -a $pages = man -a x$update = x ]; then
-- if [ x$verbose != x ]; then
-- echo skipping $mandir - we did it already > /dev/stderr
-- fi
-- else
-+ [ -d "$mandir" ] || continue
-+ if [ x$verbose != x ]; then
-+ echo "about to enter $mandir" > /dev/stderr
-+ fi
- here=`pwd`
- cd $mandir
- for i in $sections
-@@ -391,23 +382,14 @@
-
- cd $here
-
-- # kludge for Slackware's /usr/man/preformat
-- if [ $mandir = /usr/man/preformat ]
-- then
-- mandir1=/usr/man
-- else
-- mandir1=$mandir
-- fi
--
-- if [ -f ${mandir1}/whatis ]
-+ if [ -f /var/cache/man/whatis ]
- then
-- cat ${mandir1}/whatis >> $TMPFILE
-+ cat /var/cache/man/whatis >> $TMPFILE
- fi
-- sed '/^$/d' < $TMPFILE | sort | uniq > ${mandir1}/whatis
-+ sed '/^$/d' < $TMPFILE | sort | uniq > /var/cache/man/whatis
-
-- chmod 644 ${mandir1}/whatis
-+ chmod 644 /var/cache/man/whatis
- rm $TMPFILE
-- fi
- done
- done
-
diff --git a/sys-apps/man/files/man-1.5l-search-order.patch b/sys-apps/man/files/man-1.5l-search-order.patch
deleted file mode 100644
index 49af2be2beae..000000000000
--- a/sys-apps/man/files/man-1.5l-search-order.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -Narup man-1.5k.orig/src/man.conf.in man-1.5k/src/man.conf.in
---- man-1.5k.orig/src/man.conf.in 2002-07-17 15:08:40.000000000 -0400
-+++ man-1.5k/src/man.conf.in 2002-12-19 09:04:28.000000000 -0500
-@@ -36,10 +36,10 @@
- #
- # Every automatically generated MANPATH includes these fields
- #
--MANPATH /usr/man
- MANPATH /usr/share/man
--MANPATH /usr/local/man
- MANPATH /usr/X11R6/man
-+MANPATH /usr/local/man
-+MANPATH /usr/man
- #
- # Uncomment if you want to include one of these by default
- #
diff --git a/sys-apps/man/files/man-1.5l-security.patch b/sys-apps/man/files/man-1.5l-security.patch
deleted file mode 100644
index 2f7e9e3db64b..000000000000
--- a/sys-apps/man/files/man-1.5l-security.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -urP man-1.5l/src/gripes.c man-1.5l/src/gripes.c
---- man-1.5l/src/gripes.c Wed Jul 17 20:17:23 2002
-+++ man-1.5l/src/gripes.c Fri Jun 6 14:51:21 2003
-@@ -28,0 +28,1 @@
-+#include <string.h>
-@@ -68,0 +68,2 @@
-+ unsigned int i = 0;
-+ unsigned short fmt_n = 0;
-@@ -78,0 +78,13 @@
-+ /* routine to filter format string abuse. will */
-+ /* only allow %d, %s, and %o through. no more */
-+ /* than two formats needed for any response. */
-+ for (i = 0; s[i] != 0x0; i++){
-+ if (s[i] == '%' && s[i+1]){
-+ if (strchr("dso", s[i+1])) /* %d,%s,%o. */
-+ fmt_n++;
-+ else
-+ fmt_n=3; /* anything else = <limit. */
-+ }
-+ if (fmt_n > 2) /* failed, default reply. */
-+ s = msg[n];
-+ }
diff --git a/sys-apps/man/files/man-1.5l-util_c-segfault.patch b/sys-apps/man/files/man-1.5l-util_c-segfault.patch
deleted file mode 100644
index 0fa6c8472aca..000000000000
--- a/sys-apps/man/files/man-1.5l-util_c-segfault.patch
+++ /dev/null
@@ -1,67 +0,0 @@
- When calling man for instance with:
-
- $ man -k "foo bar"
-
- will result in the following crash:
-
- $ man -k "foo bar"
- sh: line 1: unsafe: command not found
- Error executing formatting or display command.
- System command unsafe exited with status 127.
- Segmentation fault
-
- The reason for this is that my_xsprintf() in util.c passes
- NOT_SAFE as the result if the string is not shell safe.
- When do_appros() (or whatever) then calls 'free(command)',
- free() tries to free a constant, and segfault.
-
- The attached solution are not eligant, but works without
- breaking the API. Basically we redefine NOT_SAFE as a
- message that we want to display, prepended with 'echo'.
- When the command is then executed, our message are displayed,
- and not the the line containing:
-
- sh: line 1: unsafe: command not found
-
- Further more, we do not return NOT_SAFE, but rather a string
- that we malloc, and then fill with the contents of NOT_SAFE,
- which will solve us trying to free a constant.
-
- More info can be found at:
-
- http://bugs.gentoo.org/show_bug.cgi?id=9761
-
- Alternatively it is possible to redefine what is "shell safe",
- but that will me a much more comprehensive fix ...
-
-
- Martin Schlemmer <azarah@gentoo.org> (26 Dec 2002).
-
---- man-1.5k/src/util.c.orig 2002-12-26 07:41:03.000000000 +0200
-+++ man-1.5k/src/util.c 2002-12-26 07:51:48.000000000 +0200
-@@ -237,7 +237,7 @@
- * The %S parameters are checked for being shell safe.
- * The %Q parameters are checked for being shell safe inside single quotes.
- */
--#define NOT_SAFE "/unsafe/"
-+#define NOT_SAFE "echo Cannot run command, as it is not shell safe!\necho Check that you do not quote search strings, etc."
-
- static int
- is_shell_safe(const char *ss, int quoted) {
-@@ -295,8 +295,14 @@
- case 'Q':
- case 'S': /* check and turn into 's' */
- ss = va_arg(p, char *);
-- if (!is_shell_safe(ss, (s[1] == 'Q')))
-- return NOT_SAFE;
-+ if (!is_shell_safe(ss, (s[1] == 'Q'))) {
-+ /* we cannot return NOT_SAFE, as it will cause
-+ * free to segfault in trying to free a constant
-+ */
-+ s = my_malloc(sizeof(NOT_SAFE) + 1);
-+ s = strncpy(s, NOT_SAFE, sizeof(NOT_SAFE));
-+ return s;
-+ }
- len += strlen(ss);
- s[1] = 's';
- break;
diff --git a/sys-apps/man/files/man-1.5l-wrong-quotes-v2.patch b/sys-apps/man/files/man-1.5l-wrong-quotes-v2.patch
deleted file mode 100644
index aa514c2ceca3..000000000000
--- a/sys-apps/man/files/man-1.5l-wrong-quotes-v2.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- man-1.5k/src/Makefile.in.orig 2002-12-26 06:43:39.000000000 +0200
-+++ man-1.5k/src/Makefile.in 2002-12-26 06:48:18.000000000 +0200
-@@ -16,7 +16,7 @@
-
- pager = @pager@
-
--GS = -DGREPSILENT=\'@grepsilent@\'
-+GS = -DGREPSILENT=0x71
- DEFS = @DEFS@ $(GS)
- CWARN = -Wall -Wstrict-prototypes -Wmissing-prototypes
- CWARNNP = -Wall
diff --git a/sys-apps/man/files/man-1.5l-wrong-quotes.patch b/sys-apps/man/files/man-1.5l-wrong-quotes.patch
deleted file mode 100644
index 2ec1c66a68b8..000000000000
--- a/sys-apps/man/files/man-1.5l-wrong-quotes.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- man-1.5k/src/Makefile.in.orig 2002-12-26 06:43:39.000000000 +0200
-+++ man-1.5k/src/Makefile.in 2002-12-26 06:48:18.000000000 +0200
-@@ -16,7 +16,7 @@
-
- pager = @pager@
-
--GS = -DGREPSILENT=\'@grepsilent@\'
-+GS = -DGREPSILENT=$(shell echo "@grepsilent@" | hexdump -d -n 1 | gawk '{ printf("0x%x", $$2); exit 0 }')
- DEFS = @DEFS@ $(GS)
- CWARN = -Wall -Wstrict-prototypes -Wmissing-prototypes
- CWARNNP = -Wall
diff --git a/sys-apps/man/files/man-1.5m-locale-order.patch b/sys-apps/man/files/man-1.5m-locale-order.patch
new file mode 100644
index 000000000000..d18fb4d4602f
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m-locale-order.patch
@@ -0,0 +1,11 @@
+--- man-1.5m2/src/gripesold.c 2004-08-14 13:35:18.931494560 +0300
++++ man-1.5m2/src/gripes.c 2004-08-14 13:36:06.816214976 +0300
+@@ -35,7 +35,7 @@
+ static void
+ catinit (void) {
+ if (!cat_is_open) {
+- catfd = my_catopen(mantexts,0);
++ catfd = my_catopen(mantexts,NL_CAT_LOCALE);
+ if (catfd == (nl_catd) -1) {
+ /* Only complain if at least one of NLSPATH and LANG exists,
+ and LANG != "en" (or when debugging). Also accept en_ZA etc. */
diff --git a/sys-apps/man/man-1.5m-r2.ebuild b/sys-apps/man/man-1.5m-r2.ebuild
new file mode 100644
index 000000000000..602cfa5ef13d
--- /dev/null
+++ b/sys-apps/man/man-1.5m-r2.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/man-1.5m-r2.ebuild,v 1.1 2004/10/03 07:52:42 vapier Exp $
+
+inherit eutils flag-o-matic
+
+NV="1.5m2"
+DESCRIPTION="Standard commands to read man pages"
+HOMEPAGE="http://freshmeat.net/projects/man/"
+SRC_URI="mirror://kernel/linux/utils/man/man-${NV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sparc x86"
+IUSE="nls"
+
+DEPEND="virtual/libc
+ >=sys-apps/sed-4"
+RDEPEND="sys-apps/cronbase
+ >=sys-apps/groff-1.18
+ nls? ( sys-devel/gettext )"
+
+S="${WORKDIR}/${PN}-${NV}"
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}" && \
+ sed -i \
+ -e 's:/usr/lib/locale:$(prefix)/usr/lib/locale:g' \
+ -e 's!/usr/bin:/usr/ucb:!/usr/bin:!' \
+ -e 's/n l p o/n l p 0p 1p 3p o/' \
+ configure || die "configure sed failed"
+
+ sed -i -e 's:cc -o:$(CC) -o:' gencat/Makefile \
+ || die "gencat/Makefile sed failed"
+
+ # security fix
+ epatch ${FILESDIR}/${P}-security.patch
+
+ # Fix search order in man.conf so that system installed manpages
+ # will be found first ...
+ epatch ${FILESDIR}/${P}-search-order.patch
+
+ # For groff-1.18 or later we need to call nroff with '-c'
+ epatch ${FILESDIR}/${P}-groff-1.18.patch
+
+ # Fix wierd failing in rare cases
+ epatch ${FILESDIR}/${P}-wrong-quotes-v2.patch
+
+ # Fix a crash when calling man with: man -k "foo bar" (bug #9761).
+ # <azarah@gentoo.org> (26 Dec 2002).
+ epatch ${FILESDIR}/${P}-util_c-segfault.patch
+
+ # Various fixes from Redhat
+ epatch ${FILESDIR}/${P}-redhat-patches.patch
+
+ # Do not print the 'man: No such file or directory' error if
+ # 'man -d' was called and the NLS catalogue was not found, as
+ # it confuses people, and be more informative ... (bug #6360)
+ # <azarah@gentoo.org> (26 Dec 2002).
+ epatch ${FILESDIR}/${P}-locale-debug-info.patch
+
+ # Line length overidden by nroff macros, thanks to
+ # <grant.mcdorman@sympatico.ca> for the patch, (bug #21018).
+ # -taviso@gentoo.org
+ epatch ${FILESDIR}/${P}-LL-linelength.patch
+
+ # makewhatis traverses manpages twice, as default manpath
+ # contains two directories that are symlinked together
+ # (bug 23848)
+ # -taviso@gentoo.org
+ epatch ${FILESDIR}/${P}-defmanpath-symlinks.patch
+
+ # Make sure the locale is searched in the right order #37778
+ epatch ${FILESDIR}/${P}-locale-order.patch
+
+ # use non-lazy binds for man. And let portage handling stripping.
+ append-ldflags -Wl,-z,now
+ sed -i -e \
+ s/'LDFLAGS = -s'/"LDFLAGS:=${LDFLAGS}"/g ${S}/src/Makefile.in \
+ || die "failed to edit default LDLFAGS"
+}
+
+src_compile() {
+ local myconf=
+
+ use nls && myconf="+lang all" || myconf="+lang none"
+
+ ./configure -confdir=/etc \
+ +sgid +fhs \
+ ${myconf} || die "configure failed"
+
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ dodir /usr/{bin,sbin}
+ make PREFIX="${D}" install || die "make install failed"
+
+ insinto /etc
+ doins src/man.conf
+
+ dodoc LSM README* TODO
+
+ if use nls ; then
+ cd "${S}/msgs"
+ ./inst.sh ?? "${D}"/usr/share/locale/%L/%N
+ fi
+
+ # Needed for makewhatis
+ keepdir /var/cache/man
+ exeinto /etc/cron.weekly
+ newexe "${FILESDIR}/makewhatis.cron" makewhatis
+
+ fowners root:man /usr/bin/man
+ fperms 2555 /usr/bin/man
+
+ diropts -m0775 -g man
+ for x in $(awk '
+ /^MANSECT/ {
+ split($2, sects, ":")
+ for (x in sects)
+ print "cat" sects[x]
+ }' ${D}/etc/man.conf)
+ do
+ keepdir /var/cache/man/${x}
+ done
+}
+
+pkg_postinst() {
+ einfo "Forcing sane permissions onto ${ROOT}/var/cache/man (Bug #40322)"
+ chown -R root:man "${ROOT}/var/cache/man"
+ chmod -R g+w "${ROOT}/var/cache/man"
+ [ -e "${ROOT}/var/cache/man/whatis" ] \
+ && chown root:root "${ROOT}/var/cache/man/whatis"
+
+ echo
+
+ local files="`ls ${ROOT}/etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null`"
+ if [ "${files/$'\n'}" != "${files}" ] ; then
+ ewarn "You have multiple makewhatis cron files installed."
+ ewarn "You might want to delete all but one of these:"
+ echo ${files}
+ fi
+}