From thierry@FreeBSD.org  Thu Sep 16 20:39:23 2004
Return-Path: <thierry@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7120116A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Sep 2004 20:39:23 +0000 (GMT)
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 57D2943D1F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Sep 2004 20:39:23 +0000 (GMT)
	(envelope-from thierry@FreeBSD.org)
Received: from freefall.freebsd.org (thierry@localhost [127.0.0.1])
	by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i8GKdNJu060708
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Sep 2004 20:39:23 GMT
	(envelope-from thierry@freefall.freebsd.org)
Received: (from thierry@localhost)
	by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8GKdNLF060707;
	Thu, 16 Sep 2004 20:39:23 GMT
	(envelope-from thierry)
Message-Id: <200409162039.i8GKdNLF060707@freefall.freebsd.org>
Date: Thu, 16 Sep 2004 20:39:23 GMT
From: Thierry Thomas <thierry@FreeBSD.org>
Reply-To: Thierry Thomas <thierry@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Add ncurses utility programs: infocmp, tic and toe.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71801
>Category:       bin
>Synopsis:       [patch] Add ncurses utility programs: infocmp, tic and toe.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 16 20:40:19 GMT 2004
>Closed-Date:    Fri Jan 05 13:28:23 GMT 2007
>Last-Modified:  Fri Jan 05 13:28:23 GMT 2007
>Originator:     Thierry Thomas
>Release:        FreeBSD 5.3-BETA4
>Organization:
FreeBSD
>Environment:
System: FreeBSD ws90bj.pompo.net 5.3-BETA4 FreeBSD 5.3-BETA4 #0: Thu Sep 16 00:17:00 CEST 2004     thierry@ws90bj.pompo.net:/usr/obj/usr/src/sys/WS90BJ-040826  i386


	
>Description:
	- tic is the the terminfo entry-description compiler;
	- toe lists the table of terminfo entries;
	- infocmp compares or prints out terminfo descriptions.

	infotocap and captoinfo are links to tic:
	- captoinfo converts a termcap description into a terminfo description;
	- infotocap converts a terminfo description into a termcap description.

	Reason:
	- the port x11/rxvt-unicode needs tic to add an entry for itself; without
	  it, its $TERM must be defined as rxvt;
	- the port devel/ncurses cannot be packaged: "conflicts with system ncurses".

	Remarks:
	- no initial terminfo database is installed;
	- these programs are installed by compat/linux.

	Next step will be to upgrade the base libncurses to a version supporting
	wide chars, but this is another story...

>How-To-Repeat:
	N/A.

>Fix:
	Please apply the following patch:

--- ncurses.diff begins here ---
diff -urN src.orig/usr.bin/Makefile src/usr.bin/Makefile
--- src.orig/usr.bin/Makefile	Thu Jul  8 00:48:30 2004
+++ src/usr.bin/Makefile	Wed Sep 15 21:51:18 2004
@@ -76,6 +76,7 @@
 	${_host} \
 	id \
 	indent \
+	infocmp \
 	ipcrm \
 	ipcs \
 	join \
@@ -173,8 +174,10 @@
 	tee \
 	telnet \
 	tftp \
+	tic \
 	time \
 	tip \
+	toe \
 	top \
 	touch \
 	tput \
