bump(app-text/manpager): sync with upstream

This commit is contained in:
David Michael 2017-07-09 17:29:18 -07:00
parent 5c70328f3f
commit ae4583d564
5 changed files with 126 additions and 0 deletions

View File

@ -0,0 +1,4 @@
AUX manpager.c 1809 SHA256 bb90bcb9d2efff5db0957b56fdb20bf97ac1aacfe4f71989833dcfa34704c620 SHA512 4f827429dc46993010d0096cb352920dfdcaf2cc97bf10e2155dfea3fda601c011467be65ca3f2e3f5c44cb26de0fd9eb58f7d875f75fd5f1db4b2c6cdabdca2 WHIRLPOOL bb26d082896f41de845fcbe9b5d660b28a14f8afad4f9c266d5fbc04c967858ab72d3b95569cac29e4cd12278ddb6e9589b5fb8d18d157632d6d5adb17e874a8
EBUILD manpager-1.ebuild 645 SHA256 ffb747a26a5068eaff117254b1e74a1bac4829f65aab71d73460fa3aca32655b SHA512 67d6377beeb04b161406042b0088a46355014daee05cfce125da2ca00deb1ae70b4d6c1714f26014a25215cdca61810e79bd0dad162b08618330604d8b563d7e WHIRLPOOL 49884adade6e5061dba8c9ec5b4ab31bea30ca9ef38005f2a9964a4929b8051f1116b4d2a0aa1e82fb65ce40a997232b9195933db9e5af8e960c3f1a8c98955d
MISC ChangeLog 970 SHA256 476449bcf02927a7044880a4a6760b066e42e9e43d85aa0b7818f4678cac352d SHA512 bda470cedb820caa752f5e40b3ea12ee4dff162591cd443799fdc0df24153c1ead03f5dfefda32a8d22f0b4ac55cb0a8c9d2ebb0c682a500f872956582ee6eee WHIRLPOOL 8db067486f23494239da80bff8a3435caae3eb803f2ebc666103da3e065decd961aebaa2d81384f5bab234d8cfd9a4030e6cd60e222f2a69cf0900c81986e7e1
MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8

View File

@ -0,0 +1,74 @@
/*
* Wrapper to help enable colorized man page output.
* Only works with PAGER=less
*
* https://bugs.gentoo.org/184604
* https://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables
*
* Copyright 2003-2015 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define COLOR(c, b) "\e[" #c ";" #b "m"
#define _SE(termcap, col) setenv("LESS_TERMCAP_" #termcap, col, 0)
#define SE(termcap, c, b) _SE(termcap, COLOR(c, b))
static int usage(void)
{
puts(
"manpager: display man pages with color!\n"
"\n"
"Usage:\n"
"\texport MANPAGER=manpager\n"
"\tman man\n"
"\n"
"To control the colorization, set these env vars:\n"
"\tLESS_TERMCAP_mb - start blinking\n"
"\tLESS_TERMCAP_md - start bolding\n"
"\tLESS_TERMCAP_me - stop bolding\n"
"\tLESS_TERMCAP_us - start underlining\n"
"\tLESS_TERMCAP_ue - stop underlining\n"
"\tLESS_TERMCAP_so - start standout (reverse video)\n"
"\tLESS_TERMCAP_se - stop standout (reverse video)\n"
"\n"
"You can do so by doing:\n"
"\texport LESS_TERMCAP_md=\"$(printf '\\e[1;36m')\"\n"
"\n"
"Run 'less --help' or 'man less' for more info"
);
return 0;
}
int main(int argc, char *argv[])
{
if (argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))
return usage();
/* Blinking. */
SE(mb, 5, 31); /* Start. */
/* Bolding. */
SE(md, 1, 34); /* Start. */
SE(me, 0, 0); /* Stop. */
/* Underlining. */
SE(us, 4, 36); /* Start. */
SE(ue, 0, 0); /* Stop. */
#if 0
/* Standout (reverse video). */
SE(so, 1, 32); /* Start. */
SE(se, 0, 0); /* Stop. */
#endif
argv[0] = getenv("PAGER") ? : "less";
execvp(argv[0], argv);
perror("could not launch PAGER");
return 1;
}

View File

@ -0,0 +1,31 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
inherit toolchain-funcs
DESCRIPTION="Enable colorization of man pages"
HOMEPAGE="http://www.gentoo.org/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
IUSE=""
S=${WORKDIR}
src_compile() {
local cmd=(
$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
"${FILESDIR}"/manpager.c -o ${PN}
)
echo "${cmd[@]}"
"${cmd[@]}" || die
}
src_install() {
dobin ${PN}
insinto /etc/env.d
echo "MANPAGER=manpager" | newins - 00manpager
}

View File

@ -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>

View File

@ -0,0 +1,9 @@
DEFINED_PHASES=compile install
DESCRIPTION=Enable colorization of man pages
EAPI=5
HOMEPAGE=http://www.gentoo.org/
KEYWORDS=alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux
LICENSE=GPL-2
SLOT=0
_eclasses_=multilib 0236be304ee52e7f179ed2f337075515 toolchain-funcs 6eb35f81556258a4bc9182ad3dfd58ee
_md5_=67c0394e3a090afc09d90852c34c8807