Upgrade the ncurses, less, man, man-pages, libaio packages.

Upgraded sys-libs/ncurses to version 5.7-r7 on amd64, arm, x86
Upgraded sys-apps/less to version 441 on amd64, arm, x86
Upgraded sys-apps/man to version 1.6f-r4 on amd64
Upgraded sys-apps/man-pages to version 3.32 on amd64
Upgraded dev-libs/libaio to version 0.3.109-r2 on amd64

BUG=chromium-os:20923
TEST=trybot runs:
chromiumos-sdk
x86-generic-pre-flight-queue
x86-generic-full

Change-Id: I4955bd46815676abf4c593133aacb4370a97744c
Reviewed-on: http://gerrit.chromium.org/gerrit/8660
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
This commit is contained in:
Matt Tennant 2011-10-03 14:10:50 -07:00
parent f756d7483e
commit 6a211349e3
35 changed files with 2041 additions and 0 deletions

View File

@ -0,0 +1,26 @@
--- src/Makefile.orig 2006-07-09 19:46:41.000000000 -0700
+++ src/Makefile 2006-07-09 19:51:00.000000000 -0700
@@ -2,11 +2,10 @@
includedir=$(prefix)/include
libdir=$(prefix)/lib
-ARCH := $(shell uname -m | sed -e s/i.86/i386/)
-CFLAGS := -nostdlib -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC
-SO_CFLAGS=-shared $(CFLAGS)
+CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+SO_CFLAGS=-shared $(CFLAGS)
L_CFLAGS=$(CFLAGS)
-LINK_FLAGS=
+LINK_FLAGS=-lgcc -lrt $(LDFLAGS)
soname=libaio.so.1
minor=0
@@ -48,7 +47,7 @@
ranlib libaio.a
$(libname): $(libaio_sobjs) libaio.map
- $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
+ $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname,$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
install: $(all_targets)
install -D -m 644 libaio.h $(includedir)/libaio.h

View File

@ -0,0 +1,17 @@
--- a/src/Makefile
+++ b/src/Makefile
@@ -42,10 +42,12 @@
$(CC) $(L_CFLAGS) -c -o $@ $<
+AR ?= ar
+RANLIB ?= ranlib
libaio.a: $(libaio_objs)
rm -f libaio.a
- ar r libaio.a $^
- ranlib libaio.a
+ $(AR) r libaio.a $^
+ $(RANLIB) libaio.a
$(libname): $(libaio_sobjs) libaio.map
$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname,$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)

View File

@ -0,0 +1,62 @@
From 5e96c73d5dfbdea8d0be82b7f3fc8d6735e5dfa7 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 17 Jan 2010 17:07:48 -0500
Subject: [PATCH] add a generic syscall() fallback
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
src/syscall-generic.h | 29 +++++++++++++++++++++++++++++
src/syscall.h | 3 ++-
2 files changed, 31 insertions(+), 1 deletions(-)
create mode 100644 src/syscall-generic.h
diff --git a/src/syscall-generic.h b/src/syscall-generic.h
new file mode 100644
index 0000000..24d7c7c
--- /dev/null
+++ b/src/syscall-generic.h
@@ -0,0 +1,29 @@
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#define _body_io_syscall(sname, args...) \
+{ \
+ int ret = syscall(__NR_##sname, ## args); \
+ return ret < 0 ? -errno : ret; \
+}
+
+#define io_syscall1(type,fname,sname,type1,arg1) \
+type fname(type1 arg1) \
+_body_io_syscall(sname, (long)arg1)
+
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
+type fname(type1 arg1,type2 arg2) \
+_body_io_syscall(sname, (long)arg1, (long)arg2)
+
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
+type fname(type1 arg1,type2 arg2,type3 arg3) \
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3)
+
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4)
+
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, type5,arg5) \
+type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4, (long)arg5)
diff --git a/src/syscall.h b/src/syscall.h
index 78becfe..d954af0 100644
--- a/src/syscall.h
+++ b/src/syscall.h
@@ -25,5 +25,6 @@
#elif defined(__arm__)
#include "syscall-arm.h"
#else
-#error "add syscall-arch.h"
+#warning "using generic syscall method"
+#include "syscall-generic.h"
#endif
--
1.7.3.1

View File

@ -0,0 +1,45 @@
From 2e34caef82a2367a85de4f06daf5e5a92f61e845 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 17 Jan 2010 17:10:14 -0500
Subject: [PATCH] fix up install paths
This is similar to the Fedora patch, but this uses more common conventions
like "DESTDIR" instead of "destdir".
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
src/Makefile | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 687c7be..ee431a1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,6 +1,7 @@
prefix=/usr
includedir=$(prefix)/include
libdir=$(prefix)/lib
+usrlibdir=$(libdir)
CFLAGS ?= -g -fomit-frame-pointer -O2
CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
@@ -53,11 +54,11 @@ $(libname): $(libaio_sobjs) libaio.map
$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname,$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
install: $(all_targets)
- install -D -m 644 libaio.h $(includedir)/libaio.h
- install -D -m 644 libaio.a $(libdir)/libaio.a
- install -D -m 755 $(libname) $(libdir)/$(libname)
- ln -sf $(libname) $(libdir)/$(soname)
- ln -sf $(libname) $(libdir)/libaio.so
+ install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
+ install -D -m 644 libaio.a $(DESTDIR)$(usrlibdir)/libaio.a
+ install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
+ ln -sf $(libname) $(DESTDIR)$(usrlibdir)/$(soname)
+ ln -sf $(libname) $(DESTDIR)$(usrlibdir)/libaio.so
$(libaio_objs): libaio.h
--
1.7.3.1

View File

@ -0,0 +1,73 @@
From be673c7afd7a86b89fbe2e09c758f2de3482d19b Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 17 Jan 2010 17:07:24 -0500
Subject: [PATCH] unify LE/BE 32/64bit logic and add more arches
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
src/libaio.h | 36 +++++++++++++++---------------------
1 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/src/libaio.h b/src/libaio.h
index ffe8259..4a6c9fb 100644
--- a/src/libaio.h
+++ b/src/libaio.h
@@ -49,40 +49,34 @@ typedef enum io_iocb_cmd {
IO_CMD_PWRITEV = 8,
} io_iocb_cmd_t;
-#if defined(__i386__) /* little endian, 32 bits */
+/* little endian, 32 bits */
+#if defined(__i386__) || defined(__sh__) || defined(__bfin__) || \
+ defined(__ARMEL__) || defined(__MIPSEL__) || defined(__cris__)
#define PADDED(x, y) x; unsigned y
#define PADDEDptr(x, y) x; unsigned y
#define PADDEDul(x, y) unsigned long x; unsigned y
+
+/* little endian, 64 bits */
#elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__)
#define PADDED(x, y) x, y
#define PADDEDptr(x, y) x
#define PADDEDul(x, y) unsigned long x
-#elif defined(__powerpc64__) /* big endian, 64 bits */
-#define PADDED(x, y) unsigned y; x
-#define PADDEDptr(x,y) x
-#define PADDEDul(x, y) unsigned long x
-#elif defined(__PPC__) /* big endian, 32 bits */
-#define PADDED(x, y) unsigned y; x
-#define PADDEDptr(x, y) unsigned y; x
-#define PADDEDul(x, y) unsigned y; unsigned long x
-#elif defined(__s390x__) /* big endian, 64 bits */
+
+/* big endian, 64 bits */
+#elif defined(__powerpc64__) || defined(__s390x__) || \
+ (defined(__sparc__) && defined(__arch64__))
#define PADDED(x, y) unsigned y; x
#define PADDEDptr(x,y) x
#define PADDEDul(x, y) unsigned long x
-#elif defined(__s390__) /* big endian, 32 bits */
-#define PADDED(x, y) unsigned y; x
-#define PADDEDptr(x, y) unsigned y; x
-#define PADDEDul(x, y) unsigned y; unsigned long x
-#elif defined(__arm__)
-# if defined (__ARMEB__) /* big endian, 32 bits */
+
+/* big endian, 32 bits */
+#elif defined(__PPC__) || defined(__s390__) || defined(__ARMEB__) || \
+ defined(__MIPSEB__) || defined(__sparc__) || defined(__m68k__) || \
+ defined(__hppa__) || defined(__frv__) || defined(__avr32__)
#define PADDED(x, y) unsigned y; x
#define PADDEDptr(x, y) unsigned y; x
#define PADDEDul(x, y) unsigned y; unsigned long x
-# else /* little endian, 32 bits */
-#define PADDED(x, y) x; unsigned y
-#define PADDEDptr(x, y) x; unsigned y
-#define PADDEDul(x, y) unsigned long x; unsigned y
-# endif
+
#else
#error endian?
#endif
--
1.7.3.1

View File

@ -0,0 +1,58 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libaio/libaio-0.3.109-r2.ebuild,v 1.7 2011/09/03 16:11:48 armin76 Exp $
EAPI="3"
inherit eutils multilib toolchain-funcs
DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
HOMEPAGE="http://www.kernel.org/pub/linux/kernel/people/andrea/libaio/ http://lse.sourceforge.net/io/aio.html"
SRC_URI="mirror://kernel/linux/libs/aio/${P}.tar.bz2"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm ~hppa ia64 m68k ~mips ~ppc ~ppc64 s390 sh sparc x86 ~amd64-linux"
IUSE="static-libs"
RESTRICT="test"
src_prepare() {
epatch "${FILESDIR}"/${PN}-0.3.109-unify-bits-endian.patch
epatch "${FILESDIR}"/${PN}-0.3.109-generic-arch.patch
epatch "${FILESDIR}"/${PN}-0.3.106-build.patch
epatch "${FILESDIR}"/${PN}-0.3.107-ar-ranlib.patch
epatch "${FILESDIR}"/${PN}-0.3.109-install.patch
sed -i \
-e "/^libdir=/s:lib$:$(get_libdir):" \
-e "/^prefix=/s:/usr:${EPREFIX}/usr:" \
-e '/:=.*strip.*shell.*git/s:=.*:=:' \
src/Makefile Makefile || die
}
src_configure() {
tc-export AR CC RANLIB
}
src_test() {
cd "${S}"/harness
mkdir testdir
emake check prefix="${S}/src" libdir="${S}/src" || die
}
src_install() {
# Don't use ED for emake, src_prepare already inserts EPREFIX in the correct
# place
emake install DESTDIR="${D}" || die
doman man/*
dodoc ChangeLog TODO
# move crap to / for multipath-tools #325355
gen_usr_ldscript -a aio
if ! use static-libs ; then
rm "${ED}"usr/lib*/*.a || die
fi
# remove stuff provided by man-pages now
rm "${ED}"usr/share/man/man3/{lio_listio,aio_{cancel,error,fsync,init,read,return,suspend,write}}.*
}

View File

@ -0,0 +1,22 @@
This version of less comes with some Gentoo enhancements:
- default lesspipe.sh script to "view" files
- colorization support
To see what file types are supported, just read the /usr/bin/lesspipe.sh
script (it's just a plain text bash script).
Colorization support is disabled by default. To enable it, export the
LESSCOLOR variable to "yes":
$ export LESSCOLOR=yes
We also provide a colorization script, 'code2color', that is used by
default. If you wish to use another script, simply export the LESSCOLORIZER
variable to name of the script:
$ export LESSCOLORIZER=some-other-script
If you want to use the code2color script and the default color schemes are
not acceptable, you can develop your own schemes and save them in one of
the following places:
/etc/code2color
~/.code2color
CODE2COLOR_CONFIG env var

View File

@ -0,0 +1,34 @@
--- code2color
+++ code2color
@@ -163,11 +163,11 @@
# building up the database
# newer entries overwrite old ones
my @CONFIG_FILES;
- push @CONFIG_FILES, "/etc/code2html.config";
+ push @CONFIG_FILES, "/etc/code2color";
push @CONFIG_FILES,
- $ENV{'HOME'}."/.code2html.config" if $ENV{'HOME'};
+ $ENV{'HOME'}."/.code2color" if $ENV{'HOME'};
push @CONFIG_FILES,
- split(/:/,$ENV{'CODE2HTML_CONFIG'}) if $ENV{'CODE2HTML_CONFIG'};
+ split(/:/,$ENV{'CODE2COLOR_CONFIG'}) if $ENV{'CODE2COLOR_CONFIG'};
push @CONFIG_FILES,
split(/:/,$params{'langfile'}) if $params{'langfile'};
@@ -446,7 +446,6 @@
$_[2] = $langmode;
$_[3] = $alt_langmode;
- print "==> append : to filename to switch off syntax highlighting\n";
return \$code;
};
@@ -3192,7 +3192,7 @@
#
$LANGUAGE{'shellscript'} = {
- 'filename' => '\\.(sh|shell)$',
+ 'filename' => '\\.(ebuild|eclass|sh|shell)$',
'regex' => '^\\s*#\\s*![^\\s]*(sh|bash|ash|zsh|ksh)',
'patterns' => [ {
'name' => 'comment',

View File

@ -0,0 +1,2 @@
LESSOPEN="|lesspipe %s"
LESS="-R -M --shift 5"

View File

@ -0,0 +1,267 @@
#!/bin/bash
#
# Preprocessor for 'less'. Used when this environment variable is set:
# LESSOPEN="|lesspipe %s"
# TODO: handle compressed files better
[[ -n ${LESSDEBUG} ]] && set -x
trap 'exit 0' PIPE
guesscompress() {
case "$1" in
*.gz|*.z) echo "gunzip -c" ;;
*.bz2|*.bz) echo "bunzip2 -c" ;;
*.lz) echo "lzip -c" ;;
*.lzma) echo "unlzma -c" ;;
*.xz) echo "xzdec" ;;
*) echo "cat" ;;
esac
}
lesspipe_file() {
local out=$(file -L -- "$1")
local suffix
case ${out} in
*" 7-zip archive"*) suffix="7z";;
*" ar archive"*) suffix="a";;
*" CAB-Installer"*) suffix="cab";;
*" cpio archive"*) suffix="cpio";;
*" ELF "*) suffix="elf";;
*" LHa"*archive*) suffix="lha";;
*" troff "*) suffix="man";;
*" script text"*) suffix="sh";;
*" shared object"*) suffix="so";;
*" tar archive"*) suffix="tar";;
*" Zip archive"*) suffix="zip";;
*": data") hexdump -C -- "$1"; return 0;;
*) return 1;;
esac
lesspipe "$1" ".${suffix}"
return 0
}
lesspipe() {
local match=$2
[[ -z ${match} ]] && match=$1
local DECOMPRESSOR=$(guesscompress "$match")
# User filters
if [[ -x ~/.lessfilter ]] ; then
~/.lessfilter "$1" && exit 0
fi
local ignore
for ignore in ${LESSIGNORE} ; do
[[ ${match} == *.${ignore} ]] && exit 0
done
case "$match" in
### Doc files ###
*.[0-9n]|*.man|\
*.[0-9n].bz2|*.man.bz2|\
*.[0-9n].gz|*.man.gz|\
*.[0-9n].lzma|*.man.lzma|\
*.[0-9][a-z].gz|*.[0-9][a-z].gz)
local out=$(${DECOMPRESSOR} -- "$1" | file -)
case ${out} in
*troff*)
# Need to make sure we pass path to man or it will try
# to locate "$1" in the man search paths
if [[ $1 == /* ]] ; then
man -- "$1"
else
man -- "./$1"
fi
;;
*text*)
${DECOMPRESSOR} -- "$1"
;;
*)
# We could have matched a library (libc.so.6), so let
# `file` figure out what the hell this thing is
lesspipe_file "$1"
;;
esac
;;
*.dvi) dvi2tty "$1" ;;
*.ps|*.pdf) ps2ascii "$1" || pstotext "$1" || pdftotext "$1" ;;
*.doc) antiword "$1" || catdoc "$1" ;;
*.rtf) unrtf --nopict --text "$1" ;;
*.conf|*.txt|*.log) ;; # force less to work on these directly #150256
### URLs ###
ftp://*|http://*|*.htm|*.html)
for b in links2 links lynx ; do
${b} -dump "$1" && exit 0
done
html2text -style pretty "$1"
;;
### Tar files ###
*.tar|\
*.tar.bz2|*.tar.bz|*.tar.gz|*.tar.z|\
*.tar.lz|*.tar.tlz|\
*.tar.lzma|*.tar.xz)
${DECOMPRESSOR} -- "$1" | tar tvvf -;;
*.tbz2|*.tbz|*.tgz|*.tlz|*.txz)
lesspipe "$1" "$1".tar.${1##*.t} ;;
### Misc archives ###
*.bz2|\
*.gz|*.z|\
*.lz|\
*.lzma|*.xz) ${DECOMPRESSOR} -- "$1" ;;
*.rpm) rpm -qpivl --changelog -- "$1" ;;
*.cpi|*.cpio) cpio -itv < "$1" ;;
*.ace) unace l "$1" ;;
*.arc) arc v "$1" ;;
*.arj) unarj l -- "$1" ;;
*.cab) cabextract -l -- "$1" ;;
*.lha|*.lzh) lha v "$1" ;;
*.zoo) zoo -list "$1" || unzoo -l "$1" ;;
*.7z|*.exe) 7z l -- "$1" || 7za l -- "$1" ;;
*.a) ar tv "$1" ;;
*.elf) readelf -a -- "$1" ;;
*.so) readelf -h -d -s -- "$1" ;;
*.mo|*.gmo) msgunfmt -- "$1" ;;
*.rar|.r[0-9][0-9]) unrar l -- "$1" ;;
*.jar|*.war|*.ear|*.xpi|*.zip)
unzip -v "$1" || miniunzip -l "$1" || miniunz -l "$1" || zipinfo -v "$1"
;;
*.deb|*.udeb)
if type -P dpkg > /dev/null ; then
dpkg --info "$1"
dpkg --contents "$1"
else
ar tv "$1"
ar p "$1" data.tar.gz | tar tzvvf -
fi
;;
### Filesystems ###
*.squashfs) unsquashfs -s "$1" && unsquashfs -ll "$1" ;;
### Media ###
*.bmp|*.gif|*.jpeg|*.jpg|*.ico|*.pcd|*.pcx|*.png|*.ppm|*.tga|*.tiff|*.tif)
identify "$1" || file -L -- "$1"
;;
*.avi|*.mpeg|*.mpg|*.mov|*.qt|*.wmv|*.asf|*.rm|*.ram)
midentify "$1" || file -L -- "$1"
;;
*.mp3) mp3info "$1" || id3info "$1" ;;
*.ogg) ogginfo "$1" ;;
*.flac) metaflac --list "$1" ;;
*.torrent) torrentinfo "$1" || torrentinfo-console "$1" || ctorrent -x "$1" ;;
*.bin|*.cue|*.raw)
# not all .bin/.raw files are cd images, so fall back to hexdump
cd-info --no-header --no-device-info "$1" || lesspipe_file "$1"
;;
*.iso)
iso_info=$(isoinfo -d -i "$1")
echo "${iso_info}"
# Joliet output overrides Rock Ridge, so prefer the better Rock
case ${iso_info} in
*$'\n'"Rock Ridge"*) iso_opts="-R";;
*$'\n'"Joliet"*) iso_opts="-J";;
*) iso_opts="";;
esac
isoinfo -l ${iso_opts} -i "$1"
;;
### Encryption stuff ###
*.crl) openssl crl -hash -text -noout -in "$1" ;;
*.pem) openssl x509 -hash -text -noout -in "$1" ;;
# May not be such a good idea :)
# ### Device nodes ###
# /dev/[hs]d[a-z]*)
# fdisk -l "${1:0:8}"
# [[ $1 == *hd* ]] && hdparm -I "${1:0:8}"
# ;;
### Everything else ###
*)
case $(( recur++ )) in
# Maybe we didn't match due to case issues ...
0) lesspipe "$1" "$(echo $1 | LC_ALL=C tr '[:upper:]' '[:lower:]')" ;;
# Maybe we didn't match because the file is named weird ...
1) lesspipe_file "$1" ;;
esac
# So no matches from above ... finally fall back to an external
# coloring package. No matching here so we don't have to worry
# about keeping in sync with random packages. Any coloring tool
# you use should not output errors about unsupported files to
# stdout. If it does, it's your problem.
# Allow people to flip color off if they dont want it
case ${LESSCOLOR} in
always) LESSCOLOR=2;;
[yY][eE][sS]|[yY]|1|true) LESSCOLOR=1;;
[nN][oO]|[nN]|0|false) LESSCOLOR=0;;
*) LESSCOLOR=0;; # default to no color #188835
esac
if [[ ${LESSCOLOR} != "0" ]] && [[ -n ${LESSCOLORIZER=code2color} ]] ; then
# 2: Only colorize if user forces it ...
# 1: ... or we know less will handle raw codes -- this will
# not detect -seiRM, so set LESSCOLORIZER yourself
if [[ ${LESSCOLOR} == "2" ]] || [[ " ${LESS} " == *" -"[rR]" "* ]] ; then
${LESSCOLORIZER} "$1"
fi
fi
# Nothing left to do but let less deal
exit 0
;;
esac
}
if [[ -z $1 ]] ; then
echo "Usage: lesspipe <file>"
elif [[ $1 == "-V" || $1 == "--version" ]] ; then
Id="cvsid"
cat <<-EOF
$Id: lesspipe.sh,v 1.45 2011/01/20 03:26:14 vapier Exp $
Copyright 2001-2010 Gentoo Foundation
Mike Frysinger <vapier@gentoo.org>
(with plenty of ideas stolen from other projects/distros)
EOF
less -V
elif [[ $1 == "-h" || $1 == "--help" ]] ; then
cat <<-EOF
lesspipe: preproccess files before sending them to less
Usage: lesspipe <file>
lesspipe specific settings:
LESSCOLOR env - toggle colorizing of output (no/yes/always)
LESSCOLORIZER env - program used to colorize output (default: code2color)
LESSIGNORE - list of extensions to ignore (don't do anything fancy)
You can create per-user filters as well by creating the executable file:
~/.lessfilter
One argument is passed to it: the file to display.
To use lesspipe, simply add to your environment:
export LESSOPEN="|lesspipe %s"
Run 'less --help' or 'man less' for more info
EOF
elif [[ -d $1 ]] ; then
ls -alF -- "$1"
else
recur=0
[[ -n ${LESSDEBUG} ]] \
&& lesspipe "$1" \
|| lesspipe "$1" 2> /dev/null
fi

View File

@ -0,0 +1,47 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/less/less-441.ebuild,v 1.7 2011/05/01 12:21:54 xarthisius Exp $
inherit eutils
DESCRIPTION="Excellent text file viewer"
HOMEPAGE="http://www.greenwoodsoftware.com/less/"
SRC_URI="http://www.greenwoodsoftware.com/less/${P}.tar.gz
http://www-zeuthen.desy.de/~friebel/unix/less/code2color"
LICENSE="|| ( GPL-3 BSD-2 )"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
IUSE="unicode"
DEPEND=">=sys-libs/ncurses-5.2"
src_unpack() {
unpack ${P}.tar.gz
cd "${S}"
cp "${DISTDIR}"/code2color "${S}"/
epatch "${FILESDIR}"/code2color.patch
}
yesno() { use $1 && echo yes || echo no ; }
src_compile() {
export ac_cv_lib_ncursesw_initscr=$(yesno unicode)
export ac_cv_lib_ncurses_initscr=$(yesno !unicode)
econf || die
emake || die
}
src_install() {
emake install DESTDIR="${D}" || die
dobin code2color || die "dobin"
newbin "${FILESDIR}"/lesspipe.sh lesspipe || die "newbin"
dosym lesspipe /usr/bin/lesspipe.sh
newenvd "${FILESDIR}"/less.envd 70less
dodoc NEWS README* "${FILESDIR}"/README.Gentoo
}
pkg_postinst() {
einfo "lesspipe offers colorization options. Run 'lesspipe -h' for info."
}

View File

@ -0,0 +1,57 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/man-pages/man-pages-3.32.ebuild,v 1.7 2011/09/16 17:17:41 jer Exp $
EAPI=3
GENTOO_PATCH=2
DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
HOMEPAGE="http://www.kernel.org/doc/man-pages/"
SRC_URI="mirror://kernel/linux/docs/manpages/Archive/${P}.tar.bz2
mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
LICENSE="as-is GPL-2 BSD"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ~ppc64 s390 sh sparc x86 ~amd64-linux ~ia64-linux ~x86-linux"
IUSE_LINGUAS=" cs da de fr it ja nl pl ro ru zh_CN"
IUSE="nls ${IUSE_LINGUAS// / linguas_}"
RESTRICT="binchecks"
RDEPEND="virtual/man
!<dev-libs/libaio-0.3.109-r2" #341953
PDEPEND="nls? (
linguas_cs? ( app-i18n/man-pages-cs )
linguas_da? ( app-i18n/man-pages-da )
linguas_de? ( app-i18n/man-pages-de )
linguas_fr? ( app-i18n/man-pages-fr )
linguas_it? ( app-i18n/man-pages-it )
linguas_ja? ( app-i18n/man-pages-ja )
linguas_nl? ( app-i18n/man-pages-nl )
linguas_pl? ( app-i18n/man-pages-pl )
linguas_ro? ( app-i18n/man-pages-ro )
linguas_ru? ( app-i18n/man-pages-ru )
linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
)
sys-apps/man-pages-posix"
src_configure() { :; }
src_compile() { :; }
src_install() {
emake install prefix="${EPREFIX}/usr" DESTDIR="${D}" || die
dodoc man-pages-*.Announce README Changes*
# Override with Gentoo specific or additional Gentoo pages
cd "${WORKDIR}"/man-pages-gentoo
doman */* || die
dodoc README.Gentoo
}
pkg_postinst() {
einfo "If you don't have a makewhatis cronjob, then you"
einfo "should update the whatis database yourself:"
einfo " # makewhatis -u"
}

View File

@ -0,0 +1,5 @@
#!/bin/sh
# this is part of the man package
# it updates the search database for manpages
exec nice makewhatis -u

View File

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

View File

@ -0,0 +1,26 @@
makewhatis traverses manpages twice, as default manpath contains two
directories that are symlinked together ... this isn't a real fix, just
a workaround that should be OK for the way Gentoo does things. a real
fix would be to filter out any directories which resolv to the same
directory ...
--- man-1.5o2/src/makewhatis.sh
+++ man-1.5o2/src/makewhatis.sh
@@ -41,7 +41,7 @@
# and should be first.
# It is a bug to add /var/cache/man to DEFCATPATH.
dm=
-for d in /usr/man /usr/share/man /usr/X11R6/man /usr/local/man
+for d in /usr/local/man /usr/share/man
do
if [ -d $d ]; then
if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
@@ -49,7 +49,7 @@
done
DEFMANPATH=$dm
dc=
-for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man
+for d in /usr/local/man /usr/share/man
do
if [ -d $d ]; then
if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi

View File

@ -0,0 +1,19 @@
Fix search order in man.conf so that system installed manpages
will be found first ...
--- man-1.5p/src/man.conf.in
+++ man-1.5p/src/man.conf.in
@@ -36,11 +36,11 @@
#
# Every automatically generated MANPATH includes these fields
#
-MANPATH /usr/man
MANPATH /usr/share/man
-MANPATH /usr/local/man
MANPATH /usr/local/share/man
MANPATH /usr/X11R6/man
+MANPATH /usr/local/man
+MANPATH /usr/man
#
# Uncomment if you want to include one of these by default
#

View File

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

View File

@ -0,0 +1,13 @@
[1-8]x are for xorg man-pages
--- configure
+++ configure
@@ -949,7 +949,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 4 5 6 7 9 0p tcl n l p o 1x 2x 3x 4x 5x 6x 7x 8x"
if [ x$default = x ]; then
echo ""

View File

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

View File

@ -0,0 +1,15 @@
Fixes compilation in FreeBSD
http://bugs.gentoo.org/138123
--- man-1.6d/gencat/genlib.c
+++ man-1.6d/gencat/genlib.c
@@ -54,7 +54,7 @@
#include <unistd.h>
#endif
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__FreeBSD__)
#include <memory.h>
static int bcopy(src, dst, length)
char *src, *dst;

