--- /dev/null
+AUX makewhatis.cron 115 BLAKE2B 55491e18ad63037715d611cb2f2dbd9a577616bda54ade3b74e88dc5e3cea679ef6ac3486b0682cb385f68ae307eb0ccbcc521f0eb15a9adb0ac5c88877aaf3e SHA512 378f1980da40d67d82e3ed6a8d470df58180ca3eeee1d9f6df5d8eec7101461ee0af2f5d7c1da81af086f0aad0665bdffd4c6ee65418dff5f7c187a39b2e79b8
+AUX man-1.5m2-apropos.patch 450 BLAKE2B 911c3a05d3f82a196091c59ca55706b4b0b9c49da0ccb5f912dcde345708997a581af0620f75a3ff71de29eb82c7609b9c6ddf0ce5ab56000e74c97aa823df90 SHA512 cf8c5f6debe6de3a424d1b4cb4cd234e2524477150fb726f7dc659ed436d491c0506649f63d06f1b825765d48e18736ef6476dcbbb27aabe1d1a3b47d7bf7317
+AUX man-1.6-cross-compile.patch 1748 BLAKE2B 9cab0cec9ad887068c6124bce49f4faf93545c5eed264c6fda0b145c5fe8e8215690d16359974601b8e962cb1e25cde618b425db4a000271cd590eb44ec76df5 SHA512 9f4d851ed77d7cb7771b6a49bed59545e1312d7f82665ff526712c892ecf1269487aeffa67062eb36bbb2d4b9467d6b626501aaec23a0e37fc2eb9a1ebc7a4fb
+AUX man-1.6c-cut-duplicate-manpaths.patch 2148 BLAKE2B 19ae613d1f3d340fb16a788a5097e06f87ea3be767765aea1d16826bb681e1191043397fb06e06b0772cbff04762a968e07cbdc480765bbf64a363715c23a6f3 SHA512 00141e89313e5dd4bf781c2010ca1aea4f8c265339cb4a46ee596870388b41e78135191b0266f4d1046a15f92d404477622139baf5f92a9692c8f9ee79d3a820
+AUX man-1.6e-headers.patch 245 BLAKE2B cd24dfe04d7ddcb3f816056048d2bcca519e0a08b5e09b8343c6b0be670933df02552a1ac7906f90e9254c5411ec1e0df1e23845ac02d47ce79edc840f378abc SHA512 233a76c081f81efa41b0da1aae245d2bf713824b12add7daaf00404399c5c1023c91e28e168e97b9fde537af6844a992da4f9d876776263ed9018587a16243b8
+AUX man-1.6f-makewhatis-compression-cleanup.patch 2384 BLAKE2B f1b6ae414c95b16018ae49a26c1d9a087210049f3d9a3725c215f52f715b0a43d030beb1089cc5131b24439dfaa9607b39ebca643aa06a1d524e7d3aa9f77756 SHA512 24e85bda51ab9ce27d15bae0403b7528cd808b32642e677512806cd88afb6ba2b76cfc6550eeb18cf7cdc7fcf348eca01bbed1b0da3680f53ffb73f824316c10
+AUX man-1.6f-man2html-compression-2.patch 1741 BLAKE2B 51baebadffcc5f58eb7b980c0eddac550ecc98a682ced9ca0ffae6318a806536e42ae5f13d1d061ddd2d41f6ef792f2eb6eac1c1a00e2a8f730de54a3b6589f5 SHA512 85dfdffaaddefff9bfb7b92ab274dcc2e88d880d11c67b0690ff4a92a2a6d3a3b65ad4d425f09bfd042b041b316ec9cb6d1ba6e0a4c13fdf71c9524c50ffe7d0
+AUX man-1.6f-parallel-build.patch 2312 BLAKE2B bd6172dc6fa3d7c590031da255092a61e0c2947c2f4aeabf8968b77a5a23b917ee65d24cfae2a38bfc3bf1efe0bc8c0ee48669ab794935d938671198fa54b73c SHA512 03bfd0c86d9d17eba4073a94d59a2d1fabc88fc373831796d65c1caf3f45ff17014f3bd314ece01be80746845961ef7f03e7b8e153e3e71ced77f43736f34bf8
+AUX man-1.6f-so-search-2.patch 1062 BLAKE2B 50f2cba7b420042c93942309528a3712e45a171a091498f8149009832a42bc8723a5963909a9086e25d14848e422dbd99282f74f14264e64020d9692dc8d1c2b SHA512 af21ff66a9bb0f6a47d98c1fe73fe99a4c0addce6496be154ccd7ede2efb51e80464156337ae40df9aed3a10daceb486f8785dd1130b50d59d4e991406dc70c6
+AUX man-1.6f-unicode.patch 656 BLAKE2B 5e35e50768106d12e11a83a71f63ba35ceffcaffbd9bfe917d090bb4b1257f36bc1055b79f5e0c1e5eba8a9f21c8858c39fd54e8285be421045f3a28ab353bb4 SHA512 f91ebf0886794bb1f3ccc2207cd5fb7dbd83f0dd727470a9270481c7c33dcf1c78e99a62d097232ca964b639764fc1c76ae88380775dc79ee4ed18a6cd677b97
+AUX man-1.6g-compress.patch 347 BLAKE2B bae29d07f89e71fb2fbc04305f67b5c6bdb0c660a428236c7cf2019403c74c8b6603e61b09d4e9da1677cce46b6ab252651c4e71b48a44ed37116374aeca21e8 SHA512 2901e2d77509245880686ad1c2baab9648952bb0eef7bdd6b77ec20d054373464e237a100acec5ace95935708b1b226d18990c48d9a864f384cc6afe7ed6cf96
+AUX man-1.6g-fbsd.patch 366 BLAKE2B 882b3b3048e3dcb4f64f38e94d7603ae577038dce6636d6b2cbcb76a96b1c54427ddff737429e9e464fc50d0956cf9a9da86c0689bb6ebd8ae84d5d8f15727a6 SHA512 4019267584b1350b2c9da9aa1851a2e4e96f271265d189ecd677206be20dac67cd212b2887f844f43c10d96076a76613a12e53f3b29a185ec62ed4bff4c5a502
+AUX man-1.6g-nonportable-echo.patch 607 BLAKE2B c04845b50fc1f7e962ff40e6173e14293c83b675c1db87de9f9a442ac8fdb4a27fe75d6d83a587da611f7fee214a79e4a449bd3d5f00afa6925798068674fb64 SHA512 ddbbe14755a0ccea627a734c37428485a5f310ab916a230707b45ed503e629518cc7ea81aa5097b0bd403f2fa6e1305dce246c01e791987f5f11901b1d100b6e
+AUX man-1.6g-xz.patch 1848 BLAKE2B 6a0855eda72386a0f48e715e9ba620b3473b3aa854c42fabd93bc02b7c9cd44fbd07f2608257fe953bdfa9b02e8fa35876d651ba5aab99937fe42325fcfb7b69 SHA512 6a883fa800a6d3b11c76a70e1a31c0736d380271c9f21315863ddaca9529e3d613b587724287fb94bab2b0d97215f6ccb3f1438a5c5e339e5a2edf872c92515c
+DIST man-1.6g.tar.gz 256906 BLAKE2B f13e21400aecd41a5f001b37bf3c6f9fd8463ff627f761cfd0a6846c7b8dac48a6dc87ff2cf4786b55800a558141cffcc0d66420943e46f708292f5653b42d51 SHA512 c786fa2201aed92293e5590dc3ad5d550cf14e5059fa274ef7719af86ee4c892e747576495b6dc0a09286e73e2f0f0caf860216e0c8032d9ef13e5d26853048b
+EBUILD man-1.6g-r1.ebuild 4385 BLAKE2B f7af3f05d4fdcc3b0395c05107a7e1523d84f51bd22dcfcc58bf3c5b7dd04e7b296ff7d8aca4207ab2cfc4549388a989261ca5cd2d129db19ec42c576e72e049 SHA512 414b3cf02d10811c3855c33220e5f14717e3b4a6057e6be6f28dd12bb11770bb47468902c19e0bccafc689015a3e05da3c4e5236474c328c1bf9c6859cab42c5
--- /dev/null
+#!/bin/sh
+# this is part of the man package
+# it updates the search database for manpages
+
+exec nice makewhatis -u
--- /dev/null
+Ripped from Fedora
+
+--- man-1.5m2/src/apropos.sh
++++ man-1.5m2/src/apropos.sh
+@@ -19,9 +19,9 @@
+
+ # 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='ai'
+ aproposgrepopt2=''
+-whatisgrepopt1='iw'
++whatisgrepopt1='aiw'
+ whatisgrepopt2='^'
+ grepopt1=$%apropos_or_whatis%grepopt1
+ grepopt2=$%apropos_or_whatis%grepopt2
--- /dev/null
+Fix up to work with cross-compiling ... most of these tests only
+need to see if the example compiled, not whether it runs ...
+
+--- a/configure
++++ b/configure
+@@ -232,15 +232,13 @@
+
+ echo checking for POSIX.1 header files
+ echo "#include <unistd.h>
+-main() {
+ #ifdef _POSIX_VERSION
+-exit(0);
++main() { exit(0); }
+ #else
+-exit(1);
+-#endif
+-}" > conftest.c
++# error no _POSIX_VERSION
++#endif" > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then
++if test -s conftest ; then
+ DEFS="$DEFS -DPOSIX"
+ fi
+ rm -f conftest conftest.c
+@@ -249,7 +247,7 @@
+ echo "#include <strings.h>
+ main() { exit(0); rindex(0, 0); bzero(0, 0); }" > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then :
++if test -s conftest ; then :
+ else DEFS="$DEFS -DUSG"
+ fi
+ rm -f conftest conftest.c
+@@ -258,7 +256,7 @@
+ echo '#include <sys/types.h>
+ main() { uid_t x; exit(0); }' > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then :
++if test -s conftest ; then :
+ else
+ uid_t=`awk '/pw_uid;/ {print $1}' $INCLUDEDIR/pwd.h`
+ DEFS="$DEFS -Duid_t=${uid_t} -Dgid_t=${uid_t}"
+@@ -291,7 +289,7 @@
+ #endif
+ main() { char *p = (char *) alloca(1); exit(0); }' > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then :
++if test -s conftest ; then :
+ elif test -d /usr/ucblib; then LIBS="$LIBS -L/usr/ucblib -lucb"
+ elif test -f /usr/lib/libPW.a; then LIBS="$LIBS -lPW"
+ else DEFS="$DEFS -DALLOCA_MISSING"
+@@ -321,7 +319,7 @@
+ struct option long_opts[] = { { "", no_argument, NULL, 0 } };
+ main() { exit(0); }' > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then
++if test -s conftest ; then
+ manpathoption="--path"
+ else
+ manpathoption="-w"
--- /dev/null
+http://bugs.gentoo.org/90186
+
+If we have entries in MANPATH that are really symlinks to other entries,
+then many man functions will yield duplicate entries.
+
+Without this patch, we see this behavior:
+$ echo $MANPATH
+/usr/share/man:/usr/man
+$ man --path
+/usr/share/man:/usr/man
+$ ls -ld /usr/share/man /usr/man
+lrwxrwxrwx 1 /usr/man -> /usr/share/man
+drwxr-xr-x 36 /usr/share/man
+$ man -k passwd
+passwd (1) - change user password
+passwd (1) - change user password
+
+With this patch, we get:
+$ echo $MANPATH
+/usr/share/man:/usr/man
+$ man --path
+/usr/share/man
+$ ls -ld /usr/share/man /usr/man
+lrwxrwxrwx 1 /usr/man -> /usr/share/man
+drwxr-xr-x 36 /usr/share/man
+$ man -k passwd
+passwd (1) - change user password
+
+--- man-1.6c/src/manpath.c
++++ man-1.6c/src/manpath.c
+@@ -380,6 +380,44 @@
+ }
+ }
+
++void trim_symlinked_manpaths (void);
++void
++trim_symlinked_manpaths () {
++ /*
++ * Skip symlinks to other entries in path.
++ * Do this after we've built the entire list.
++ */
++ struct stat *stat_cache;
++ size_t i, j, size;
++
++ if (!mandirlist)
++ return;
++
++ for (size = 0; mandirlist[size]; ++size)
++ /* count # of elements */;
++ if (size == 0)
++ return;
++ /* cache stat information for every element */
++ stat_cache = (struct stat *) my_malloc (size * sizeof(*stat_cache));
++ for (i = 0; i < size; ++i)
++ stat(mandirlist[i], &stat_cache[i]);
++
++#define EQU_STAT(s,d) ((s).st_dev == (d).st_dev && (s).st_ino == (d).st_ino)
++ for (i = 0; i < size; ++i) {
++ for (j = i+1; j < size; ++j) {
++ if (EQU_STAT(stat_cache[i], stat_cache[j])) {
++ /* these two entries are the same, so cut out the second one */
++ memmove(mandirlist+j, mandirlist+j+1, (size-j)*sizeof(*mandirlist));
++ memmove(stat_cache+j, stat_cache+j+1, (size-j)*sizeof(*stat_cache));
++ mandirlist[--size] = NULL;
++ --j;
++ }
++ }
++ }
++
++ free(stat_cache);
++}
++
+ void
+ init_manpath () {
+ static int done = 0;
+@@ -391,6 +431,7 @@
+ (manp = getenv ("MANPATH")) == NULL)
+ manp = ""; /* default path */
+ split (manp, to_mandirlist, 0);
++ trim_symlinked_manpaths ();
+ done = 1;
+ }
+ }
--- /dev/null
+--- a/gencat/genlib.c
++++ b/gencat/genlib.c
+@@ -49,10 +49,8 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
+-#ifdef SYSV
+ #include <sys/types.h>
+ #include <unistd.h>
+-#endif
+
+ #if !defined(__linux__) && !defined(__FreeBSD__)
+ #include <memory.h>
--- /dev/null
+http://bugs.gentoo.org/331979
+
+patch by William Throwe <wthrowe@mit.edu>
+
+The problem is that a failed match() resets the RSTART variable used to
+extract filename_no_gz (visible in the trailing context of the patch),
+so it is important that no more match() commands are attempted after the
+successful one. Without the scoping, if (for example) the test for .bz2
+succeeds, it prevents testing for .lzma, but doesn't prevent testing for
+.xz. The failing .xz test causes RSTART to be set to zero so
+filename_no_gz becomes the empty string.
+
+--- man-1.6f/src/makewhatis.sh
++++ man-1.6f/src/makewhatis.sh
+@@ -234,7 +234,7 @@
+ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
+
+ function readline() {
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (use_compression) {
+ result = (pipe_cmd | getline);
+ if (result < 0) {
+ print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
+@@ -249,7 +249,7 @@
+ }
+
+ function closeline() {
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (use_compression) {
+ return close(pipe_cmd);
+ } else {
+ return close(filename);
+@@ -263,16 +263,20 @@
+ if (verbose) {
+ print "adding " filename > "/dev/stderr"
+ }
+-
++
+ use_zcat = match(filename,"\\.Z$") ||
+ match(filename,"\\.z$") || match(filename,"\\.gz$");
+- if (!use_zcat)
++ if (!use_zcat) {
+ use_bzcat = match(filename,"\\.bz2");
+- if(!use_bzcat)
+- use_lzcat = match(filename,"\\.lzma");
+- if(!use_lzcat)
+- use_xzcat = match(filename,"\\.xz");
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (!use_bzcat) {
++ use_lzcat = match(filename,"\\.lzma");
++ if (!use_lzcat) {
++ use_xzcat = match(filename,"\\.xz");
++ }
++ }
++ }
++ use_compression = (use_zcat || use_bzcat || use_lzcat || use_xzcat);
++ if (use_compression) {
+ filename_no_gz = substr(filename, 0, RSTART - 1);
+ } else {
+ filename_no_gz = filename;
+@@ -285,7 +289,7 @@
+ actual_section = section;
+ }
+ sub(/\..*/, "", progname);
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (use_compression) {
+ if (use_zcat) {
+ pipe_cmd = "zcat \"" filename "\"";
+ } else if (use_bzcat) {
--- /dev/null
+add support for bzip2/lzma to man2html and friends
+
+--- a/man2html/glimpse_filters
++++ b/man2html/glimpse_filters
+@@ -1,3 +1,6 @@
++*.bz2 bzip2 -d -c
++*.lzma lzma -d -c
++*.xz xz -d -c
+ *.gz gzip -d -c
+ *.Z gzip -d -c
+
+--- a/man2html/scripts/cgi-bin/man/man2html
++++ b/man2html/scripts/cgi-bin/man/man2html
+@@ -93,6 +93,12 @@
+ *.bz2)
+ bzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
+ ;;
++ *.lzma)
++ lzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
++ ;;
++ *.xz)
++ xzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
++ ;;
+ *)
+ "$MAN2HTML" "$LL" "$PAGE"
+ ;;
+@@ -103,6 +106,12 @@
+ elif [ -r "$PAGE".bz2 ]
+ then
+ bzcat "$PAGE".bz2 | "$MAN2HTML" "$LL" -D "$PAGE"
++elif [ -r "$PAGE".lzma ]
++then
++ lzcat "$PAGE".lzma | "$MAN2HTML" "$LL" -D "$PAGE"
++elif [ -r "$PAGE".xz ]
++then
++ xzcat "$PAGE".xz | "$MAN2HTML" "$LL" -D "$PAGE"
+ else
+ "$MAN2HTML" -E "Strange... Cannot find (or read) $PAGE."
+ fi
+--- a/man2html/scripts/cgi-bin/man/mansearch
++++ b/man2html/scripts/cgi-bin/man/mansearch
+@@ -153,7 +153,7 @@
+ }
+ print "<DT> <a href=\"" cgipath "/man2html?" fullname "\">";
+ textname = filename;
+- sub(/\.(gz)|Z|z$/, "", textname);
++ sub(/\.([zZ]|gz|bz2|lzma|xz)$/, "", textname);
+ sub(/\./, "(", textname);
+ textname = textname ")";
+ print textname;
+--- a/man2html/scripts/cgi-bin/man/mansec
++++ b/man2html/scripts/cgi-bin/man/mansec
+@@ -128,7 +128,7 @@
+ # Print out alphabetic quick index and other links
+ }
+ # Split page.n into "page" and "n" and generate an entry
+- sub(/[.]([zZ]|(gz))$/, "", manpage);
++ sub(/[.]([zZ]|gz|bz2|lzma|xz)$/, "", manpage);
+ match(manpage, /[.][^.]+$/);
+ title = substr(manpage, 1, RSTART - 1);
+ if (section != "all") {
--- /dev/null
+http://bugs.gentoo.org/207148
+
+patch by Kevin Pyle to fix parallel build issues
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -42,9 +42,12 @@
+ makemsg:
+ $(BUILD_CC) -o makemsg makemsg.c
+
+-msg.c gripedefs.h: ../msgs/mess.en makemsg
++gripedefs.h: ../msgs/mess.en makemsg
+ ./makemsg ../msgs/mess.en gripedefs.h msg.c
+
++# avoid parallel build issues with makemsg
++msg.c: gripedefs.h
++
+ # glob.c does not have prototypes
+ glob.o: glob.c ndir.h
+ $(CC) -c $(CWARNNP) $(CFLAGS) -I. $(DEFS) glob.c
+
+http://bugs.gentoo.org/258916
+
+avoid:
+ make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
+
+--- a/man/Makefile.in
++++ b/man/Makefile.in
+@@ -3,7 +3,7 @@
+ MAN5 = man.conf
+ MAN8 = makewhatis
+ ALL = man.1 whatis.1 apropos.1 man.conf.5
+-MAYBE8 = makewhatis
++MAYBE8 = $(wildcard makewhatis.man)
+
+ .SUFFIXES: .man .1 .5 .8
+
+@@ -21,9 +21,7 @@
+ # Where to put the manual pages.
+ mandir = $(DESTDIR)$(PREFIX)@mandir@$(SLANG)
+
+-all: $(ALL)
+- for i in $(MAYBE8); \
+- do if test -f $$i.man; then make -f ../Makefile $$i.8; fi; done
++all: $(ALL) $(MAYBE8:.man=.8)
+
+ install: $(ALL)
+ mkdir -p $(mandir)/man1 $(mandir)/man5 $(mandir)/man8
+@@ -39,18 +37,17 @@
+
+ spotless:
+
+-subdirs:
+- @for i in @languages@; do if test -d $$i; then echo; \
+- echo "==== Making the `cat $$i.txt` man pages. ===="; \
+- cd $$i; make -f ../Makefile; cd ..; \
+- else echo "==== No $$i man pages found. ===="; fi; done
+-
+-installsubdirs:
+- @for i in @languages@; do if test -d $$i; then echo; \
+- echo "==== Installing the `cat $$i.txt` man pages. ===="; \
+- cd $$i; SLANG=/$$i; if test $$SLANG = /en; then SLANG= ; fi; \
+- export SLANG; make -f ../Makefile install; cd ..; \
+- else echo "==== No $$i man pages found. ===="; fi; done
++MAN_LANGS = $(wildcard @languages@)
++subdirs: $(MAN_LANGS:=_lang_subdir)
++%_lang_subdir:
++ @echo "==== Making the `cat $(@:_lang_subdir=).txt` man pages. ===="
++ $(MAKE) -f ../Makefile -C $(@:_lang_subdir=)
++
++installsubdirs: $(MAN_LANGS:=_lang_installsubdir)
++%_lang_installsubdir:
++ @echo "==== Making the `cat $(@:_lang_installsubdir=).txt` man pages. ===="
++ $(MAKE) -f ../Makefile -C $(@:_lang_installsubdir=) install \
++ SLANG=`s=$(@:_lang_installsubdir=); test $$s = en || echo /$$s`
+
+ cleansubdirs:
+ @for i in ??; do cd $$i; make -f ../Makefile clean; cd ..; done
--- /dev/null
+improve the uncompressed .so search
+
+--- a/src/man.c
++++ b/src/man.c
+@@ -381,13 +381,23 @@ again:
+ }
+ /*
+ * Some people have compressed man pages, but uncompressed
+- * .so files - we could glob for all possible extensions,
+- * for now: only try .gz
++ * .so files - we should discover this list dynamically, but
++ * for now just hardcode it.
+ */
+- else if (fp == NULL && get_expander(".gz") &&
+- strlen(name)+strlen(".gz") < BUFSIZE) {
+- strcat(name, ".gz");
+- fp = fopen (name, "r");
++ else if (fp == NULL) {
++#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
++ size_t i, name_len = strlen(name);
++ const char *extensions[] = { ".gz", ".bz2", ".lzma", ".xz", ".z", ".Z" };
++ for (i = 0; i < ARRAY_SIZE(extensions); ++i) {
++ const char *comp = extensions[i];
++ name[name_len] = '\0';
++ if (get_expander(comp) && name_len+strlen(comp) < BUFSIZE) {
++ strcat(name, comp);
++ fp = fopen(name, "r");
++ if (fp)
++ break;
++ }
++ }
+ }
+
+ if (fp == NULL) {
--- /dev/null
+let the active locale work its magic
+
+http://bugs.gentoo.org/146315
+
+--- man-1.6f/configure
++++ man-1.6f/configure
+@@ -473,9 +473,9 @@
+ then
+ if test $Fnroff = "missing"
+ then
+- nroff="nroff -Tlatin1 -mandoc"
++ nroff="nroff -Tascii -c -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -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 -mandoc"
+ fi
+ troff="$Fgroff -Tps -mandoc"
+ jnroff="$Fgroff -Tnippon -mandocj"
+
--- /dev/null
+allow selection of default cache compressor
+
+http://bugs.gentoo.org/205147
+
+--- a/configure
++++ b/configure
+@@ -1012,6 +1012,10 @@
+ done
+ done
+
++ if [ x$COMPRESS != x ]; then
++ compress=$COMPRESS
++ fi
++
+ if [ x$default = x ]; then
+ echo ""
+ echo "What program should be used to compress the formatted pages?"
--- /dev/null
+Fixes compilation in FreeBSD
+
+http://bugs.gentoo.org/138123
+
+--- man-1.6g/gencat/genlib.c
++++ man-1.6g/gencat/genlib.c
+@@ -54,7 +54,7 @@
+ #include <unistd.h>
+ #endif
+
+-#if !defined(__linux__) && !defined(__CYGWIN__)
++#if !defined(__linux__) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
+ #include <memory.h>
+ static int bcopy(src, dst, length)
+ char *src, *dst;
--- /dev/null
+diff --git a/src/man.c b/src/man.c
+index 62eaee4a0fed..3d4a8d0bcbcf 100644
+--- a/src/man.c
++++ b/src/man.c
+@@ -616,7 +616,7 @@ make_roff_command (const char *path, const char *file) {
+ the current position plus 10 lines. This plus setpl()
+ gives us a single page that just contains the whole
+ man page. (William Webber, wew@cs.rmit.edu.au) */
+- strcat(buft, "; echo \".\\\\\\\"\"; echo \".pl \\n(nlu+10\"");
++ strcat(buft, "; printf '%s\\n' \".\\\\\\\"\" \".pl \\n(nlu+10\"");
+ #if 0
+ /* In case this doesnt work for some reason,
+ michaelkjohnson suggests: I've got a simple
--- /dev/null
+add support for xz
+
+http://bugs.gentoo.org/302380
+
+--- a/src/makewhatis.sh
++++ b/src/makewhatis.sh
+@@ -230,7 +230,7 @@
+ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
+
+ function readline() {
+- if (use_zcat || use_bzcat || use_lzcat) {
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ result = (pipe_cmd | getline);
+ if (result < 0) {
+ print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
+@@ -245,7 +245,7 @@
+ }
+
+ function closeline() {
+- if (use_zcat || use_bzcat || use_lzcat) {
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ return close(pipe_cmd);
+ } else {
+ return close(filename);
+@@ -266,7 +266,9 @@
+ use_bzcat = match(filename,"\\.bz2");
+ if(!use_bzcat)
+ use_lzcat = match(filename,"\\.lzma");
+- if (use_zcat || use_bzcat || use_lzcat ) {
++ if(!use_lzcat)
++ use_xzcat = match(filename,"\\.xz");
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ filename_no_gz = substr(filename, 0, RSTART - 1);
+ } else {
+ filename_no_gz = filename;
+@@ -279,13 +281,15 @@
+ actual_section = section;
+ }
+ sub(/\..*/, "", progname);
+- if (use_zcat || use_bzcat || use_lzcat) {
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ if (use_zcat) {
+ pipe_cmd = "zcat \"" filename "\"";
+ } else if (use_bzcat) {
+ pipe_cmd = "bzcat \"" filename "\"";
+- } else {
++ } else if (use_lzcat) {
+ pipe_cmd = "lzcat \"" filename "\"";
++ } else {
++ pipe_cmd = "xzcat \"" filename "\"";
+ }
+ # try to avoid suspicious stuff
+ if (filename ~ /[;&|`$(]/) {
--- /dev/null
+# Copyright © 2018 Nick Bowler
+# License GPLv2+: GNU General Public License version 2 or any later version.
+# This is free software: you are free to change and distribute it.
+# There is NO WARRANTY, to the extent permitted by law.
+#
+# This a modified version of the original ebuild from Gentoo GNU/Linux,
+# covered by the following copyright and permission notice:
+#
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils prefix toolchain-funcs user
+
+DESCRIPTION="Standard commands to read man pages"
+HOMEPAGE="http://primates.ximian.com/~flucifredi/man/"
+SRC_URI="http://primates.ximian.com/~flucifredi/man/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="+lzma nls selinux"
+
+DEPEND="nls? ( sys-devel/gettext )"
+RDEPEND="|| ( >=sys-apps/groff-1.19.2-r1 app-doc/heirloom-doctools )
+ !sys-apps/man-db
+ !<app-arch/lzma-4.63
+ lzma? ( app-arch/xz-utils )
+ selinux? ( sec-policy/selinux-makewhatis )"
+
+pkg_setup() {
+ enewgroup man 15
+ enewuser man 13 -1 /usr/share/man man
+}
+
+PATCHES=(
+ "${FILESDIR}"/man-1.6f-man2html-compression-2.patch
+ "${FILESDIR}"/man-1.6-cross-compile.patch
+ "${FILESDIR}"/man-1.6f-unicode.patch #146315
+ "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
+ "${FILESDIR}"/man-1.5m2-apropos.patch
+ "${FILESDIR}"/man-1.6g-fbsd.patch #138123
+ "${FILESDIR}"/man-1.6e-headers.patch
+ "${FILESDIR}"/man-1.6f-so-search-2.patch
+ "${FILESDIR}"/man-1.6g-compress.patch #205147
+ "${FILESDIR}"/man-1.6f-parallel-build.patch #207148 #258916
+ "${FILESDIR}"/man-1.6g-xz.patch #302380
+ "${FILESDIR}"/man-1.6f-makewhatis-compression-cleanup.patch #331979
+ "${FILESDIR}"/man-1.6g-nonportable-echo.patch #651038
+)
+
+src_prepare() {
+ # make sure `less` handles escape sequences #287183
+ sed -i -e '/^DEFAULTLESSOPT=/s:"$:R":' configure
+ default
+}
+
+echoit() { echo "$@" ; "$@" ; }
+src_configure() {
+ strip-linguas $(eval $(grep ^LANGUAGES= configure) ; echo ${LANGUAGES//,/ })
+
+ unset NLSPATH #175258
+
+ tc-export CC BUILD_CC
+
+ local mylang=
+ if use nls ; then
+ if [[ -z ${LINGUAS} ]] ; then
+ mylang="all"
+ else
+ mylang="${LINGUAS// /,}"
+ fi
+ else
+ mylang="none"
+ fi
+ export COMPRESS
+ if use lzma ; then
+ COMPRESS="${EPREFIX}"/usr/bin/xz
+ else
+ COMPRESS="${EPREFIX}"/bin/bzip2
+ fi
+
+ if [[ -n ${EPREFIX} ]]; then
+ hprefixify configure || die
+ sed -i \
+ -e "s/man_user=root/man_user=$(id -u)/" \
+ -e "s/man_group=man/man_group=$(id -g)/" \
+ configure || die "Failed to disable suid/sgid options for man"
+ sed -i -e 's:/usr/bin:@bindir@:' man2html/Makefile.in || die
+ fi
+
+ echoit \
+ ./configure \
+ -bindir="${EPREFIX}"/usr/bin \
+ -confdir="${EPREFIX}"/etc \
+ +sgid +fhs \
+ +lang ${mylang} \
+ || die "configure failed"
+}
+
+src_install() {
+ unset NLSPATH #175258
+
+ emake PREFIX="${D}" install || die "make install failed"
+ dosym man /usr/bin/manpath
+
+ dodoc LSM README* TODO
+
+ # makewhatis only adds man-pages from the last 24hrs
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/makewhatis.cron makewhatis
+
+ keepdir /var/cache/man
+ [[ -z ${EPREFIX} ]] && diropts -m0775 -g man
+ local mansects=$(grep ^MANSECT "${ED}"/etc/man.conf | cut -f2-)
+ for x in ${mansects//:/ } ; do
+ keepdir /var/cache/man/cat${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:0 "${ROOT}"/var/cache/man/whatis
+
+ echo
+
+ local f files=$(ls "${ROOT}"/etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null)
+ for f in ${files} ; do
+ [[ ${f} == */etc/cron.daily/makewhatis ]] && continue
+ [[ $(md5sum "${f}") == "8b2016cc778ed4e2570b912c0f420266 "* ]] \
+ && rm -f "${f}"
+ done
+ 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:"
+ ewarn ${files}
+ fi
+
+ if has_version app-doc/heirloom-doctools; then
+ ewarn "Please note that the /etc/man.conf file installed will not"
+ ewarn "work with heirloom's nroff by default (yet)."
+ ewarn ""
+ ewarn "Check app-doc/heirloom-doctools elog messages for the proper"
+ ewarn "configuration."
+ fi
+}