summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/man/ChangeLog9
-rw-r--r--sys-apps/man/files/digest-man-1.6c3
-rw-r--r--sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch83
-rw-r--r--sys-apps/man/files/man-1.6c-makewhatis-typo.patch13
-rw-r--r--sys-apps/man/man-1.6c.ebuild121
5 files changed, 228 insertions, 1 deletions
diff --git a/sys-apps/man/ChangeLog b/sys-apps/man/ChangeLog
index 3e0898b3580f..c02baaf3bab5 100644
--- a/sys-apps/man/ChangeLog
+++ b/sys-apps/man/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/man
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/ChangeLog,v 1.82 2006/02/02 22:45:02 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/ChangeLog,v 1.83 2006/02/07 01:44:00 vapier Exp $
+
+*man-1.6c (07 Feb 2006)
+
+ 07 Feb 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/man-1.6c-cut-duplicate-manpaths.patch,
+ +files/man-1.6c-makewhatis-typo.patch, +man-1.6c.ebuild:
+ Version bump and fix duplicate man issue #90186 by Stuart W. Finlayson.
02 Feb 2006; Mike Frysinger <vapier@gentoo.org> man-1.5p.ebuild,
man-1.6-r1.ebuild, man-1.6a.ebuild, man-1.6b-r2.ebuild:
diff --git a/sys-apps/man/files/digest-man-1.6c b/sys-apps/man/files/digest-man-1.6c
new file mode 100644
index 000000000000..59bee2563827
--- /dev/null
+++ b/sys-apps/man/files/digest-man-1.6c
@@ -0,0 +1,3 @@
+MD5 ac1e7d60dfedb7d1c6f398ae5b038996 man-1.6c.tar.gz 245178
+RMD160 1894ed00284ad522a80b256f20b85bdb058af48f man-1.6c.tar.gz 245178
+SHA256 ad5f5e0b6e1cb1e223b5a8dcbac1826c6cfa710d1e858c46a0b60a99e23d2842 man-1.6c.tar.gz 245178
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.6c-makewhatis-typo.patch b/sys-apps/man/files/man-1.6c-makewhatis-typo.patch
new file mode 100644
index 000000000000..ccaa05db3eab
--- /dev/null
+++ b/sys-apps/man/files/man-1.6c-makewhatis-typo.patch
@@ -0,0 +1,13 @@
+One two many ) in if expression ...
+
+--- src/makewhatis.sh
++++ src/makewhatis.sh
+@@ -266,7 +266,7 @@
+ $2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
+ $2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
+ $2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
+- $2 ~ /^NOME/ || $2 ~ /^NAAM/) || $2 ~ /^ÈÌÅ/)) ||
++ $2 ~ /^NOME/ || $2 ~ /^NAAM/ || $2 ~ /^ÈÌÅ/)) ||
+ (pages == "cat" && $1 ~ /^NAME/)) {
+ if (!insh) {
+ insh = 1;
diff --git a/sys-apps/man/man-1.6c.ebuild b/sys-apps/man/man-1.6c.ebuild
new file mode 100644
index 000000000000..c8cbbf9c3911
--- /dev/null
+++ b/sys-apps/man/man-1.6c.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/man-1.6c.ebuild,v 1.1 2006/02/07 01:44:00 vapier Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+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"
+IUSE="nls"
+
+DEPEND=""
+RDEPEND=">=sys-apps/groff-1.18
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ enewgroup man 15
+ enewuser man 13 -1 /usr/share/man man
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # We love to cross-compile
+ epatch "${FILESDIR}"/man-1.6-cross-compile.patch
+ epatch "${FILESDIR}"/man-1.6b-build.patch
+
+ # Fix search order in man.conf so that system installed manpages
+ # will be found first ...
+ epatch "${FILESDIR}"/man-1.5p-search-order.patch
+
+ # For groff-1.18 or later we need to call nroff with '-c'
+ epatch "${FILESDIR}"/man-1.5m-groff-1.18.patch
+
+ # makewhatis traverses manpages twice, as default manpath
+ # contains two directories that are symlinked together
+ epatch "${FILESDIR}"/man-1.5p-defmanpath-symlinks.patch
+
+ # makewhatis should get section info from config, not hardcode it #86863
+ epatch "${FILESDIR}"/man-1.6a-makewhatis-config.patch
+
+ # add more sections to default search path
+ epatch "${FILESDIR}"/man-1.6b-more-sections.patch
+
+ # cut out symlinked paths #90186
+ epatch "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
+
+ # fix typo in makewhatis
+ epatch "${FILESDIR}"/man-1.6c-makewhatis-typo.patch
+
+ # Fedora patches
+ epatch "${FILESDIR}"/man-1.5m2-apropos.patch
+ epatch "${FILESDIR}"/man-1.5p-man2html.patch
+ epatch "${FILESDIR}"/man-1.5p-mandirlist.patch
+
+ # use non-lazy binds for man
+ append-ldflags $(bindnow-flags)
+
+ strip-linguas $(eval $(grep ^LANGUAGES= configure) ; echo ${LANGUAGES//,/ })
+}
+
+src_compile() {
+ 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
+ ./configure \
+ -confdir=/etc \
+ +sgid +fhs \
+ +lang ${mylang} \
+ || die "configure failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ make PREFIX="${D}" install || die "make install failed"
+ dosym man /usr/bin/manpath
+
+ dodoc LSM README* TODO
+
+ exeinto /etc/cron.weekly
+ 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 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
+}