Index: BOOK/final-system/common/man.xml
===================================================================
--- BOOK/final-system/common/man.xml (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ BOOK/final-system/common/man.xml (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
@@ -29,8 +29,4 @@
patch -Np1 -i ../&man-i18n-patch;
-
- The following patch will add support for new compressors like XZ Utils:
-
-patch -Np1 -i ../&man-new_compressors-patch;
A few adjustments need to be made to the sources of Man.
Index: BOOK/final-system/common/tar.xml
===================================================================
--- BOOK/final-system/common/tar.xml (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ BOOK/final-system/common/tar.xml (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
@@ -32,5 +32,6 @@
Prepare Tar for compilation:
-./configure --prefix=/usr --bindir=/bin --libexecdir=/usr/sbin
+FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr \
+ --bindir=/bin --libexecdir=/usr/sbin
Compile the package:
Index: BOOK/final-system/multilib/man.xml
===================================================================
--- BOOK/final-system/multilib/man.xml (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ BOOK/final-system/multilib/man.xml (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
@@ -29,12 +29,4 @@
href="../common/man.xml"
xpointer="xpointer(//*[@os='p2'])"/>
-
-
-
-
-CC="gcc ${BUILD64}" ./configure --prefix=/usr \
- --bindir=/bin --libexecdir=/usr/sbin
+FORCE_UNSAFE_CONFIGURE=1 CC="gcc ${BUILD64}" \
+ ./configure --prefix=/usr \
+ --bindir=/bin --libexecdir=/usr/sbin
January 8, 2011
+
+ [jciccone] - Updated Man to 1.6g.
+
[jciccone] - Updated IPutils to s20101006.
Index: BOOK/materials/common/patches.xml
===================================================================
--- BOOK/materials/common/patches.xml (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ BOOK/materials/common/patches.xml (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
@@ -92,13 +92,4 @@
- Man New Compressors Patch - &man-new_compressors-patch-size;:
-
- Download:
- MD5 sum: &man-new_compressors-patch-md5;
-
-
-
-
Ncurses Bash Patch - &ncurses-bashfix-patch-size;:
Index: BOOK/packages.ent
===================================================================
--- BOOK/packages.ent (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ BOOK/packages.ent (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
@@ -268,8 +268,8 @@
-
-
+
+
-
+
Index: BOOK/patches.ent
===================================================================
--- BOOK/patches.ent (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ BOOK/patches.ent (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
@@ -38,10 +38,6 @@
-
-
-
-
-
-
+
+
Index: tches/man-1.6f-i18n-1.patch
===================================================================
--- patches/man-1.6f-i18n-1.patch (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ (revision )
@@ -1,334 +1,0 @@
-Submitted By: Jim Gifford
-Date: 2009-01-08
-Initial Package Version: 1.6f
-Upstream Status: Unkown
-Origin: Mandriva
-Description: i18n Updates
-
-diff -Naur man-1.6f.orig/catopen/catopen.c man-1.6f/catopen/catopen.c
---- man-1.6f.orig/catopen/catopen.c 2005-08-20 16:26:06.000000000 -0700
-+++ man-1.6f/catopen/catopen.c 2009-01-08 22:01:17.000000000 -0800
-@@ -9,22 +9,63 @@
- extern char *index (const char *, int); /* not always in */
- extern char *my_malloc(int); /* in util.c */
-
-+/* if the program has sgid/suid privileges then getenv doesn't return
-+ * NLSPATH; so we set here a good default value.
-+ */
- #ifndef DEFAULT_NLSPATH
- # if __GLIBC__ >= 2
--# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N"
-+# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N:/usr/share/locale/%l_%t/%N:/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);
-+static nl_catd my_catopenpath(char *name, char *path, char *lang);
-
- static /* this source included in gripes.c */
- nl_catd
- my_catopen(char *name, int oflag) {
-- nl_catd fd;
-+ nl_catd fd = (nl_catd) -1;
-+
-+ /* using first the my_catopenpath, which looks with LANGUAGE
-+ * and only if it fails ressort to catopen, it gives better i18n
-+ */
-+ {
-+ char *nlspath, *lang, *s;
-
-- fd = catopen(name, oflag);
-+ /*
-+ * "If NLSPATH does not exist in the environment, or if a
-+ * message catalog cannot be opened in any of the paths specified
-+ * by NLSPATH, then an implementation defined default path is used"
-+ */
-+ nlspath = getenv("NLSPATH");
-+ if (!nlspath)
-+ nlspath = DEFAULT_NLSPATH;
-+
-+ lang = getenv("LANGUAGE");
-+ if (!lang)
-+ lang = getenv("LC_ALL");
-+ if (!lang)
-+ lang = getenv("LC_MESSAGES");
-+ if (!lang)
-+ lang = getenv("LANG");
-+ if (!lang)
-+ lang = "";
-+
-+ while(*lang && (fd == (nl_catd) -1)) {
-+ s = index(lang, ':');
-+ if (s) *s = 0;
-+ fd = my_catopenpath(name, nlspath, lang);
-+ if (s) lang=s+1;
-+ else lang = "";
-+ }
-+ if (fd == (nl_catd) -1)
-+ fd = my_catopenpath(name, nlspath, "en");
-+ }
-+
-+ /* still not found, use the system catopen */
-+ if (fd == (nl_catd) -1)
-+ fd = catopen(name, oflag);
-
- if (fd == (nl_catd) -1 && oflag) {
- oflag = 0;
-@@ -32,8 +73,6 @@
- }
-
- if (fd == (nl_catd) -1) {
-- char *nlspath;
--
- /* The libc catopen fails - let us see if we can do better */
- /* The quotes below are from X/Open, XPG 1987, Vol. 3. */
-
-@@ -58,17 +97,6 @@
- #endif
- }
-
-- /*
-- * "If NLSPATH does not exist in the environment, or if a
-- * message catalog cannot be opened in any of the paths specified
-- * by NLSPATH, then an implementation defined default path is used"
-- */
--
-- nlspath = getenv("NLSPATH");
-- if (nlspath)
-- fd = my_catopenpath(name, nlspath);
-- if (fd == (nl_catd) -1)
-- fd = my_catopenpath(name, DEFAULT_NLSPATH);
- }
- return fd;
- }
-@@ -90,15 +118,13 @@
- *
- */
- static nl_catd
--my_catopenpath(char *name, char *nlspath) {
-- int fd;
-+my_catopenpath(char *name, char *nlspath, char *lang) {
- nl_catd cfd = (nl_catd) -1;
-- char *path0, *path, *s, *file, *lang, *lang_l, *lang_t, *lang_c;
-+ char *path0, *path, *s, *file, *lang_l, *lang_t, *lang_c;
- int langsz, namesz, sz, lang_l_sz, lang_t_sz, lang_c_sz;
-
- namesz = strlen(name);
-
-- lang = getenv("LANG");
- if (!lang)
- lang = "";
- langsz = strlen(lang);
-@@ -194,14 +220,9 @@
- path = s+1;
- } else
- path = 0;
-- fd = open(file, O_RDONLY);
-- if (fd != -1) {
-- /* we found the right catalog - but we don't know the
-- type of nl_catd, so close it again and ask libc */
-- close(fd);
-- cfd = catopen(file, 0);
-- break;
-- }
-+ cfd = catopen(file, 0);
-+ if (cfd != (nl_catd) -1)
-+ break;
- }
-
- free(path0);
-diff -Naur man-1.6f.orig/configure man-1.6f/configure
---- man-1.6f.orig/configure 2007-08-20 21:15:21.000000000 -0700
-+++ man-1.6f/configure 2009-01-08 22:29:17.000000000 -0800
-@@ -412,9 +412,9 @@
- fi
- done
- done
-- troff=""
-- nroff=""
-- jnroff=""
-+ troff=/usr/bin/troff
-+ nroff=/usr/bin/nroff
-+ jnroff=/usr/bin/nroff
- eqn=""
- neqn=""
- jneqn=""
-@@ -472,29 +472,32 @@
- done
- # -Tlatin1 is bad when utf8 is used, but needed for groff, not for nroff
- # Hmm - also needed for nroff, to prevent double conversion on uxterm
-+ Fgroff=/usr/bin/groff
-+ Fnroff=/usr/bin/nroff
-+ Fjnroff=/usr/bin/nroff
- if test $Fgroff = "missing"
- then
- if test $Fnroff = "missing"
- then
-- nroff="nroff -Tlatin1 -mandoc"
-+ nroff="nroff -Tutf8 -mandoc"
- else
-- nroff="$Fnroff -Tlatin1 -mandoc"
-+ nroff="$Fnroff -Tutf8 -mandoc"
- fi
- troff="troff -mandoc"
- echo "Warning: could not find groff"
- else
- if test $Fnroff = "missing"
- then
-- nroff="$Fgroff -Tlatin1 -mandoc"
-+ nroff="$Fgroff -Tutf8 -mandoc"
- else
-- nroff="$Fnroff -Tlatin1 -mandoc"
-+ nroff="$Fnroff -Tutf8 -mandoc"
- fi
- troff="$Fgroff -Tps -mandoc"
-- jnroff="$Fgroff -Tnippon -mandocj"
-+ jnroff="$Fjnroff -Tutf8 -mandocj"
- fi
- eqn="$Fgeqn -Tps"
-- neqn="$Fgeqn -Tlatin1"
-- jneqn="$Fgeqn -Tnippon"
-+ neqn="$Fgeqn -Tutf8"
-+ jneqn="$Fgeqn -Tutf8"
- tbl="$Fgtbl"
- col="$Fcol"
- vgrind="$Fvgrind"
-@@ -960,7 +963,7 @@
-
- # What sections do we anticipate?
-
--tmpsections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o"
-+tmpsections="1 1p 8 2 3 3p 3pm 4 5 6 7 9 0p tcl n l p o"
-
- if [ x$default = x ]; then
- echo ""
-diff -Naur man-1.6f.orig/msgs/inst.sh man-1.6f/msgs/inst.sh
---- man-1.6f.orig/msgs/inst.sh 2005-08-20 16:26:06.000000000 -0700
-+++ man-1.6f/msgs/inst.sh 2009-01-08 22:01:46.000000000 -0800
-@@ -27,8 +27,7 @@
- for j in $M; do
- if [ -f $j ]; then
- i=`echo $j | sed -e 's/mess.//; s/.cat//'`
-- dest=`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
-- dest=${PREFIX}$dest
-+ dest=${PREFIX}/`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
- echo "mkdir -p `dirname $dest`"
- mkdir -p `dirname $dest`;
- echo "install -c -m 644 $j $dest"
-diff -Naur man-1.6f.orig/src/apropos.sh man-1.6f/src/apropos.sh
---- man-1.6f.orig/src/apropos.sh 2005-08-20 16:26:06.000000000 -0700
-+++ man-1.6f/src/apropos.sh 2009-01-08 22:02:47.000000000 -0800
-@@ -60,16 +60,56 @@
- esac
- done
-
-+# list of languages to look for
-+LANG_LIST=`echo $LANGUAGE:$LC_ALL:$LC_MESSAGES:$LANG | tr ':' ' '`
-+DIR_LIST=""
-+for d in /var/cache/man $manpath /usr/lib
-+do
-+ for l in $LANG_LIST
-+ do
-+ if [ -d $d/$l ]
-+ then
-+ # check that the path is not already in the list
-+ if ! echo "$DIR_LIST" | grep " $d/$l\b" > /dev/null
-+ then
-+ DIR_LIST="$DIR_LIST $d/$l"
-+ fi
-+ fi
-+ done
-+ DIR_LIST="$DIR_LIST $d"
-+ # check that the path is not already in the list
-+ if ! echo "$DIR_LIST" | grep " $d\b" > /dev/null
-+ then
-+ DIR_LIST="$DIR_LIST $d/$l"
-+ fi
-+done
-+
- while [ "$1" != "" ]
- do
- found=0
-- for d in /var/cache/man $manpath /usr/lib
-+ # in order not to display lines in more than one language for
-+ # a same man page; we check that a given man page name
-+ # hasn't already been displayed
-+ BAZ=""
-+ for d in $DIR_LIST
- do
- if [ -f $d/whatis ]
- then
-- if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
-+ if FOO=`grep -"$grepopt1" "$grepopt2""$1" $d/whatis`
- then
-- found=1
-+ # the LC_ALL=C is needed in case the text is
-+ # in a different encoding than the locale
-+ BAR=`echo -e "$FOO" | LC_ALL=C sed 's/ - .*$//' | tr ' []' '_' | sort -u`
-+ for i in $BAR
-+ do
-+ if ! echo "$BAZ" | grep "$i" > /dev/null
-+ then
-+ BAZ="$BAZ $i"
-+ i="^`echo $i | sed 's:_\+:\\\(\[_ \]\\\|\\\[\\\|\\\]\\\)\\\+:g'`"
-+ echo -e "$FOO" | grep "$i"
-+ found=1
-+ fi
-+ done
- # Some people are satisfied with a single occurrence
- # But it is better to give all
- # break
-diff -Naur man-1.6f.orig/src/makewhatis.sh man-1.6f/src/makewhatis.sh
---- man-1.6f.orig/src/makewhatis.sh 2007-09-17 11:35:14.000000000 -0700
-+++ man-1.6f/src/makewhatis.sh 2009-01-08 22:02:47.000000000 -0800
-@@ -55,6 +55,9 @@
- dc=
- for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man
- do
-+ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
-+ if [ x$dc = x ]; then dm="$d/$LANG"; else dm=$dc:"$d/$LANG"; fi
-+ fi
- if [ -d $d ]; then
- if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
- fi
-@@ -227,7 +230,7 @@
- section=$i
- curdir=$mandir/${pages}$i
- export section verbose curdir
-- find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
-+ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" '
-
- function readline() {
- if (use_zcat || use_bzcat || use_lzcat) {
-@@ -315,6 +318,7 @@
- if ($1 ~ /^\.[Ss][HhYS]/ ||
- (pages == "cat" &&
- ($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
-+ $1 ~ MAN_DESCRIPTION ||
- $1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
- $1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
- $0 ~ /^[^ ]/))) {
-diff -Naur man-1.6f.orig/src/manpath.c man-1.6f/src/manpath.c
---- man-1.6f.orig/src/manpath.c 2006-08-03 14:18:33.000000000 -0700
-+++ man-1.6f/src/manpath.c 2009-01-08 22:01:17.000000000 -0800
-@@ -282,13 +282,14 @@
- /* We cannot use "lang = setlocale(LC_MESSAGES, NULL)" or so:
- the return value of setlocale is an opaque string. */
- /* POSIX prescribes the order: LC_ALL, LC_MESSAGES, LANG */
-- if((lang = getenv("LC_ALL")) != NULL)
-+ /* LANGUAGE is GNU/Linux and overrules all */
-+ if((lang = getenv("LANGUAGE")) != NULL)
- split2(dir, lang, add_to_mandirlist_x, perrs);
-- if((lang = getenv("LC_MESSAGES")) != NULL)
-+ else if((lang = getenv("LC_ALL")) != NULL)
- split2(dir, lang, add_to_mandirlist_x, perrs);
-- if((lang = getenv("LANG")) != NULL)
-+ else if((lang = getenv("LC_MESSAGES")) != NULL)
- split2(dir, lang, add_to_mandirlist_x, perrs);
-- if((lang = getenv("LANGUAGE")) != NULL)
-+ else if((lang = getenv("LANG")) != NULL)
- split2(dir, lang, add_to_mandirlist_x, perrs);
- add_to_mandirlist_x(dir, 0, perrs);
- }
Index: tches/man-1.6f-new_compressors-1.patch
===================================================================
--- patches/man-1.6f-new_compressors-1.patch (revision ecc1136c03ab82d05060a4dfccf51599109cc687)
+++ (revision )
@@ -1,100 +1,0 @@
-Submitted By: Jim Gifford
-Date: 2009-02-21
-Initial Package Version: 1.6f
-Upstream Status: Unknown
-Origin: Jim Gifford
-Description: For using lzip compression
- For using xz compression
-
-diff -Naur man-1.6f.orig/configure man-1.6f/configure
---- man-1.6f.orig/configure 2007-08-20 21:15:21.000000000 -0700
-+++ man-1.6f/configure 2009-02-22 19:30:14.602512641 -0800
-@@ -1015,7 +1015,7 @@
- then
- DO_COMPRESSION=true
- compress=
-- for i in lzma bzip2 gzip bzip tzip pack compress freeze yabba
-+ for i in xz lzip lzma bzip2 gzip bzip tzip pack compress freeze yabba
- do
- eval F$i=missing
- for j in $DEFPATH
-@@ -1068,6 +1068,8 @@
- fi
-
- case $compress in
-+ *xz*) ext=".xz" ;;
-+ *lzip*) ext=".lz" ;;
- *lzma*) ext=".lzma" ;;
- *bzip2*) ext=".bz2" ;;
- *gzip*) ext=".gz" ;;
-@@ -1111,7 +1113,7 @@
- fi
-
- # unconditionally handle uncompression
--UNCOMPRESSORS="unlzma gunzip bzip2 pcat zcat fcat unyabba"
-+UNCOMPRESSORS="unxz lzip unlzma gunzip bzip2 pcat zcat fcat unyabba"
- for i in $UNCOMPRESSORS
- do
- eval F$i=missing
-@@ -1132,10 +1134,18 @@
- if [ $Fbzip2 != missing ]; then
- bzip2="$Fbzip2 -c -d"
- fi
-+unxz=missing
-+if [ $Funxz != missing ]; then
-+ unxz="$Funxz -c -d"
-+fi
- unlzma=missing
- if [ $Funlzma != missing ]; then
- unlzma="$Funlzma -c -d"
- fi
-+lzip=missing
-+if [ $Flzip != missing ]; then
-+ lzip="$Flzip -c -d"
-+fi
- pcat="$Fpcat"
- zcat="$Fzcat"
- fcat="$Ffcat"
-@@ -1164,6 +1174,12 @@
- bzip2)
- echo "Command to use for .bz2 files (standard bzip2)"
- echo $n "[`eval echo \\$$filter`] $c" ;;
-+ xz)
-+ echo "Command to use for .xz files (standard xz)"
-+ echo $n "[`eval echo \\$$filter`] $c" ;;
-+ lzip)
-+ echo "Command to use for .lz files (standard lzip)"
-+ echo $n "[`eval echo \\$$filter`] $c" ;;
- lzma)
- echo "Command to use for .lzma files (standard lzma)"
- echo $n "[`eval echo \\$$filter`] $c" ;;
-@@ -1228,6 +1244,8 @@
- case $compress_ext in
- .gz) decompress=$gunzip ;;
- .bz2) decompress=$bzip2 ;;
-+ .xz) decompress=$unxz ;;
-+ .lz) decompress=$lzip ;;
- .lzma) decompress=$unlzma ;;
- .z) decompress=$pcat ;;
- .Z) decompress=$zcat ;;
-@@ -1321,6 +1339,8 @@
- s,@zcat@,$zcat,
- s,@gunzip@,$gunzip,
- s,@bzip2@,$bzip2,
-+s,@lzip@,$lzip,
-+s,@unxz@,$unxz,
- s,@unlzma@,$unlzma,
- s,@unyabba@,$unyabba,
- s,@compress@,$compress,
-diff -Naur man-1.6f.orig/src/man.conf.in man-1.6f/src/man.conf.in
---- man-1.6f.orig/src/man.conf.in 2007-08-20 21:15:21.000000000 -0700
-+++ man-1.6f/src/man.conf.in 2009-02-22 19:30:38.916070400 -0800
-@@ -132,6 +132,8 @@
- #
- .gz @gunzip@
- .bz2 @bzip2@
-+.xz @unxz@
-+.lz @lzip@
- .lzma @unlzma@
- .z @pcat@
- .Z @zcat@
Index: patches/man-1.6g-i18n-1.patch
===================================================================
--- patches/man-1.6g-i18n-1.patch (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
+++ patches/man-1.6g-i18n-1.patch (revision 3eeef443e2590804a308ed9e72dc3f08c1fbb3dc)
@@ -0,0 +1,334 @@
+Submitted By: Joe Ciccone
+Date: 2011-01-08
+Initial Package Version: 1.6f
+Upstream Status: Unkown
+Origin: Mandriva
+Description: i18n Updates
+
+diff -Naur man-1.6g.orig/catopen/catopen.c man-1.6g/catopen/catopen.c
+--- man-1.6g.orig/catopen/catopen.c 2005-08-20 19:26:06.000000000 -0400
++++ man-1.6g/catopen/catopen.c 2011-01-08 20:29:31.874658039 -0500
+@@ -9,22 +9,63 @@
+ extern char *index (const char *, int); /* not always in */
+ extern char *my_malloc(int); /* in util.c */
+
++/* if the program has sgid/suid privileges then getenv doesn't return
++ * NLSPATH; so we set here a good default value.
++ */
+ #ifndef DEFAULT_NLSPATH
+ # if __GLIBC__ >= 2
+-# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N"
++# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N:/usr/share/locale/%l_%t/%N:/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);
++static nl_catd my_catopenpath(char *name, char *path, char *lang);
+
+ static /* this source included in gripes.c */
+ nl_catd
+ my_catopen(char *name, int oflag) {
+- nl_catd fd;
++ nl_catd fd = (nl_catd) -1;
++
++ /* using first the my_catopenpath, which looks with LANGUAGE
++ * and only if it fails ressort to catopen, it gives better i18n
++ */
++ {
++ char *nlspath, *lang, *s;
+
+- fd = catopen(name, oflag);
++ /*
++ * "If NLSPATH does not exist in the environment, or if a
++ * message catalog cannot be opened in any of the paths specified
++ * by NLSPATH, then an implementation defined default path is used"
++ */
++ nlspath = getenv("NLSPATH");
++ if (!nlspath)
++ nlspath = DEFAULT_NLSPATH;
++
++ lang = getenv("LANGUAGE");
++ if (!lang)
++ lang = getenv("LC_ALL");
++ if (!lang)
++ lang = getenv("LC_MESSAGES");
++ if (!lang)
++ lang = getenv("LANG");
++ if (!lang)
++ lang = "";
++
++ while(*lang && (fd == (nl_catd) -1)) {
++ s = index(lang, ':');
++ if (s) *s = 0;
++ fd = my_catopenpath(name, nlspath, lang);
++ if (s) lang=s+1;
++ else lang = "";
++ }
++ if (fd == (nl_catd) -1)
++ fd = my_catopenpath(name, nlspath, "en");
++ }
++
++ /* still not found, use the system catopen */
++ if (fd == (nl_catd) -1)
++ fd = catopen(name, oflag);
+
+ if (fd == (nl_catd) -1 && oflag) {
+ oflag = 0;
+@@ -32,8 +73,6 @@
+ }
+
+ if (fd == (nl_catd) -1) {
+- char *nlspath;
+-
+ /* The libc catopen fails - let us see if we can do better */
+ /* The quotes below are from X/Open, XPG 1987, Vol. 3. */
+
+@@ -58,17 +97,6 @@
+ #endif
+ }
+
+- /*
+- * "If NLSPATH does not exist in the environment, or if a
+- * message catalog cannot be opened in any of the paths specified
+- * by NLSPATH, then an implementation defined default path is used"
+- */
+-
+- nlspath = getenv("NLSPATH");
+- if (nlspath)
+- fd = my_catopenpath(name, nlspath);
+- if (fd == (nl_catd) -1)
+- fd = my_catopenpath(name, DEFAULT_NLSPATH);
+ }
+ return fd;
+ }
+@@ -90,15 +118,13 @@
+ *
+ */
+ static nl_catd
+-my_catopenpath(char *name, char *nlspath) {
+- int fd;
++my_catopenpath(char *name, char *nlspath, char *lang) {
+ nl_catd cfd = (nl_catd) -1;
+- char *path0, *path, *s, *file, *lang, *lang_l, *lang_t, *lang_c;
++ char *path0, *path, *s, *file, *lang_l, *lang_t, *lang_c;
+ int langsz, namesz, sz, lang_l_sz, lang_t_sz, lang_c_sz;
+
+ namesz = strlen(name);
+
+- lang = getenv("LANG");
+ if (!lang)
+ lang = "";
+ langsz = strlen(lang);
+@@ -194,14 +220,9 @@
+ path = s+1;
+ } else
+ path = 0;
+- fd = open(file, O_RDONLY);
+- if (fd != -1) {
+- /* we found the right catalog - but we don't know the
+- type of nl_catd, so close it again and ask libc */
+- close(fd);
+- cfd = catopen(file, 0);
+- break;
+- }
++ cfd = catopen(file, 0);
++ if (cfd != (nl_catd) -1)
++ break;
+ }
+
+ free(path0);
+diff -Naur man-1.6g.orig/configure man-1.6g/configure
+--- man-1.6g.orig/configure 2010-12-31 15:28:46.000000000 -0500
++++ man-1.6g/configure 2011-01-08 20:29:31.874658039 -0500
+@@ -416,9 +416,9 @@
+ fi
+ done
+ done
+- troff=""
+- nroff=""
+- jnroff=""
++ troff=/usr/bin/troff
++ nroff=/usr/bin/nroff
++ jnroff=/usr/bin/nroff
+ eqn=""
+ neqn=""
+ jneqn=""
+@@ -476,29 +476,32 @@
+ done
+ # -Tlatin1 is bad when utf8 is used, but needed for groff, not for nroff
+ # Hmm - also needed for nroff, to prevent double conversion on uxterm
++ Fgroff=/usr/bin/groff
++ Fnroff=/usr/bin/nroff
++ Fjnroff=/usr/bin/nroff
+ if test $Fgroff = "missing"
+ then
+ if test $Fnroff = "missing"
+ then
+- nroff="nroff -Tlatin1 -mandoc"
++ nroff="nroff -Tutf8 -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -Tutf8 -mandoc"
+ fi
+ troff="troff -mandoc"
+ echo "Warning: could not find groff"
+ else
+ if test $Fnroff = "missing"
+ then
+- nroff="$Fgroff -Tlatin1 -mandoc"
++ nroff="$Fgroff -Tutf8 -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -Tutf8 -mandoc"
+ fi
+ troff="$Fgroff -Tps -mandoc"
+- jnroff="$Fgroff -Tnippon -mandocj"
++ jnroff="$Fjnroff -Tutf8 -mandocj"
+ fi
+ eqn="$Fgeqn -Tps"
+- neqn="$Fgeqn -Tlatin1"
+- jneqn="$Fgeqn -Tnippon"
++ neqn="$Fgeqn -Tutf8"
++ jneqn="$Fgeqn -Tutf8"
+ tbl="$Fgtbl"
+ col="$Fcol"
+ vgrind="$Fvgrind"
+@@ -964,7 +967,7 @@
+
+ # What sections do we anticipate?
+
+-tmpsections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o"
++tmpsections="1 1p 8 2 3 3p 3pm 4 5 6 7 9 0p tcl n l p o"
+
+ if [ x$default = x ]; then
+ echo ""
+diff -Naur man-1.6g.orig/msgs/inst.sh man-1.6g/msgs/inst.sh
+--- man-1.6g.orig/msgs/inst.sh 2005-08-20 19:26:06.000000000 -0400
++++ man-1.6g/msgs/inst.sh 2011-01-08 20:29:31.874658039 -0500
+@@ -27,8 +27,7 @@
+ for j in $M; do
+ if [ -f $j ]; then
+ i=`echo $j | sed -e 's/mess.//; s/.cat//'`
+- dest=`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+- dest=${PREFIX}$dest
++ dest=${PREFIX}/`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+ echo "mkdir -p `dirname $dest`"
+ mkdir -p `dirname $dest`;
+ echo "install -c -m 644 $j $dest"
+diff -Naur man-1.6g.orig/src/apropos.sh man-1.6g/src/apropos.sh
+--- man-1.6g.orig/src/apropos.sh 2005-08-20 19:26:06.000000000 -0400
++++ man-1.6g/src/apropos.sh 2011-01-08 20:29:31.874658039 -0500
+@@ -60,16 +60,56 @@
+ esac
+ done
+
++# list of languages to look for
++LANG_LIST=`echo $LANGUAGE:$LC_ALL:$LC_MESSAGES:$LANG | tr ':' ' '`
++DIR_LIST=""
++for d in /var/cache/man $manpath /usr/lib
++do
++ for l in $LANG_LIST
++ do
++ if [ -d $d/$l ]
++ then
++ # check that the path is not already in the list
++ if ! echo "$DIR_LIST" | grep " $d/$l\b" > /dev/null
++ then
++ DIR_LIST="$DIR_LIST $d/$l"
++ fi
++ fi
++ done
++ DIR_LIST="$DIR_LIST $d"
++ # check that the path is not already in the list
++ if ! echo "$DIR_LIST" | grep " $d\b" > /dev/null
++ then
++ DIR_LIST="$DIR_LIST $d/$l"
++ fi
++done
++
+ while [ "$1" != "" ]
+ do
+ found=0
+- for d in /var/cache/man $manpath /usr/lib
++ # in order not to display lines in more than one language for
++ # a same man page; we check that a given man page name
++ # hasn't already been displayed
++ BAZ=""
++ for d in $DIR_LIST
+ do
+ if [ -f $d/whatis ]
+ then
+- if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
++ if FOO=`grep -"$grepopt1" "$grepopt2""$1" $d/whatis`
+ then
+- found=1
++ # the LC_ALL=C is needed in case the text is
++ # in a different encoding than the locale
++ BAR=`echo -e "$FOO" | LC_ALL=C sed 's/ - .*$//' | tr ' []' '_' | sort -u`
++ for i in $BAR
++ do
++ if ! echo "$BAZ" | grep "$i" > /dev/null
++ then
++ BAZ="$BAZ $i"
++ i="^`echo $i | sed 's:_\+:\\\(\[_ \]\\\|\\\[\\\|\\\]\\\)\\\+:g'`"
++ echo -e "$FOO" | grep "$i"
++ found=1
++ fi
++ done
+ # Some people are satisfied with a single occurrence
+ # But it is better to give all
+ # break
+diff -Naur man-1.6g.orig/src/makewhatis.sh man-1.6g/src/makewhatis.sh
+--- man-1.6g.orig/src/makewhatis.sh 2007-09-17 14:35:14.000000000 -0400
++++ man-1.6g/src/makewhatis.sh 2011-01-08 20:29:31.878656601 -0500
+@@ -55,6 +55,9 @@
+ dc=
+ for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man
+ do
++ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
++ if [ x$dc = x ]; then dm="$d/$LANG"; else dm=$dc:"$d/$LANG"; fi
++ fi
+ if [ -d $d ]; then
+ if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
+ fi
+@@ -227,7 +230,7 @@
+ section=$i
+ curdir=$mandir/${pages}$i
+ export section verbose curdir
+- find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
++ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" '
+
+ function readline() {
+ if (use_zcat || use_bzcat || use_lzcat) {
+@@ -315,6 +318,7 @@
+ if ($1 ~ /^\.[Ss][HhYS]/ ||
+ (pages == "cat" &&
+ ($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
++ $1 ~ MAN_DESCRIPTION ||
+ $1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
+ $1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
+ $0 ~ /^[^ ]/))) {
+diff -Naur man-1.6g.orig/src/manpath.c man-1.6g/src/manpath.c
+--- man-1.6g.orig/src/manpath.c 2006-08-03 17:18:33.000000000 -0400
++++ man-1.6g/src/manpath.c 2011-01-08 20:29:31.878656601 -0500
+@@ -282,13 +282,14 @@
+ /* We cannot use "lang = setlocale(LC_MESSAGES, NULL)" or so:
+ the return value of setlocale is an opaque string. */
+ /* POSIX prescribes the order: LC_ALL, LC_MESSAGES, LANG */
+- if((lang = getenv("LC_ALL")) != NULL)
++ /* LANGUAGE is GNU/Linux and overrules all */
++ if((lang = getenv("LANGUAGE")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LC_MESSAGES")) != NULL)
++ else if((lang = getenv("LC_ALL")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LANG")) != NULL)
++ else if((lang = getenv("LC_MESSAGES")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LANGUAGE")) != NULL)
++ else if((lang = getenv("LANG")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+ add_to_mandirlist_x(dir, 0, perrs);
+ }