summaryrefslogtreecommitdiff
path: root/sys-apps/man
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/man
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/man')
-rw-r--r--sys-apps/man/Manifest20
-rw-r--r--sys-apps/man/files/makewhatis.cron5
-rw-r--r--sys-apps/man/files/man-1.5m2-apropos.patch16
-rw-r--r--sys-apps/man/files/man-1.6-cross-compile.patch61
-rw-r--r--sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch83
-rw-r--r--sys-apps/man/files/man-1.6e-headers.patch13
-rw-r--r--sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch69
-rw-r--r--sys-apps/man/files/man-1.6f-man2html-compression-2.patch61
-rw-r--r--sys-apps/man/files/man-1.6f-parallel-build.patch78
-rw-r--r--sys-apps/man/files/man-1.6f-so-search-2.patch34
-rw-r--r--sys-apps/man/files/man-1.6f-unicode.patch28
-rw-r--r--sys-apps/man/files/man-1.6g-compress.patch17
-rw-r--r--sys-apps/man/files/man-1.6g-echo-escape.patch15
-rw-r--r--sys-apps/man/files/man-1.6g-fbsd.patch15
-rw-r--r--sys-apps/man/files/man-1.6g-xz.patch53
-rw-r--r--sys-apps/man/man-1.6g-r1.ebuild128
-rw-r--r--sys-apps/man/man-1.6g.ebuild127
-rw-r--r--sys-apps/man/metadata.xml8
18 files changed, 831 insertions, 0 deletions
diff --git a/sys-apps/man/Manifest b/sys-apps/man/Manifest
new file mode 100644
index 000000000000..1a218613aa95
--- /dev/null
+++ b/sys-apps/man/Manifest
@@ -0,0 +1,20 @@
+AUX makewhatis.cron 115 SHA256 3e7f377a6c9ecdeff6e85f918993a4af0cf8bb5bcc63bf7a35e6426d50e434a4 SHA512 378f1980da40d67d82e3ed6a8d470df58180ca3eeee1d9f6df5d8eec7101461ee0af2f5d7c1da81af086f0aad0665bdffd4c6ee65418dff5f7c187a39b2e79b8 WHIRLPOOL edead434db104a859f8d325451e6da42920ad76ba218224563294396638a1c35dd3f0436d3195646a0b12a9869f084dff3a667a2938617c4036042fa57640bbf
+AUX man-1.5m2-apropos.patch 450 SHA256 c524c12eaa1f40e26eba40e3c6b88b32b5b24bd4cb75d2ba9a0361a539877ec9 SHA512 cf8c5f6debe6de3a424d1b4cb4cd234e2524477150fb726f7dc659ed436d491c0506649f63d06f1b825765d48e18736ef6476dcbbb27aabe1d1a3b47d7bf7317 WHIRLPOOL 95f64f954b9a963392bdc75bc82e76562bcff10ed9cb4ec4c102123c02b4b6df9a5bf366a194e106a734603b3bb9867c412e2fb3a1ab0bdfb63fac9229419a95
+AUX man-1.6-cross-compile.patch 1744 SHA256 ddc610cde46bd13e86802db0b86c21200c5695b88c9b660e386cd8c0a7d03540 SHA512 8be42b2ac831d7ba7de7e2f54c0b5d4ca2d1c88e6b3125b0bb2b9996c15daaf659f3e4e1c9edf05bf9628ea9e043cb9781e05987dcb34abb3c937b19d4787204 WHIRLPOOL 14d51eb9ab1495f65957d5a54ea9f9fc1a18a21e108637160c5af849e4f4175fbc5408e9dff2ee4e6b6864578c205972d3c71f728a911819dd9bef44925781c2
+AUX man-1.6c-cut-duplicate-manpaths.patch 2148 SHA256 a9557114725da765265891a4c1cf846b6a8f0b38c0180628a7fec7dfb1b76a4d SHA512 00141e89313e5dd4bf781c2010ca1aea4f8c265339cb4a46ee596870388b41e78135191b0266f4d1046a15f92d404477622139baf5f92a9692c8f9ee79d3a820 WHIRLPOOL 265069c0bb580472bddae9ea88273694bb50fb5303c70eaf30a54a03e5496aa9d3f80563b39033a437085be5f832253b7ddc7a7e98908a3c0bfcb72361d982d4
+AUX man-1.6e-headers.patch 241 SHA256 d62108e3baaec771d99226eff07a6f604a8b9afefd25ec596b9817574a638e20 SHA512 0fb92a896fe6889289198ac2674ae238e1067e8e3681b6d9c6fee12843f5272a49b80899985ed6e718d84181c036ca7e7c00d8cdb5bdfca299cf4ec00681e925 WHIRLPOOL 20f458cf9812ad7f007ce6aef59405b6767570b9c1f75cb4d66a934107c717f707b5ac1d542471a8c3b79e32eba2741fd104d1131ad45eb34020761c320e1bda
+AUX man-1.6f-makewhatis-compression-cleanup.patch 2384 SHA256 885fde98225f122597dc16ab05cd5666c808df9d2004589e3aefe7ba63860267 SHA512 24e85bda51ab9ce27d15bae0403b7528cd808b32642e677512806cd88afb6ba2b76cfc6550eeb18cf7cdc7fcf348eca01bbed1b0da3680f53ffb73f824316c10 WHIRLPOOL 73af923df3acf344ce8ced046c335b3053c7c444d7bd8b19d56ca63775eecbf39a92971fed5c6d6decaea8d96d0cecbf842bccac1aa4f7730c0e2196b1779387
+AUX man-1.6f-man2html-compression-2.patch 1725 SHA256 f9df05eabad2408a017790954f46ac06eb565fed4de603d6d20bb3145439f97a SHA512 c7dc78f75876882e4f241ededd61ab1dad9292e2aa91d82c09e0e4a81c6a97d6537c8bb4b9154a17cb1db47d8716464b8146ccd487545e3f5c317482ad86e0bb WHIRLPOOL dd2116a61ab88e35b4dd152c0bd7f1ec3bdcbb9b7ddef030cc778230ee7f0b4f27bf817f1003ff378847349fe4a26a41d7e12855581c7ae92b1773b5a28b5c36
+AUX man-1.6f-parallel-build.patch 2312 SHA256 158a5bfb6bcfe7f82b1ed4586a62a30cbd7c7688244e3c274fcb490112c18d13 SHA512 03bfd0c86d9d17eba4073a94d59a2d1fabc88fc373831796d65c1caf3f45ff17014f3bd314ece01be80746845961ef7f03e7b8e153e3e71ced77f43736f34bf8 WHIRLPOOL 4d2ef8279f4f9b438ca747f9711395a07c8ec173301e74f537245307226a20709e8c9bdaeb04e475529ab1b221376f89413f415a4da365eadc1523b86424ef85
+AUX man-1.6f-so-search-2.patch 1062 SHA256 8f4c6bcfde17291f92c677b82e2367458916488a1a8de6ba345eecd5bfccb2e8 SHA512 af21ff66a9bb0f6a47d98c1fe73fe99a4c0addce6496be154ccd7ede2efb51e80464156337ae40df9aed3a10daceb486f8785dd1130b50d59d4e991406dc70c6 WHIRLPOOL d8f2a9beab76d3ab1e6f4d78ed5d9396e354f127741b31545fb84de5f9f9ed69604fd3bf271a8ece5d65696bc37e87f601fa853984afd8442f94d32877b52c81
+AUX man-1.6f-unicode.patch 656 SHA256 1c7624b5824e5585abd1c3d27ffd8e2d9207a05bf67e268aeaabaddf842d4709 SHA512 f91ebf0886794bb1f3ccc2207cd5fb7dbd83f0dd727470a9270481c7c33dcf1c78e99a62d097232ca964b639764fc1c76ae88380775dc79ee4ed18a6cd677b97 WHIRLPOOL 1052baf2cad3052335a21a6ca31ae740fb2e344940307117725974e5f6857ad85e34f461169a80b90b1a4a30fd8c740954b182b587a9c6c9f04e97e1f3854ba0
+AUX man-1.6g-compress.patch 343 SHA256 96945eded649cfe908088b75da4a71e7bfb461795e463d0126f34985410bd40f SHA512 eab984c95b75bbf29b65ff38029bbcfa870972fa2cff208da5d4d43c89dd0ceeb32a8faceb43836ced9ff50ee5765d2a5c4f1faf51f5507f0ea97b6ffcfe36c8 WHIRLPOOL ccfb29da707bed5c6e2ad9ace2ba51882d3cdea36c29010a78b1359969b8dcd303467d7566c497cc2a4068e2fb13b8bd2a559c8f96ae60af47e5212d355347db
+AUX man-1.6g-echo-escape.patch 630 SHA256 31ae1e0f3321b2e9e16b604c71cbd9a806d061e80e80a3ff1ae24b22c8a501df SHA512 d66aa7ccc97fe1af2afe1165e2305c4ad4cd4ec48078707432a1ccd79db80f7ff11ad977175651fb6c6875e31461a1e04352f2a3b542762afaf9a07290fe03c0 WHIRLPOOL 447949c0a7a953fbce4598e532ded3acb45bd0bb7d2aa5ef89c38c9f451b90f75f2d68425ab314821de43ff31df06f55b7cca0fa16ec880967fd06451322796e
+AUX man-1.6g-fbsd.patch 366 SHA256 fd4e50be32571103e9880b9291c691d45a225a7d6f2b27ff05168d22dbce7336 SHA512 4019267584b1350b2c9da9aa1851a2e4e96f271265d189ecd677206be20dac67cd212b2887f844f43c10d96076a76613a12e53f3b29a185ec62ed4bff4c5a502 WHIRLPOOL 60bc8aff0c96036ba2842e0113adaa3851a7b0e179b73f013e8e5b42e12511eb1cf07e5c3cbd07f8d7613c4cf2ccb40f6276cc50e9f2ffb7ee9cecf435f0bb77
+AUX man-1.6g-xz.patch 1848 SHA256 7c11114ec34f017d0641c9a7ecd9ad8b93f6c226e9bdd54fd0fedf1313451634 SHA512 6a883fa800a6d3b11c76a70e1a31c0736d380271c9f21315863ddaca9529e3d613b587724287fb94bab2b0d97215f6ccb3f1438a5c5e339e5a2edf872c92515c WHIRLPOOL 4f2ffd7d09ddda0a3bc49d4a1b36a7ef953f9afde4d0dfa164a917783516e549e9a12196994239f65d9c26b3ef1c64553601bb68fcfad4286e882fb0465cb0aa
+DIST man-1.6g.tar.gz 256906 SHA256 ccdcb8c3f4e0080923d7e818f0e4a202db26c46415eaef361387c20995b8959f SHA512 c786fa2201aed92293e5590dc3ad5d550cf14e5059fa274ef7719af86ee4c892e747576495b6dc0a09286e73e2f0f0caf860216e0c8032d9ef13e5d26853048b WHIRLPOOL 1b531476108c27a3993023da430831c2d20f8045a51490d559a7f588f0771931defd7a3a745e9f1f03797e681eea8767aad4a27ab9abdd5d06ad935dc96a5020
+EBUILD man-1.6g-r1.ebuild 3703 SHA256 c55e2c1754295d5d5db68a5181c64a8f650596e0a68068581cefb79eabef795f SHA512 2e6306b888a1c9be4f80f3b7e407cff67e05aae868fbff29c85793002aa209d5d38946c829b717969583017d5564747d7fbe61881640d06b86d9986fb798ec4d WHIRLPOOL beadab2ff6bc09ebc5568571cb5d473f94f34431d14fc0460c8d3be668c846bef435e9a5587fc6101e6aaae2f9af8c23a9948c4a55696ebac8130f6fe67c23ee
+EBUILD man-1.6g.ebuild 3627 SHA256 fc3c4f2c9123f9e8ab8212d13dc112f742638357ba6a4361beb524cfe502fa5b SHA512 ab6b2d67d6944d07a1291c3518c7ecd9d6c69e9d6ef10c5a18794e5808cb34871044ef9e5180e0c45171478076e90bb2fb0919c55fc0cb647112dbdd7554f9e8 WHIRLPOOL 60a4df1f93d1983d46e8d5c5bf7eeda0c32b179fe82cb5c96124cb1c86e4611bf4ce3049e668e9f234500c6c70f49547c2c59bb861f3d558d5e3053764c34a10
+MISC ChangeLog 3470 SHA256 cc5330586a2685b9b6d769bb7193665f7a4ec7b7f0498aa840330c809823daa1 SHA512 607ee613cc1657e34ad70fd4af61a4be4d60458de6103c85aa5252a5f7346d10042b3a0382b077d0dc698f35818eb92bebcf6b6618f40dcc1034ca47509d1b3e WHIRLPOOL 60db0fd1a0d5a2eecc28ce3816c34aae9543f318e301c70a7e0484bc63d4283fc861a891a18856ead992abc3c666aa463216e6797b5cadc082635c9c5e16038c
+MISC ChangeLog-2015 24815 SHA256 246995690bfdf8b7c1e7d0a012a15d21955983967365cb3201ade29a38e2faa8 SHA512 231e4ad86a93dff35f11c3676c7db9c19cb49cf1a3a91ec9dc7e484cb11d42cda0b5492fee75fa881f23f4a340b526fe469a0c773ebf7074c7b01a3298b65b26 WHIRLPOOL 3c692e40173882cf0600b518910e685b0598c99a1b93c3e52797de32505b0c6a7b5b1d285341c29f440c83297bdab0c3516e25d33391ea6388d346618827c06f
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-apps/man/files/makewhatis.cron b/sys-apps/man/files/makewhatis.cron
new file mode 100644
index 000000000000..bef5ea6d1e2d
--- /dev/null
+++ b/sys-apps/man/files/makewhatis.cron
@@ -0,0 +1,5 @@
+#!/bin/sh
+# this is part of the man package
+# it updates the search database for manpages
+
+exec nice makewhatis -u
diff --git a/sys-apps/man/files/man-1.5m2-apropos.patch b/sys-apps/man/files/man-1.5m2-apropos.patch
new file mode 100644
index 000000000000..9735a5330e88
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m2-apropos.patch
@@ -0,0 +1,16 @@
+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
diff --git a/sys-apps/man/files/man-1.6-cross-compile.patch b/sys-apps/man/files/man-1.6-cross-compile.patch
new file mode 100644
index 000000000000..184236918b91
--- /dev/null
+++ b/sys-apps/man/files/man-1.6-cross-compile.patch
@@ -0,0 +1,61 @@
+Fix up to work with cross-compiling ... most of these tests only
+need to see if the example compiled, not whether it runs ...
+
+--- configure
++++ 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"
diff --git a/sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch b/sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch
new file mode 100644
index 000000000000..9ecaeb70e16e
--- /dev/null
+++ b/sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch
@@ -0,0 +1,83 @@
+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;
+ }
+ }
diff --git a/sys-apps/man/files/man-1.6e-headers.patch b/sys-apps/man/files/man-1.6e-headers.patch
new file mode 100644
index 000000000000..9c6fd6f43516
--- /dev/null
+++ b/sys-apps/man/files/man-1.6e-headers.patch
@@ -0,0 +1,13 @@
+--- gencat/genlib.c
++++ 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>
diff --git a/sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch b/sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch
new file mode 100644
index 000000000000..a7d74c32be3a
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch
@@ -0,0 +1,69 @@
+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) {
diff --git a/sys-apps/man/files/man-1.6f-man2html-compression-2.patch b/sys-apps/man/files/man-1.6f-man2html-compression-2.patch
new file mode 100644
index 000000000000..b79b3a1872f1
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-man2html-compression-2.patch
@@ -0,0 +1,61 @@
+add support for bzip2/lzma to man2html and friends
+
+--- man2html/glimpse_filters
++++ 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
+
+--- man2html/scripts/cgi-bin/man/man2html
++++ 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
+--- man2html/scripts/cgi-bin/man/mansearch
++++ 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;
+--- man2html/scripts/cgi-bin/man/mansec
++++ 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") {
diff --git a/sys-apps/man/files/man-1.6f-parallel-build.patch b/sys-apps/man/files/man-1.6f-parallel-build.patch
new file mode 100644
index 000000000000..41918d9244da
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-parallel-build.patch
@@ -0,0 +1,78 @@
+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
diff --git a/sys-apps/man/files/man-1.6f-so-search-2.patch b/sys-apps/man/files/man-1.6f-so-search-2.patch
new file mode 100644
index 000000000000..ac42c8df7b37
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-so-search-2.patch
@@ -0,0 +1,34 @@
+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) {
diff --git a/sys-apps/man/files/man-1.6f-unicode.patch b/sys-apps/man/files/man-1.6f-unicode.patch
new file mode 100644
index 000000000000..89d3821df3ca
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-unicode.patch
@@ -0,0 +1,28 @@
+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"
+
diff --git a/sys-apps/man/files/man-1.6g-compress.patch b/sys-apps/man/files/man-1.6g-compress.patch
new file mode 100644
index 000000000000..374d80730074
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-compress.patch
@@ -0,0 +1,17 @@
+allow selection of default cache compressor
+
+http://bugs.gentoo.org/205147
+
+--- configure
++++ 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?"
diff --git a/sys-apps/man/files/man-1.6g-echo-escape.patch b/sys-apps/man/files/man-1.6g-echo-escape.patch
new file mode 100644
index 000000000000..96e950a51e86
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-echo-escape.patch
@@ -0,0 +1,15 @@
+avoid using escape sequences in echo as they're not portable
+
+https://bugs.gentoo.org/523874
+
+--- a/src/man.c
++++ b/src/man.c
+@@ -626,7 +626,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, "; echo \".\\\\\\\"\"; echo \".pl \"; echo \"(nlu+10\"");
+ #if 0
+ /* In case this doesnt work for some reason,
+ michaelkjohnson suggests: I've got a simple
diff --git a/sys-apps/man/files/man-1.6g-fbsd.patch b/sys-apps/man/files/man-1.6g-fbsd.patch
new file mode 100644
index 000000000000..ef01a6e01fc0
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-fbsd.patch
@@ -0,0 +1,15 @@
+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;
diff --git a/sys-apps/man/files/man-1.6g-xz.patch b/sys-apps/man/files/man-1.6g-xz.patch
new file mode 100644
index 000000000000..fcf91f71d376
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-xz.patch
@@ -0,0 +1,53 @@
+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 ~ /[;&|`$(]/) {
diff --git a/sys-apps/man/man-1.6g-r1.ebuild b/sys-apps/man/man-1.6g-r1.ebuild
new file mode 100644
index 000000000000..eda4969dce0a
--- /dev/null
+++ b/sys-apps/man/man-1.6g-r1.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils 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 ~sparc-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
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/man-1.6f-man2html-compression-2.patch
+ epatch "${FILESDIR}"/man-1.6-cross-compile.patch
+ epatch "${FILESDIR}"/man-1.6f-unicode.patch #146315
+ epatch "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
+ epatch "${FILESDIR}"/man-1.5m2-apropos.patch
+ epatch "${FILESDIR}"/man-1.6g-fbsd.patch #138123
+ epatch "${FILESDIR}"/man-1.6e-headers.patch
+ epatch "${FILESDIR}"/man-1.6f-so-search-2.patch
+ epatch "${FILESDIR}"/man-1.6g-compress.patch #205147
+ epatch "${FILESDIR}"/man-1.6f-parallel-build.patch #207148 #258916
+ epatch "${FILESDIR}"/man-1.6g-xz.patch #302380
+ epatch "${FILESDIR}"/man-1.6f-makewhatis-compression-cleanup.patch #331979
+ epatch "${FILESDIR}"/man-1.6g-echo-escape.patch #523874
+ # make sure `less` handles escape sequences #287183
+ sed -i -e '/^DEFAULTLESSOPT=/s:"$:R":' configure
+}
+
+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=/usr/bin/xz
+ else
+ COMPRESS=/bin/bzip2
+ fi
+ echoit \
+ ./configure \
+ -confdir=/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
+ diropts -m0775 -g man
+ local mansects=$(grep ^MANSECT "${D}"/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
+}
diff --git a/sys-apps/man/man-1.6g.ebuild b/sys-apps/man/man-1.6g.ebuild
new file mode 100644
index 000000000000..c72bff3d0c25
--- /dev/null
+++ b/sys-apps/man/man-1.6g.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit eutils 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 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-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
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/man-1.6f-man2html-compression-2.patch
+ epatch "${FILESDIR}"/man-1.6-cross-compile.patch
+ epatch "${FILESDIR}"/man-1.6f-unicode.patch #146315
+ epatch "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
+ epatch "${FILESDIR}"/man-1.5m2-apropos.patch
+ epatch "${FILESDIR}"/man-1.6g-fbsd.patch #138123
+ epatch "${FILESDIR}"/man-1.6e-headers.patch
+ epatch "${FILESDIR}"/man-1.6f-so-search-2.patch
+ epatch "${FILESDIR}"/man-1.6g-compress.patch #205147
+ epatch "${FILESDIR}"/man-1.6f-parallel-build.patch #207148 #258916
+ epatch "${FILESDIR}"/man-1.6g-xz.patch #302380
+ epatch "${FILESDIR}"/man-1.6f-makewhatis-compression-cleanup.patch #331979
+ # make sure `less` handles escape sequences #287183
+ sed -i -e '/^DEFAULTLESSOPT=/s:"$:R":' configure
+}
+
+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=/usr/bin/xz
+ else
+ COMPRESS=/bin/bzip2
+ fi
+ echoit \
+ ./configure \
+ -confdir=/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
+ diropts -m0775 -g man
+ local mansects=$(grep ^MANSECT "${D}"/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
+}
diff --git a/sys-apps/man/metadata.xml b/sys-apps/man/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-apps/man/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>