View File

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

View File

@ -0,0 +1,42 @@
--- configure.orig 2008-12-26 23:59:40.779042906 -0600
+++ configure 2008-12-27 00:13:15.265256215 -0600
@@ -1012,20 +1012,25 @@
if test "$ans" = "true"
then
DO_COMPRESSION=true
- compress=
- for i in lzma bzip2 gzip bzip tzip pack compress freeze yabba
- do
- eval F$i=missing
- for j in $DEFPATH
- do
- if test -f $j/$i
- then
- eval F$i=$j/$i
- if [ x$compress = x ]; then compress=$j/$i; fi
- break
- fi
- done
- done
+ if [ x$COMPRESS != x ]; then
+ compress=$COMPRESS
+ echo $compress
+ else
+ compress=
+ for i in lzma bzip2 gzip bzip tzip pack compress freeze yabba
+ do
+ eval F$i=missing
+ for j in $DEFPATH
+ do
+ if test -f $j/$i
+ then
+ eval F$i=$j/$i
+ if [ x$compress = x ]; then compress=$j/$i; fi
+ break
+ fi
+ done
+ done
+ fi
if [ x$default = x ]; then
echo ""

View File

@ -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") {

View File

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

View File

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

View File

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

View File

@ -0,0 +1,128 @@
add support for xz
http://bugs.gentoo.org/302380
--- a/configure
+++ b/configure
@@ -1017,7 +1017,7 @@
echo $compress
else
compress=
- for i in lzma bzip2 gzip bzip tzip pack compress freeze yabba
+ for i in xz lzma bzip2 gzip bzip tzip pack compress freeze yabba
do
eval F$i=missing
for j in $DEFPATH
@@ -1076,6 +1076,7 @@
*gzip*) ext=".gz" ;;
*bzip*) ext=".bz" ;;
*tzip*) ext=".tz" ;;
+ *xz*) ext=".xz" ;;
*pack*) ext=".z" ;;
*compress*) ext=".Z" ;;
*freeze*) ext=".F" ;;
@@ -1114,7 +1115,7 @@
fi
# unconditionally handle uncompression
-UNCOMPRESSORS="unlzma gunzip bzip2 pcat zcat fcat unyabba"
+UNCOMPRESSORS="unxz unlzma gunzip bzip2 pcat zcat fcat unyabba"
for i in $UNCOMPRESSORS
do
eval F$i=missing
@@ -1139,6 +1140,10 @@
if [ $Funlzma != missing ]; then
unlzma="$Funlzma -c -d"
fi
+unxz=missing
+if [ $Funxz != missing ]; then
+ unxz="$Funxz -c -d"
+fi
pcat="$Fpcat"
zcat="$Fzcat"
fcat="$Ffcat"
@@ -1170,6 +1175,9 @@
lzma)
echo "Command to use for .lzma files (standard lzma)"
echo $n "[`eval echo \\$$filter`] $c" ;;
+ xz)
+ echo "Command to use for .xz files (standard xz)"
+ echo $n "[`eval echo \\$$filter`] $c" ;;
pcat)
echo "Command to use for .z files (pack/unpack)"
echo $n "[`eval echo \\$$filter`] $c" ;;
@@ -1232,6 +1240,7 @@
.gz) decompress=$gunzip ;;
.bz2) decompress=$bzip2 ;;
.lzma) decompress=$unlzma ;;
+ .xz) decompress=$unxz ;;
.z) decompress=$pcat ;;
.Z) decompress=$zcat ;;
.F) decompress=$fcat ;;
@@ -1325,6 +1334,7 @@
s,@gunzip@,$gunzip,
s,@bzip2@,$bzip2,
s,@unlzma@,$unlzma,
+s,@unxz@,$unxz,
s,@unyabba@,$unyabba,
s,@compress@,$compress,
s,@compress_ext@,$compress_ext,
--- 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 ~ /[;&|`$(]/) {
--- a/src/man.conf.in
+++ b/src/man.conf.in
@@ -133,6 +133,7 @@
.gz @gunzip@
.bz2 @bzip2@
.lzma @unlzma@
+.xz @unxz@
.z @pcat@
.Z @zcat@
.F @fcat@

View File

@ -0,0 +1,128 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/man/man-1.6f-r4.ebuild,v 1.9 2011/04/13 15:03:49 ulm Exp $
EAPI="2"
inherit eutils 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 ~sparc-fbsd ~x86-fbsd"
IUSE="lzma nls"
DEPEND="nls? ( sys-devel/gettext )"
RDEPEND="|| ( >=sys-apps/groff-1.19.2-r1 app-doc/heirloom-doctools )
!sys-apps/man-db
!app-arch/lzma
lzma? ( app-arch/xz-utils )"
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.5p-search-order.patch
epatch "${FILESDIR}"/man-1.6f-unicode.patch #146315
epatch "${FILESDIR}"/man-1.5p-defmanpath-symlinks.patch
epatch "${FILESDIR}"/man-1.6b-more-sections.patch
epatch "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
epatch "${FILESDIR}"/man-1.5m2-apropos.patch
epatch "${FILESDIR}"/man-1.6d-fbsd.patch
epatch "${FILESDIR}"/man-1.6e-headers.patch
epatch "${FILESDIR}"/man-1.6f-so-search-2.patch
epatch "${FILESDIR}"/man-1.6f-compress.patch
epatch "${FILESDIR}"/man-1.6f-parallel-build.patch #207148 #258916
epatch "${FILESDIR}"/man-1.6f-xz.patch #302380
# 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
}

View File

@ -0,0 +1,24 @@
we'll hijack the freebsd* case that comes later
--- ncurses-5.6/aclocal.m4
+++ ncurses-5.6/aclocal.m4
@@ -3806,7 +3806,7 @@
MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]'
cf_cv_rm_so_locs=yes
;;
- linux*|gnu*|k*bsd*-gnu)
+ linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*)
if test "$DFT_LWR_MODEL" = "shared" ; then
LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
--- ncurses-5.6/configure
+++ ncurses-5.6/configure
@@ -3806,7 +3806,7 @@
MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
cf_cv_rm_so_locs=yes
;;
- linux*|gnu*|k*bsd*-gnu)
+ linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*)
if test "$DFT_LWR_MODEL" = "shared" ; then
LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"

View File

@ -0,0 +1,44 @@
http://bugs.gentoo.org/270527
Add entry for eterm-color to terminfo file
Part of upstream patch, available at:
ftp://invisible-island.net/ncurses/5.7/ncurses-5.7-20081129.patch
--- ncurses-5.7-20081122+/misc/terminfo.src 2008-11-15 21:54:35.000000000 +0000
+++ ncurses-5.7-20081129/misc/terminfo.src 2008-11-29 15:27:35.000000000 +0000
@@ -4357,6 +4357,26 @@
sgr0=\E[m, smcup=\E7\E[?47h, smir=\E[4h, smso=\E[7m,
smul=\E[4m,
+# The codes supported by the term.el terminal emulation in GNU Emacs 22.2
+eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
+ am, mir, msgr, xenl,
+ colors#8, cols#80, lines#24, pairs#64,
+ bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M,
+ csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+ cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
+ cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+ dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
+ el=\E[K, el1=\E[1K, home=\E[H, ht=^I, ich=\E[%p1%d@,
+ il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kbs=\177,
+ kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+ kdch1=\E[3~, kend=\E[4~, khome=\E[1~, kich1=\E[2~,
+ knp=\E[6~, kpp=\E[5~, op=\E[39;49m, rc=\E8, rev=\E[7m,
+ ri=\EM, rmir=\E[4l, rmso=\E[27m, rmul=\E[24m, rs1=\Ec,
+ sc=\E7, setab=\E[%p1%'('%+%dm, setaf=\E[%p1%{30}%+%dm,
+ sgr=\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;m,
+ sgr0=\E[m, smir=\E[4h, smso=\E[7m, smul=\E[4m,
+ u6=\E[%i%d;%dR, u7=\E[6n,
+
# Entries for use by the `screen' program by Juergen Weigert,
# Michael Schroeder, Oliver Laumann. The screen and
# screen-w entries came with version 3.7.1. The screen2 and screen3 entries
@@ -21795,6 +21815,9 @@
# * change several \E[2g (clear tab at current column) to \E[3g
# (clear all tabs) to match definition for tbc capability -TD
#
+# 2008-11-29
+# * add eterm-color -TD
+#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"

View File

@ -0,0 +1,88 @@
http://bugs.gentoo.org/245370
ripped from ncurses-5.7-20081213.patch
20081213
+ add check for failure to open hashed-database needed for db4.6
(GenToo #245370).
--- ncurses-5.7-20081206+/ncurses/tinfo/hashed_db.c 2006-08-19 19:48:38.000000000 +0000
+++ ncurses-5.7-20081213/ncurses/tinfo/hashed_db.c 2008-12-13 20:59:02.000000000 +0000
@@ -49,27 +49,30 @@
_nc_db_open(const char *path, bool modify)
{
DB *result = 0;
+ int code;
#if HASHED_DB_API >= 4
db_create(&result, NULL, 0);
- result->open(result,
- NULL,
- path,
- NULL,
- DB_HASH,
- modify ? DB_CREATE : DB_RDONLY,
- 0644);
+ if ((code = result->open(result,
+ NULL,
+ path,
+ NULL,
+ DB_HASH,
+ modify ? DB_CREATE : DB_RDONLY,
+ 0644)) != 0) {
+ result = 0;
+ }
#elif HASHED_DB_API >= 3
db_create(&result, NULL, 0);
- result->open(result,
- path,
- NULL,
- DB_HASH,
- modify ? DB_CREATE : DB_RDONLY,
- 0644);
+ if ((code = result->open(result,
+ path,
+ NULL,
+ DB_HASH,
+ modify ? DB_CREATE : DB_RDONLY,
+ 0644)) != 0) {
+ result = 0;
+ }
#elif HASHED_DB_API >= 2
- int code;
-
if ((code = db_open(path,
DB_HASH,
modify ? DB_CREATE : DB_RDONLY,
@@ -77,21 +80,22 @@
(DB_ENV *) 0,
(DB_INFO *) 0,
&result)) != 0) {
- T(("cannot open %s: %s", path, strerror(code)));
result = 0;
- } else {
- T(("opened %s", path));
}
#else
- result = dbopen(path,
- modify ? (O_CREAT | O_RDWR) : O_RDONLY,
- 0644,
- DB_HASH,
- NULL);
+ if ((result = dbopen(path,
+ modify ? (O_CREAT | O_RDWR) : O_RDONLY,
+ 0644,
+ DB_HASH,
+ NULL)) == 0) {
+ code = errno;
+ }
+#endif
if (result != 0) {
T(("opened %s", path));
+ } else {
+ T(("cannot open %s: %s", path, strerror(code)));
}
-#endif
return result;
}

View File

@ -0,0 +1,11 @@
--- ncurses-5.7/ncurses/curses.priv.h
+++ ncurses-5.7/ncurses/curses.priv.h
@@ -1452,6 +1452,8 @@ extern NCURSES_EXPORT(void) _nc_expanded
/* charable.c */
#if USE_WIDEC_SUPPORT
+#include <wchar.h>
+
extern NCURSES_EXPORT(bool) _nc_is_charable(wchar_t);
extern NCURSES_EXPORT(int) _nc_to_char(wint_t);
extern NCURSES_EXPORT(wint_t) _nc_to_widechar(int);

View File

@ -0,0 +1,189 @@
Add rxvt-unicode terminfo, required by rxvt-unicode to function properly.
Providing this in ncurses makes it widely available, much better than having to
install rxvt-unicode everywhere.
http://bugs.gentoo.org/show_bug.cgi?id=192083
This patch uses the updated rxvt-unicode-9.09 terminfo
which adds support for 256 colors.
--- misc/terminfo.src
+++ misc/terminfo.src
@@ -3965,6 +3965,176 @@
rxvt-16color|xterm with 16 colors like aixterm,
ncv#32, use=ibm+16color, use=rxvt,
+# From: Thomas Dickey <dickey@clark.net> 04 Oct 1997
+# Updated: Özgür Kesim <kesim@math.fu-berlin.de> 02 Nov 1997
+# Updated: Marc Lehmann <pcg@goof.com>, 17 Feb 2005
+# Updated: Marc Lehmann <schmorp@schmorp.de>, 04 Nov 2008: change init/reset sequences
+rxvt-unicode|rxvt-unicode terminal (X Window System),
+ am,
+ bce,
+ eo,
+ km,
+ msgr,
+ xenl,
+ hs,
+ cols#80,
+ it#8,
+ lines#24,
+ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~-A.B+C\,D0EhFiG,
+ bel=^G,
+ blink=\E[5m,
+ bold=\E[1m,
+ civis=\E[?25l,
+ clear=\E[H\E[2J,
+ cnorm=\E[?25h,
+ cr=^M,
+ csr=\E[%i%p1%d;%p2%dr,
+ cub=\E[%p1%dD,
+ cub1=^H,
+ cud=\E[%p1%dB,
+ cud1=^J,
+ cuf=\E[%p1%dC,
+ cuf1=\E[C,
+ cup=\E[%i%p1%d;%p2%dH,
+ cuu=\E[%p1%dA,
+ cuu1=\E[A,
+ cvvis=\E[?25h,
+ dch=\E[%p1%dP,
+ dch1=\E[P,
+ dl=\E[%p1%dM,
+ dl1=\E[M,
+ ed=\E[J,
+ el=\E[K,
+ el1=\E[1K,
+ flash=\E[?5h$<20/>\E[?5l,
+ home=\E[H,
+ hpa=\E[%i%p1%dG,
+ ht=^I,
+ hts=\EH,
+ ich=\E[%p1%d@,
+ ich1=\E[@,
+ il=\E[%p1%dL,
+ il1=\E[L,
+ ind=^J,
+ is1=\E[\041p,
+ is2=\E[r\E[m\E[2J\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
+ kDC=\E[3$,
+ kIC=\E2$,
+ kEND=\E[8$,
+ kHOM=\E[7$,
+ kLFT=\E[d,
+ kNXT=\E[6$,
+ kPRV=\E[5$,
+ kRIT=\E[c,
+ kbs=\177,
+ ka1=\EOw,
+ ka3=\EOy,
+ kb2=\EOu,
+ kc1=\EOq,
+ kc3=\EOs,
+ kcbt=\E[Z,
+ kcub1=\E[D,
+ kcud1=\E[B,
+ kcuf1=\E[C,
+ kcuu1=\E[A,
+ kdch1=\E[3~,
+ kel=\E[8\^,
+ kend=\E[8~,
+ kent=\EOM,
+ kf1=\E[11~,
+ kf10=\E[21~,
+ kf11=\E[23~,
+ kf12=\E[24~,
+ kf13=\E[25~,
+ kf14=\E[26~,
+ kf15=\E[28~,
+ kf16=\E[29~,
+ kf17=\E[31~,
+ kf18=\E[32~,
+ kf19=\E[33~,
+ kf2=\E[12~,
+ kf20=\E[34~,
+ kf3=\E[13~,
+ kf4=\E[14~,
+ kf5=\E[15~,
+ kf6=\E[17~,
+ kf7=\E[18~,
+ kf8=\E[19~,
+ kf9=\E[20~,
+ kfnd=\E[1~,
+ khome=\E[7~,
+ kich1=\E[2~,
+ kmous=\E[M,
+ knp=\E[6~,
+ kpp=\E[5~,
+ kslt=\E[4~,
+ rc=\E8,
+ rev=\E[7m,
+ ri=\EM,
+ rmso=\E[27m,
+ rmul=\E[24m,
+ rs1=\Ec,
+ rs2=\E[r\E[m\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
+ sgr0=\E[m\E(B,
+ enacs=,
+ smacs=\E(0,
+ rmacs=\E(B,
+ smso=\E[7m,
+ smul=\E[4m,
+ tbc=\E[3g,
+ vpa=\E[%i%p1%dd,
+ colors#88,
+ pairs#7744,
+ btns#5,
+ lm#0,
+ ccc,
+ npc,
+ mc5i,
+ ncv#0,
+ mir,
+ xon,
+ bw,
+ ech=\E[%p1%dX,
+ mc0=\E[i,
+ mc4=\E[4i,
+ mc5=\E[5i,
+ sitm=\E[3m,
+ ritm=\E[23m,
+ smam=\E[?7h,
+ rmam=\E[?7l,
+ smir=\E[4h,
+ rmir=\E[4l,
+ smcup=\E[?1049h,
+ rmcup=\E[r\E[?1049l,
+ smkx=\E=,
+ rmkx=\E>,
+ indn=\E[%p1%dS,
+ rin=\E[%p1%dT,
+ sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
+ op=\E[39;49m,
+ setaf=\E[38;5;%p1%dm,
+ setab=\E[48;5;%p1%dm,
+ setf=%?%p1%{7}%>%t\E[38;5;%p1%dm%e\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ setb=%?%p1%{7}%>%t\E[48;5;%p1%dm%e\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
+ initc=\E]4;%p1%d;rgb\:%p2%{65535}%*%{1000}%/%4.4X/%p3%{65535}%*%{1000}%/%4.4X/%p4%{65535}%*%{1000}%/%4.4X\E\\,
+ sc=\E7,
+ s0ds=\E(B,
+ s1ds=\E(0,
+ s2ds=\E*B,
+ s3ds=\E+B,
+ u6=\E[%i%d;%dR,
+ u7=\E[6n,
+ u8=\E[?1;2c,
+ u9=\E[c,
+ tsl=\E]2;,
+ fsl=\007,
+ dsl=\E]2;\007,
+
+rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System),
+ colors#256,
+ pairs#32767,
+ use=rxvt-unicode,
+
# mrxvt 0.5.3
#
# mrxvt is based on rxvt 2.7.11, but has by default XTERM_FKEYS defined, which

View File

@ -0,0 +1,58 @@
use $cross_compiling that autotools already set up rather than trying to
do a custom & fragile job with compiler names
configure.in also needs AC_SUBST(cross_compiling) ...
http://bugs.gentoo.org/288881
--- a/configure
+++ b/configure
@@ -17300,6 +17300,7 @@
s,@build_alias@,$build_alias,;t t
s,@host_alias@,$host_alias,;t t
s,@target_alias@,$target_alias,;t t
+s,@cross_compiling@,$cross_compiling,;t t
s,@ECHO_C@,$ECHO_C,;t t
s,@ECHO_N@,$ECHO_N,;t t
s,@ECHO_T@,$ECHO_T,;t t
--- a/misc/run_tic.in
+++ b/misc/run_tic.in
@@ -52,8 +52,7 @@
: ${ticdir=@TERMINFO@}
: ${source=@TERMINFO_SRC@}
: ${LN_S="@LN_S@"}
-: ${THAT_CC=cc}
-: ${THIS_CC=cc}
+: ${cross_compiling=@cross_compiling@}
: ${ext_funcs=@NCURSES_EXT_FUNCS@}
test -z "${DESTDIR}" && DESTDIR=
@@ -61,7 +60,7 @@
# Allow tic to run either from the install-path, or from the build-directory.
# Do not do this if we appear to be cross-compiling. In that case, we rely
# on the host's copy of tic to compile the terminfo database.
-if test "$THAT_CC" = "$THIS_CC" ; then
+if test "$cross_compiling" != "yes" ; then
case "$PATH" in
:*) PATH=../progs:../lib:${DESTDIR}$bindir$PATH ;;
*) PATH=../progs:../lib:${DESTDIR}$bindir:$PATH ;;
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -59,6 +59,7 @@
CC = @CC@
HOSTCC = @BUILD_CC@
+cross_compiling = @cross_compiling@
tabsetdir = $(datadir)/tabset
ticdir = @TERMINFO@
@@ -91,8 +92,7 @@
datadir=${datadir} \
ticdir=${ticdir} \
source=terminfo.tmp \
- THIS_CC="$(CC)" \
- THAT_CC="$(HOSTCC)" \
+ cross_compiling="${cross_compiling}" \
$(SHELL) ./run_tic.sh
@cd $(srcdir)/tabset && \
$(SHELL) -c 'for i in * ; do \

View File

@ -0,0 +1,167 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-libs/ncurses/ncurses-5.7-r7.ebuild,v 1.9 2011/05/22 18:19:56 xarthisius Exp $
EAPI="1"
inherit eutils flag-o-matic toolchain-funcs
MY_PV=${PV:0:3}
PV_SNAP=${PV:4}
MY_P=${PN}-${MY_PV}
DESCRIPTION="console display library"
HOMEPAGE="http://www.gnu.org/software/ncurses/ http://dickey.his.com/ncurses/"
SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz"
LICENSE="MIT"
SLOT="5"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
IUSE="ada +cxx debug doc gpm minimal profile static-libs trace unicode"
DEPEND="gpm? ( sys-libs/gpm )"
# berkdb? ( sys-libs/db )"
RDEPEND="!<x11-terms/rxvt-unicode-9.06-r3"
S=${WORKDIR}/${MY_P}
src_unpack() {
unpack ${A}
cd "${S}"
[[ -n ${PV_SNAP} ]] && epatch "${WORKDIR}"/${MY_P}-${PV_SNAP}-patch.sh
epatch "${FILESDIR}"/${PN}-5.6-gfbsd.patch
epatch "${FILESDIR}"/${PN}-5.7-emacs.patch #270527
epatch "${FILESDIR}"/${PN}-5.7-nongnu.patch
epatch "${FILESDIR}"/${PN}-5.7-tic-cross-detection.patch #288881
epatch "${FILESDIR}"/${PN}-5.7-rxvt-unicode-9.09.patch #192083
epatch "${FILESDIR}"/${P}-hashdb-open.patch #245370
sed -i '/with_no_leaks=yes/s:=.*:=$enableval:' configure #305889
}
src_compile() {
unset TERMINFO #115036
tc-export BUILD_CC
export BUILD_CPPFLAGS+=" -D_GNU_SOURCE" #214642
# when cross-compiling, we need to build up our own tic
# because people often don't keep matching host/target
# ncurses versions #249363
if tc-is-cross-compiler && ! ROOT=/ has_version ~sys-libs/${P} ; then
make_flags="-C progs tic"
CHOST=${CBUILD} \
CFLAGS=${BUILD_CFLAGS} \
CXXFLAGS=${BUILD_CXXFLAGS} \
CPPFLAGS=${BUILD_CPPFLAGS} \
LDFLAGS="${BUILD_LDFLAGS} -static" \
do_compile cross --without-shared --with-normal
fi
make_flags=""
do_compile narrowc
use unicode && do_compile widec --enable-widec --includedir=/usr/include/ncursesw
}
do_compile() {
ECONF_SOURCE=${S}
mkdir "${WORKDIR}"/$1
cd "${WORKDIR}"/$1
shift
# The chtype/mmask-t settings below are to retain ABI compat
# with ncurses-5.4 so dont change em !
local conf_abi="
--with-chtype=long \
--with-mmask-t=long \
--disable-ext-colors \
--disable-ext-mouse \
--without-pthread \
--without-reentrant \
"
# We need the basic terminfo files in /etc, bug #37026. We will
# add '--with-terminfo-dirs' and then populate /etc/terminfo in
# src_install() ...
# $(use_with berkdb hashed-db)
econf \
--with-terminfo-dirs="/etc/terminfo:/usr/share/terminfo" \
--with-shared \
--without-hashed-db \
$(use_with ada) \
$(use_with cxx) \
$(use_with cxx cxx-binding) \
$(use_with debug) \
$(use_with profile) \
$(use_with gpm) \
--disable-termcap \
--enable-symlinks \
--with-rcs-ids \
--with-manpage-format=normal \
--enable-const \
--enable-colorfgbg \
--enable-echo \
$(use_enable !ada warnings) \
$(use_with debug assertions) \
$(use_enable debug leaks) \
$(use_with debug expanded) \
$(use_with !debug macros) \
$(use_with trace) \
${conf_abi} \
"$@"
# A little hack to fix parallel builds ... they break when
# generating sources so if we generate the sources first (in
# non-parallel), we can then build the rest of the package
# in parallel. This is not really a perf hit since the source
# generation is quite small.
emake -j1 sources || die
emake ${make_flags} || die
}
src_install() {
# use the cross-compiled tic (if need be) #249363
export PATH=${WORKDIR}/cross/progs:${PATH}
# install unicode version second so that the binaries in /usr/bin
# support both wide and narrow
cd "${WORKDIR}"/narrowc
emake DESTDIR="${D}" install || die
if use unicode ; then
cd "${WORKDIR}"/widec
emake DESTDIR="${D}" install || die
fi
# Move libncurses{,w} into /lib
gen_usr_ldscript -a ncurses
use unicode && gen_usr_ldscript -a ncursesw
ln -sf libncurses.so "${D}"/usr/$(get_libdir)/libcurses.so || die
use static-libs || rm "${D}"/usr/$(get_libdir)/*.a
# if ! use berkdb ; then
# We need the basic terminfo files in /etc, bug #37026
einfo "Installing basic terminfo files in /etc..."
for x in ansi console dumb linux rxvt rxvt-unicode screen sun vt{52,100,102,200,220} \
xterm xterm-color xterm-xfree86
do
local termfile=$(find "${D}"/usr/share/terminfo/ -name "${x}" 2>/dev/null)
local basedir=$(basename $(dirname "${termfile}"))
if [[ -n ${termfile} ]] ; then
dodir /etc/terminfo/${basedir}
mv ${termfile} "${D}"/etc/terminfo/${basedir}/
dosym ../../../../etc/terminfo/${basedir}/${x} \
/usr/share/terminfo/${basedir}/${x}
fi
done
# Build fails to create this ...
dosym ../share/terminfo /usr/$(get_libdir)/terminfo
# fi
echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses
doenvd "${T}"/50ncurses
use minimal && rm -r "${D}"/usr/share/terminfo*
# Because ncurses5-config --terminfo returns the directory we keep it
keepdir /usr/share/terminfo #245374
cd "${S}"
dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc
use doc && dohtml -r doc/html/
}