diff -urN src.orig/usr.bin/infocmp/Makefile src/usr.bin/infocmp/Makefile
--- src.orig/usr.bin/infocmp/Makefile	Thu Jan  1 01:00:00 1970
+++ src/usr.bin/infocmp/Makefile	Thu Sep 16 21:21:35 2004
@@ -0,0 +1,58 @@
+# $FreeBSD$
+
+NCURSES= ${.CURDIR}/../../contrib/ncurses
+LIBCURD= ${.CURDIR}/../../lib/libncurses
+INFOCMPDIR=	${NCURSES}/progs
+.PATH: ${INFOCMPDIR}
+.PATH: ${NCURSES}/man
+
+PROG=		infocmp
+CFLAGS+=	-DNDEBUG -I. -I${INFOCMPDIR} -I${NCURSES}/include -I${LIBCURD}
+
+DPADD=		${LIBNCURSES}
+LDADD=		-lncurses
+
+AWK?=		awk
+TERMINFODIR?=	${SHAREDIR}/misc
+
+GENHDR =	ncurses_def.h \
+		parametrized.h \
+		transform.h
+GENSRC =	termsort.c
+
+SRCS=		${GENHDR} \
+		dump_entry.c	\
+		infocmp.c
+
+CLEANFILES+=	${GENHDR} ${GENSRC}
+MANFILTER=	sed -e 's|@TERMINFO@|${TERMINFODIR}/terminfo|g' \
+		    -e 's|1M|1|g;s|(3X)|(3)|g'
+
+MANm=		infocmp.1m
+# Generate the MAN list from MANm
+.for page in ${MANm}
+CLEANFILES+=${page:T:S/m$//}
+MAN+=${page:T:S/m$//}
+${page:T:S/m$//}: ${page}
+	cat ${.ALLSRC} > ${.TARGET}
+.endfor
+
+# Generated headers
+ncurses_def.h:
+	AWK=${AWK} sh ${NCURSES}/include/MKncurses_def.sh \
+	    ${NCURSES}/include/ncurses_defs > ncurses_def.h
+
+parametrized.h:
+	AWK=${AWK} sh ${NCURSES}/include/MKparametrized.sh \
+	    ${NCURSES}/include/Caps > $@
+
+termsort.c: $(INFOCMPDIR)/MKtermsort.sh
+	sh -c "$(INFOCMPDIR)/MKtermsort.sh $(AWK) $(NCURSES)/include/Caps" >$@
+
+transform.h: termsort.c
+	echo "#define PROG_CAPTOINFO \"captoinfo\"" > $@
+	echo "#define PROG_INFOTOCAP \"infotocap\"" >>$@
+	echo "#define PROG_RESET     \"reset\""     >>$@
+	echo "#define PROG_INIT      \"init\""      >>$@
+
+.include <bsd.prog.mk>
diff -urN src.orig/usr.bin/tic/Makefile src/usr.bin/tic/Makefile
--- src.orig/usr.bin/tic/Makefile	Thu Jan  1 01:00:00 1970
+++ src/usr.bin/tic/Makefile	Thu Sep 16 21:08:25 2004
@@ -0,0 +1,65 @@
+# $FreeBSD$
+
+NCURSES= ${.CURDIR}/../../contrib/ncurses
+LIBCURD= ${.CURDIR}/../../lib/libncurses
+TICDIR=	${NCURSES}/progs
+.PATH: ${TICDIR}
+.PATH: ${NCURSES}/man
+
+PROG=		tic
+CFLAGS+=	-DNDEBUG -I. -I${TICDIR} -I${NCURSES}/include -I${LIBCURD}
+
+DPADD=		${LIBNCURSES}
+LDADD=		-lncurses
+
+LINKS=		${BINDIR}/tic ${BINDIR}/infotocap
+LINKS+=		${BINDIR}/tic ${BINDIR}/captoinfo
+
+AWK?=		awk
+TERMINFODIR?=	${SHAREDIR}/misc
+
+GENHDR =	ncurses_def.h \
+		parametrized.h \
+		transform.h
+GENSRC =	termsort.c
+
+SRCS=		${GENHDR} \
+		dump_entry.c	\
+		tic.c
+
+CLEANFILES+=	${GENHDR} ${GENSRC}
+MANFILTER=	sed -e 's|@TERMINFO@|${TERMINFODIR}/terminfo|g' \
+		    -e 's|@INFOCMP@|infocmp|g' \
+		    -e 's|@CAPTOINFO@|captoinfo|g' \
+		    -e 's|@INFOTOCAP@|infotocap|g' \
+		    -e 's|@TOE@|toe|g' \
+		    -e 's|1M|1|g;s|(3X)|(3)|g'
+
+MANm=		captoinfo.1m infotocap.1m tic.1m
+# Generate the MAN list from MANm
+.for page in ${MANm}
+CLEANFILES+=${page:T:S/m$//}
+MAN+=${page:T:S/m$//}
+${page:T:S/m$//}: ${page}
+	cat ${.ALLSRC} > ${.TARGET}
+.endfor
+
+# Generated headers
+ncurses_def.h:
+	AWK=${AWK} sh ${NCURSES}/include/MKncurses_def.sh \
+		${NCURSES}/include/ncurses_defs > ncurses_def.h
+
+parametrized.h:
+	AWK=${AWK} sh ${NCURSES}/include/MKparametrized.sh \
+		${NCURSES}/include/Caps > $@
+
+termsort.c: $(TICDIR)/MKtermsort.sh
+	sh -c "$(TICDIR)/MKtermsort.sh $(AWK) $(NCURSES)/include/Caps" >$@
+
+transform.h: termsort.c
+	echo "#define PROG_CAPTOINFO \"captoinfo\"" > $@
+	echo "#define PROG_INFOTOCAP \"infotocap\"" >>$@
+	echo "#define PROG_RESET     \"reset\""     >>$@
+	echo "#define PROG_INIT      \"init\""      >>$@
+
+.include <bsd.prog.mk>
diff -urN src.orig/usr.bin/toe/Makefile src/usr.bin/toe/Makefile
--- src.orig/usr.bin/toe/Makefile	Thu Jan  1 01:00:00 1970
+++ src/usr.bin/toe/Makefile	Thu Sep 16 21:11:58 2004
@@ -0,0 +1,62 @@
+# $FreeBSD$
+
+NCURSES= ${.CURDIR}/../../contrib/ncurses
+LIBCURD= ${.CURDIR}/../../lib/libncurses
+TOEDIR=	${NCURSES}/progs
+.PATH: ${TOEDIR}
+.PATH: ${NCURSES}/man
+
+PROG=		toe
+CFLAGS+=	-DNDEBUG -I. -I${TOEDIR} -I${NCURSES}/include -I${LIBCURD}
+
+DPADD=		${LIBNCURSES}
+LDADD=		-lncurses
+
+AWK?=		awk
+TERMINFODIR?=	${SHAREDIR}/misc
+
+GENHDR =	ncurses_def.h \
+		parametrized.h \
+		transform.h
+GENSRC =	termsort.c
+
+SRCS=		${GENHDR} \
+		dump_entry.c	\
+		toe.c
+
+CLEANFILES+=	${GENHDR} ${GENSRC}
+MANFILTER=	sed -e 's|@TERMINFO@|${TERMINFODIR}/terminfo|g' \
+		    -e 's|@INFOCMP@|infocmp|g' \
+		    -e 's|@CAPTOINFO@|captoinfo|g' \
+		    -e 's|@INFOTOCAP@|infotocap|g' \
+		    -e 's|@TIC@|tic|g' \
+		    -e 's|1M|1|g;s|(3X)|(3)|g'
+
+MANm=		toe.1m
+# Generate the MAN list from MANm
+.for page in ${MANm}
+CLEANFILES+=${page:T:S/m$//}
+MAN+=${page:T:S/m$//}
+${page:T:S/m$//}: ${page}
+	cat ${.ALLSRC} > ${.TARGET}
+.endfor
+
+# Generated headers
+ncurses_def.h:
+	AWK=${AWK} sh ${NCURSES}/include/MKncurses_def.sh \
+	    ${NCURSES}/include/ncurses_defs > ncurses_def.h
+
+parametrized.h:
+	AWK=${AWK} sh ${NCURSES}/include/MKparametrized.sh \
+	    ${NCURSES}/include/Caps > $@
+
+termsort.c: $(TOEDIR)/MKtermsort.sh
+	sh -c "$(TOEDIR)/MKtermsort.sh $(AWK) $(NCURSES)/include/Caps" >$@
+
+transform.h: termsort.c
+	echo "#define PROG_CAPTOINFO \"captoinfo\"" > $@
+	echo "#define PROG_INFOTOCAP \"infotocap\"" >>$@
+	echo "#define PROG_RESET     \"reset\""     >>$@
+	echo "#define PROG_INIT      \"init\""      >>$@
+
+.include <bsd.prog.mk>
--- ncurses.diff ends here ---

>Release-Note:
>Audit-Trail:

From: Thomas Dickey <dickey@his.com>
To: bug-followup@FreeBSD.org, thierry@FreeBSD.org, dickey@his.com
Cc:  
Subject: re: bin/71801: [patch] Add ncurses utility programs: infocmp,
 tic and toe.
Date: Wed, 27 Dec 2006 08:42:17 -0500

 --h31gzZEtNLTqOjlF
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 ncurses 5.6 provides support for hashed-databases, in the general style
 of the FreeBSD src/lib/libncurses base.  If properly configured, it can
 (still) read the termcap hashed database, and read/write a similar
 terminfo database.
 
 Since the customized source in FreeBSD, e.g.,
 
 	http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libncurses/termcap.c
 
 is all based on the upstream source with minor 1- 2-line changes,
 it would be simple for someone to update the sources and have less
 work to do to keep up with the upstream development.
 
 	http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/ncurses/Makefile
 
 Furthermore, I note that the most recent change to the ncurses port
 dropped the terminfo database entirely, e.g., in
 
 	http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/ncurses/Makefile
 
 so there is no compatibility consideration for the port at this time that
 would preclude using the terminfo hashed databases rather than the
 directory tree.  In fact, since there is no terminfo database now,
 the port itself is defective since it no longer provides many of the
 terminal types used from other systems.
 
 Short: redirect this toward fixing the port by adding the utilities there.
 
 --=20
 Thomas E. Dickey <dickey@invisible-island.net>
 http://invisible-island.net
 ftp://invisible-island.net
 
 --h31gzZEtNLTqOjlF
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: Digital signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
 iD8DBQFFkng5cCNT4PfkjtsRAgWZAJoDrIZDt75WalUyeo+g+TG2vmE0agCfUYQq
 qJhVxayTVCECvg2it20JgIk=
 =+uN8
 -----END PGP SIGNATURE-----
 
 --h31gzZEtNLTqOjlF--
State-Changed-From-To: open->closed 
State-Changed-By: thierry 
State-Changed-When: Fri Jan 5 13:26:56 UTC 2007 
State-Changed-Why:  

The port devel/ncurses is now packageable, and it includes everything. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=71801 
>Unformatted:
