Package-Name: ncurses
Gentoo-Package: sys-libs/ncurses
Requires: glibc
Compile-Requires: gcc binutils make
Homepage: http://www.gnu.org/software/ncurses/
Source: gnu:///ncurses/ncurses-(\d+.\d+(.\d+)?).tar.gz $1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	cp -p ANNOUNCE NEWS README TO-DO "$(PREFIX)/"
	if [ "$(STRIPLIBS)" ] ; then debug=without ; else debug=with ; fi ; \
	$(MAKE) -f ../Makefile configure CONFIGURE_OPTS="\
		--with-shared \
		--with-static \
		--$$debug-debug \
		--without-profile \
		--enable-symlinks \
		--with-manpage-format=normal \
		--enable-termcap \
# --enable-overwrite is needed to put include files in main include directory
# instead of ncurses/
		--enable-overwrite \
		"
	$(MAKE)
# Avoid problems with overwriting shared libraries; however, shared-link
# bash requires ncurses, so make sure we keep an accessible copy around
	if test -f /usr/lib/libncurses.so ; then \
		rm -f /usr/lib/libncurses.so.5 ; \
		cp -p /usr/lib/libncurses.so{,.5} ; \
	fi
	rm -f "$(PREFIX)"/lib/*.so*
	/sbin/ldconfig
	$(MAKE) install
	rm -f /usr/lib/libncurses.so.5
	/sbin/ldconfig
# FIXME: recompile with --enable-widec, since Lynx seems to need it
	$(MAKE) clean
	$(MAKE) -f ../Makefile configure CONFIGURE_OPTS="\
		--with-shared \
		--without-static \
		--without-debug \
		--without-profile \
		--enable-symlinks \
		--enable-widec \
		"
	$(MAKE)
	cp -af lib/lib{form,menu,ncurses,panel}w.so.* "$(PREFIX)"/lib/
	chmod a-x "$(PREFIX)"/man/man*/*.*
	rm -f "$(PREFIX)"/lib/{libcurses.so,terminfo*}  # unneeded symlinks
Install:
	$(MAKE) instbin BIN="captoinfo clear infocmp infotocap reset tack tic toe tput tset"
	$(MAKE) instlib LIB="form menu ncurses ncurses++ panel formw menuw ncursesw panelw"
	if [ ! "$(STRIPLIB)" ] ; then \
		$(MAKE) instlib LIB="form_g menu_g ncurses_g panel_g" ; \
	else \
		rm -f {/usr,"$(PREFIX)"}/lib/lib{form,menu,ncurses,panel}_g.a ; \
	fi
	ln -fs libncurses.a /usr/lib/libcurses.a
	ln -fs libncurses.so /usr/lib/libcurses.so
	$(MAKE) addldso
	$(MAKE) instinc INC="curses.h cursesapp.h cursesf.h cursesm.h cursesp.h cursesw.h cursslk.h eti.h etip.h form.h menu.h ncurses.h ncurses_dll.h panel.h term.h termcap.h unctrl.h"
	$(MAKE) instman SECTION=1 MAN="clear tack tput tset"
	$(MAKE) instman SECTION=1 SUFFIX=m MAN="captoinfo infocmp tic toe"
	$(MAKE) instman SECTION=3 SUFFIX=x MAN="curs_* define_key form form_* keybound keyok menu menu_* mitem_* ncurses panel resizeterm wresize"
	$(MAKE) instman SECTION=5 MAN="term terminfo"
	$(MAKE) instman SECTION=7 MAN=term
	rm -rf /usr/share/{tabset,terminfo} /usr/lib/terminfo
	ln -s "$(PREFIX)"/share/{tabset,terminfo} /usr/share/
	ln -s ../share/terminfo /usr/lib/
# FIXME: (configure) weird bash brokenness
#        (all others except terminfo.src) Japanese fullwidth character corruption patch
Clean:
	@set -e ; cd "$(PREFIX)"/lib ; \
	for lib in *.so.[0-9] ; do \
		reallib=`/bin/ls -l "$$lib" | sed 's/.* -> //'` ; \
		for file in $$lib.[0-9]*.[0-9]* ; do \
			if test "$$file" != "$$reallib" ; then \
				rm -fv "$$file" ; \
			fi ; \
		done ; \
	done
Patch: <<EOT
######## begin patch to disable setting cursor type on console
--- misc/terminfo.src.old	2006-10-08 02:52:03 +0900
+++ misc/terminfo.src	2007-02-27 06:03:16 +0900
@@ -747,9 +747,11 @@
 # The 2.2.x kernels add a private mode that sets the cursor type; use that to
 # get a block cursor for cvvis.
 # reported by Frank Heckenbach <frank@g-n-u.de>.
-linux|linux console,
-	civis=\E[?25l\E[?1c, cnorm=\E[?25h\E[?0c,
-	cvvis=\E[?25h\E[?8c, use=linux-c-nc,
+#X#linux|linux console,
+#X#	civis=\E[?25l\E[?1c, cnorm=\E[?25h\E[?0c,
+#X#	cvvis=\E[?25h\E[?8c, use=linux-c-nc,
+linux|linux console,
+	use=linux-c-nc,
 
 # See the note on ICH/ICH1 VERSUS RMIR/SMIR near the end of file
 linux-nic|linux with ich/ich1 suppressed for non-curses programs,
######## end patch to disable setting cursor type on console
######## begin patch to avoid insert/delete character actions (FIXME: why?)
--- ncurses/tinfo/read_entry.c.old	2006-08-20 00:58:50 +0900
+++ ncurses/tinfo/read_entry.c	2007-02-27 06:00:35 +0900
@@ -75,6 +75,8 @@
 	    Strings[i] = CANCELLED_STRING;
 	} else if (LOW_MSB(buf + 2 * i) > size) {
 	    Strings[i] = ABSENT_STRING;
+	} else if (i==21 || i==29 || i==31 || i==41 || i==42 || i==52 || i==105 || i==108) {
+	    Strings[i] = ABSENT_STRING;
 	} else {
 	    Strings[i] = (LOW_MSB(buf + 2 * i) + table);
 	    TR(TRACE_DATABASE, ("Strings[%d] = %s", i, _nc_visbuf(Strings[i])));
--- ncurses/tty/tty_update.c.old	2006-11-26 07:33:21 +0900
+++ ncurses/tty/tty_update.c	2007-02-27 06:00:35 +0900
@@ -490,7 +490,7 @@
 
     TR(TRACE_CHARPUT, ("EmitRange %d:%s", num, _nc_viscbuf(ntext, num)));
 
-    if (erase_chars || repeat_char) {
+    if (0 && (erase_chars || repeat_char)) {
 	while (num > 0) {
 	    int runcount;
 	    NCURSES_CH_T ntext0;
@@ -582,7 +582,7 @@
     TR(TRACE_CHARPUT, ("PutRange(%p, %p, %d, %d, %d)",
 		       otext, ntext, row, first, last));
 
-    if (otext != ntext
+    if (0 && otext != ntext
 	&& (last - first + 1) > SP->_inline_cost) {
 	for (j = first, same = 0; j <= last; j++) {
 	    if (!same && isWidecExt(otext[j]))
@@ -1324,7 +1324,7 @@
 	    ClrToEOL(blank, FALSE);
 	} else if ((nLastChar != oLastChar)
 		   && (!CharEq(newLine[nLastChar], oldLine[oLastChar])
-		       || !(_nc_idcok && has_ic()))) {
+		       || 1 || !(_nc_idcok && has_ic()))) {
 	    GoTo(lineno, firstChar);
 	    if ((oLastChar - nLastChar) > SP->_el_cost) {
 		if (PutRange(oldLine, newLine, lineno, firstChar, nLastChar))
######## end patch to avoid insert/delete character actions
EOT

/pkg/ncurses/
/usr/bin/captoinfo
/usr/bin/clear
/usr/bin/infocmp
/usr/bin/infotocap
/usr/bin/reset
/usr/bin/tack
/usr/bin/tic
/usr/bin/toe
/usr/bin/tput
/usr/bin/tset
/usr/include/curses.h
/usr/include/cursesapp.h
/usr/include/cursesf.h
/usr/include/cursesm.h
/usr/include/cursesp.h
/usr/include/cursesw.h
/usr/include/cursslk.h
/usr/include/eti.h
/usr/include/etip.h
/usr/include/form.h
/usr/include/menu.h
/usr/include/ncurses.h
/usr/include/ncurses_dll.h
/usr/include/panel.h
/usr/include/term.h
/usr/include/termcap.h
/usr/include/unctrl.h
/usr/lib/libcurses.*
/usr/lib/libform.*
/usr/lib/libformw.*
/usr/lib/libmenu.*
/usr/lib/libmenuw.*
/usr/lib/libncurses.*
/usr/lib/libncursesw.*
/usr/lib/libncurses++.*
/usr/lib/libpanel.*
/usr/lib/libpanelw.*
/usr/lib/terminfo
/usr/man/man1/captoinfo.1m.gz
/usr/man/man1/clear.1.gz
/usr/man/man1/infocmp.1m.gz
/usr/man/man1/tack.1.gz
/usr/man/man1/tic.1m.gz
/usr/man/man1/toe.1m.gz
/usr/man/man1/tput.1.gz
/usr/man/man1/tset.1.gz
/usr/man/man3/curs_*.3x.gz
/usr/man/man3/define_key.3x.gz
/usr/man/man3/form.3x.gz
/usr/man/man3/form_*.3x.gz
/usr/man/man3/keybound.3x.gz
/usr/man/man3/keyok.3x.gz
/usr/man/man3/menu.3x.gz
/usr/man/man3/menu_*.3x.gz
/usr/man/man3/mitem_*.3x.gz
/usr/man/man3/ncurses.3x.gz
/usr/man/man3/panel.3x.gz
/usr/man/man3/resizeterm.3x.gz
/usr/man/man3/wresize.3x.gz
/usr/man/man5/term.5.gz
/usr/man/man5/terminfo.5.gz
/usr/man/man7/term.7.gz
/usr/share/tabset
/usr/share/terminfo
