# ncurses 6.3 - patch 20211219 - Thomas E. Dickey
#
# ------------------------------------------------------------------------------
#
# Ncurses 6.3 is at
# 	ftp://ftp.invisible-island.net/ncurses/
#	https://invisible-mirror.net/archives/ncurses/
#	https://ftp.gnu.org/gnu/ncurses/
#
# Patches for ncurses 6.3 can be found at
# 	ftp://ftp.invisible-island.net/ncurses/6.3
#	https://invisible-mirror.net/archives/ncurses/6.3
#
# ------------------------------------------------------------------------------
# ftp://ftp.invisible-island.net/ncurses/6.3/ncurses-6.3-20211219.patch.gz
# patch by Thomas E. Dickey <dickey@invisible-island.net>
# created  Mon Dec 20 00:46:47 UTC 2021
# ------------------------------------------------------------------------------
# NEWS                               |    7 +-
# VERSION                            |    2 
# dist.mk                            |    4 -
# package/debian-mingw/changelog     |    4 -
# package/debian-mingw64/changelog   |    4 -
# package/debian/changelog           |    4 -
# package/mingw-ncurses.nsi          |    4 -
# package/mingw-ncurses.spec         |    2 
# package/ncurses.spec               |    2 
# package/ncursest.spec              |    2 
# test/Makefile.in                   |   13 ++-
# test/combine.c                     |  117 ++++++++++++++++++++++++++++++++---
# test/mk-test.awk                   |   40 +++++++++--
# test/movewindow.c                  |   12 ---
# test/package/debian/rules          |   15 ++--
# test/package/ncurses-examples.spec |   27 ++++----
# test/popup_msg.c                   |    6 -
# test/programs                      |    4 -
# test/test.priv.h                   |   10 ++
# 19 files changed, 207 insertions(+), 72 deletions(-)
# ------------------------------------------------------------------------------
Index: NEWS
Prereq:  1.3755 
--- ncurses-6.3-20211211+/NEWS	2021-12-11 21:46:44.000000000 +0000
+++ ncurses-6.3-20211219/NEWS	2021-12-19 11:24:57.000000000 +0000
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3755 2021/12/11 21:46:44 tom Exp $
+-- $Id: NEWS,v 1.3759 2021/12/19 11:24:57 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,11 @@
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20211219
+	+ install ncurses-examples programs in libexecdir, adding a wrapper
+	  script to invoke those.
+	+ add help-screen and screen-dump to test/combine.c
+
 20211211
 	+ add test/combine.c, to demo/test combining characters.
 
Index: VERSION
--- ncurses-6.3-20211211+/VERSION	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/VERSION	2021-12-19 11:24:57.000000000 +0000
@@ -1 +1 @@
-5:0:10	6.3	20211211
+5:0:10	6.3	20211219
Index: dist.mk
Prereq:  1.1454 
--- ncurses-6.3-20211211+/dist.mk	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/dist.mk	2021-12-19 11:24:57.000000000 +0000
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1454 2021/12/11 13:00:34 tom Exp $
+# $Id: dist.mk,v 1.1456 2021/12/19 11:24:57 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 3
-NCURSES_PATCH = 20211211
+NCURSES_PATCH = 20211219
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
Index: package/debian-mingw/changelog
--- ncurses-6.3-20211211+/package/debian-mingw/changelog	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/package/debian-mingw/changelog	2021-12-19 11:24:57.000000000 +0000
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20211211) unstable; urgency=low
+ncurses6 (6.3+20211219) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 11 Dec 2021 08:00:34 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 19 Dec 2021 06:24:57 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
Index: package/debian-mingw64/changelog
--- ncurses-6.3-20211211+/package/debian-mingw64/changelog	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/package/debian-mingw64/changelog	2021-12-19 11:24:57.000000000 +0000
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20211211) unstable; urgency=low
+ncurses6 (6.3+20211219) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 11 Dec 2021 08:00:34 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 19 Dec 2021 06:24:57 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
Index: package/debian/changelog
--- ncurses-6.3-20211211+/package/debian/changelog	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/package/debian/changelog	2021-12-19 11:24:57.000000000 +0000
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20211211) unstable; urgency=low
+ncurses6 (6.3+20211219) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 11 Dec 2021 08:00:34 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 19 Dec 2021 06:24:57 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
Index: package/mingw-ncurses.nsi
Prereq:  1.496 
--- ncurses-6.3-20211211+/package/mingw-ncurses.nsi	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/package/mingw-ncurses.nsi	2021-12-19 11:24:57.000000000 +0000
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.496 2021/12/11 13:00:34 tom Exp $
+; $Id: mingw-ncurses.nsi,v 1.498 2021/12/19 11:24:57 tom Exp $
 
 ; TODO add examples
 ; TODO bump ABI to 6
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"
 !define VERSION_MINOR "3"
 !define VERSION_YYYY  "2021"
-!define VERSION_MMDD  "1211"
+!define VERSION_MMDD  "1219"
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
 
 !define MY_ABI   "5"
Index: package/mingw-ncurses.spec
--- ncurses-6.3-20211211+/package/mingw-ncurses.spec	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/package/mingw-ncurses.spec	2021-12-19 11:24:57.000000000 +0000
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.3
-Release: 20211211
+Release: 20211219
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
Index: package/ncurses.spec
--- ncurses-6.3-20211211+/package/ncurses.spec	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/package/ncurses.spec	2021-12-19 11:24:57.000000000 +0000
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.3
-Release: 20211211
+Release: 20211219
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
Index: package/ncursest.spec
--- ncurses-6.3-20211211+/package/ncursest.spec	2021-12-11 13:00:34.000000000 +0000
+++ ncurses-6.3-20211219/package/ncursest.spec	2021-12-19 11:24:57.000000000 +0000
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.3
-Release: 20211211
+Release: 20211219
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
Index: test/Makefile.in
Prereq:  1.129 
--- ncurses-6.3-20211211+/test/Makefile.in	2021-07-03 15:45:33.000000000 +0000
+++ ncurses-6.3-20211219/test/Makefile.in	2021-12-18 23:00:28.000000000 +0000
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.129 2021/07/03 15:45:33 tom Exp $
+# $Id: Makefile.in,v 1.130 2021/12/18 23:00:28 tom Exp $
 ##############################################################################
 # Copyright 2020,2021 Thomas E. Dickey                                       #
 # Copyright 1998-2017,2018 Free Software Foundation, Inc.                    #
@@ -44,6 +44,8 @@
 x		= @EXEEXT@
 o		= .@OBJEXT@
 
+PACKAGE		= @PACKAGE@
+
 MODEL		= ../@DFT_OBJ_SUBDIR@
 top_srcdir	= @top_srcdir@
 srcdir		= @srcdir@
@@ -52,18 +54,19 @@
 datarootdir	= @datarootdir@
 
 bindir		= @bindir@
+libexecdir	= @libexecdir@
 libdir		= @libdir@
-includedir	= @includedir@
-includesubdir	= @includesubdir@
 datarootdir	= @datarootdir@
 datadir		= @datadir@
 
+real_bindir	= $(libexecdir)/$(PACKAGE)
+
 BINDIR		= $(DESTDIR)$(bindir)
+LIBEXECDIR	= $(DESTDIR)$(libexecdir)
 LIBDIR		= $(DESTDIR)$(libdir)
-INCLUDEDIR	= $(DESTDIR)$(includedir)$(includesubdir)
 DATADIR		= $(DESTDIR)$(datadir)
 
-PACKAGE		= @PACKAGE@
+REAL_BINDIR	= $(LIBEXECDIR)/$(PACKAGE)
 
 LIBTOOL		= @LIBTOOL@
 LIBTOOL_OPTS	= @LIBTOOL_OPTS@
Index: test/combine.c
Prereq:  1.7 
--- ncurses-6.3-20211211+/test/combine.c	2021-12-12 01:10:28.000000000 +0000
+++ ncurses-6.3-20211219/test/combine.c	2021-12-18 21:04:00.000000000 +0000
@@ -26,13 +26,16 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: combine.c,v 1.7 2021/12/12 01:10:28 tom Exp $
+ * $Id: combine.c,v 1.17 2021/12/18 21:04:00 tom Exp $
  */
 
 #include <test.priv.h>
 
 #if USE_WIDEC_SUPPORT
 
+#include <dump_window.h>
+#include <popup_msg.h>
+
 static int c_opt;
 static int r_opt;
 
@@ -45,6 +48,15 @@
     return value;
 }
 
+static int
+prev_char(int value)
+{
+    do {
+	--value;
+    } while (!iswprint((wint_t) value));
+    return value;
+}
+
 static void
 do_row(int row, int base_ch, int over_ch)
 {
@@ -62,18 +74,18 @@
 
 	    source[1] = 0;
 
-	    source[0] = base_ch;
+	    source[0] = (wchar_t) base_ch;
 	    setcchar(&target, source, attr, 0, NULL);
 	    add_wch(&target);
 
-	    source[0] = over_ch;
+	    source[0] = (wchar_t) over_ch;
 	    setcchar(&target, source, attr, 0, NULL);
 	    add_wch(&target);
 	} else {
 	    wchar_t data[3];
 
-	    data[0] = base_ch;
-	    data[1] = over_ch;
+	    data[0] = (wchar_t) base_ch;
+	    data[1] = (wchar_t) over_ch;
 	    data[2] = 0;
 	    if (reverse)
 		attr_on(A_REVERSE, NULL);
@@ -106,17 +118,68 @@
 }
 
 static void
-do_all(int over_it)
+do_all(int left_at, int over_it)
 {
     int row;
 
     for (row = 0; row < LINES; ++row) {
-	do_row(row, ' ', 0x300 + over_it);
+	do_row(row, left_at, 0x300 + over_it);
 	over_it = next_over(over_it);
     }
 }
 
 static void
+show_help(WINDOW *current)
+{
+    /* *INDENT-OFF* */
+    static struct {
+	int	key;
+	CONST_FMT char * msg;
+    } help[] = {
+	{ HELP_KEY_1,	"Show this screen" },
+	{ CTRL('L'),	"Repaint screen" },
+	{ '$',		"Scroll to end of combining-character range" },
+	{ '+',		"Scroll to next combining-character in range" },
+	{ KEY_DOWN,	"(same as \"+\")" },
+	{ '-',		"Scroll to previous combining-character in range" },
+	{ KEY_UP,	"(same as \"-\")" },
+	{ '0',		"Scroll to beginning of combining-character range" },
+	{ 'c',		"Toggle command-line option \"-c\"" },
+	{ 'd',		"Dump screen using scr_dump unless \"-l\" option used" },
+	{ 'h',		"Scroll test-data left one column" },
+	{ 'j',		"Scroll test-data down one row" },
+	{ 'k',		"Scroll test-data up one row" },
+	{ 'l',		"Scroll test-data right one column" },
+	{ 'q',		"Quit" },
+	{ ESCAPE,	"(same as \"q\")" },
+	{ QUIT,		"(same as \"q\")" },
+	{ 'r',		"Toggle command-line option \"-r\"" },
+    };
+    /* *INDENT-ON* */
+
+    char **msgs = typeCalloc(char *, SIZEOF(help) + 3);
+    size_t s;
+    int d = 0;
+
+    msgs[d++] = strdup("Test diacritic combining-characters range "
+		       "U+0300..U+036F");
+    msgs[d++] = strdup("");
+    for (s = 0; s < SIZEOF(help); ++s) {
+	char *name = strdup(keyname(help[s].key));
+	size_t need = (11 + strlen(name) + strlen(help[s].msg));
+	msgs[d] = typeMalloc(char, need);
+	_nc_SPRINTF(msgs[d], _nc_SLIMIT(need) "%-10s%s", name, help[s].msg);
+	free(name);
+	++d;
+    }
+    popup_msg2(current, msgs);
+    for (s = 0; msgs[s] != 0; ++s) {
+	free(msgs[s]);
+    }
+    free(msgs);
+}
+
+static void
 usage(void)
 {
     static const char *msg[] =
@@ -127,6 +190,7 @@
 	"",
 	"Options:",
 	" -c       use cchar_t data rather than wchar_t string",
+	" -l FILE  log window-dumps to this file",
 	" -r       draw even-numbered rows in reverse-video",
     };
     unsigned n;
@@ -140,14 +204,22 @@
 main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 {
     int n;
+    int left_at = ' ';
     int over_it = 0;
     bool done = FALSE;
+    bool log_option = FALSE;
+    const char *dump_log = "combine.log";
 
-    while ((n = getopt(argc, argv, "cr")) != -1) {
+    while ((n = getopt(argc, argv, "cl:r")) != -1) {
 	switch (n) {
 	case 'c':
 	    c_opt = TRUE;
 	    break;
+	case 'l':
+	    log_option = TRUE;
+	    if (!open_dump(optarg))
+		usage();
+	    break;
 	case 'r':
 	    r_opt = TRUE;
 	    break;
@@ -164,13 +236,38 @@
     keypad(stdscr, TRUE);
 
     do {
-	do_all(over_it);
+	do_all(left_at, over_it);
 	switch (getch()) {
+	case HELP_KEY_1:
+	    show_help(stdscr);
+	    break;
 	case 'q':
 	case QUIT:
 	case ESCAPE:
 	    done = TRUE;
 	    break;
+	case CTRL('L'):
+	    redrawwin(stdscr);
+	    break;
+	case 'd':
+	    if (log_option)
+		dump_window(stdscr);
+	    else
+		scr_dump(dump_log);
+	    break;
+	case 'h':
+	    if (left_at > ' ')
+		left_at = prev_char(left_at);
+	    break;
+	case 'l':
+	    left_at = next_char(left_at);
+	    break;
+	case 'c':
+	    c_opt = !c_opt;
+	    break;
+	case 'r':
+	    r_opt = !r_opt;
+	    break;
 	case KEY_HOME:
 	case '0':
 	    over_it = 0;
@@ -180,10 +277,12 @@
 	    over_it = LAST_OVER;
 	    break;
 	case KEY_UP:
+	case 'k':
 	case '-':
 	    over_it = prev_over(over_it);
 	    break;
 	case KEY_DOWN:
+	case 'j':
 	case '+':
 	    over_it = next_over(over_it);
 	    break;
Index: test/mk-test.awk
Prereq:  1.25 
--- ncurses-6.3-20211211+/test/mk-test.awk	2021-04-24 23:10:40.000000000 +0000
+++ ncurses-6.3-20211219/test/mk-test.awk	2021-12-19 16:54:36.000000000 +0000
@@ -1,4 +1,4 @@
-# $Id: mk-test.awk,v 1.25 2021/04/24 23:10:40 tom Exp $
+# $Id: mk-test.awk,v 1.30 2021/12/19 16:54:36 tom Exp $
 ##############################################################################
 # Copyright 2019-2020,2021 Thomas E. Dickey                                  #
 # Copyright 2006-2017,2018 Free Software Foundation, Inc.                    #
@@ -93,19 +93,38 @@
 	print	""
 	if (INSTALL == "yes") {
 		print	"# we might install the test-programs"
+		print	"$(PACKAGE) :"
+		print	"	@echo \"creating $(PACKAGE) script\""
+		print	"	@$(SHELL) -c '\\"
+		print	"	L=$(real_bindir);                            \\"
+		print	"	rm -f $@;                                    \\"
+		print	"	echo \"#!$(SHELL)\" >                     $@;\\"
+		print	"	echo \"PATH=\\\"$$L\\\":\\$$PATH\"      >>$@;\\"
+		print	"	echo \"export PATH\"                    >>$@;\\"
+		print	"	echo \"if test \\$$# != 0; then\"       >>$@;\\"
+		print	"	echo \"  exec \\\"\\$$@\\\"\"           >>$@;\\"
+		print	"	echo \"elif test -t 1; then\"           >>$@;\\"
+		print	"	echo \"  cd \\\"$$L\\\" || exit\"       >>$@;\\"
+		print	"	echo \"  ls -l | \\$${PAGER:-less}\"    >>$@;\\"
+		print	"	echo \"fi\"                             >>$@;\\"
+		print	"	echo \"echo \\\"usage: $@ [program]\\\"\" >>$@'"
+		print	""
 		print	"install \\"
-		print	"install.test: $(BINDIR) $(DATADIR) $(TESTS)"
+		print	"install.test: $(PACKAGE) $(BINDIR) $(REAL_BINDIR) $(DATADIR) $(TESTS)"
+
+		print	"	@echo \"installing $(PACKAGE) -> $(BINDIR)/\""
+		print	"	@$(INSTALL_SCRIPT) $(PACKAGE) $(BINDIR)"
 
 		print	"	@$(SHELL) -c 'for src in $(TESTS); do \\"
 		print	"	dst=`echo $$src | $(TRANSFORM)`; \\"
-		print	"	echo \"installing $$src -> $(BINDIR)/$$dst\"; \\"
-		print	"	$(INSTALL_PROG) $$src $(BINDIR)/$$dst; \\"
+		print	"	echo \"installing $$src -> $(REAL_BINDIR)/$$dst\"; \\"
+		print	"	$(INSTALL_PROG) $$src $(REAL_BINDIR)/$$dst; \\"
 		print	"	done'"
 
 		print	"	@$(SHELL) -c 'for src in $(SCRIPTS); do \\"
 		print	"	dst=`echo $$src | sed -e 's,^.*/,,' | $(TRANSFORM)`; \\"
-		print	"	echo \"installing $$src -> $(BINDIR)/$$dst\"; \\"
-		print	"	$(INSTALL_SCRIPT) $$src $(BINDIR)/$$dst; \\"
+		print	"	echo \"installing $$src -> $(REAL_BINDIR)/$$dst\"; \\"
+		print	"	$(INSTALL_SCRIPT) $$src $(REAL_BINDIR)/$$dst; \\"
 		print	"	done'"
 
 		print	"	@$(SHELL) -c 'for src in $(DATAFILES); do \\"
@@ -117,14 +136,16 @@
 		print	"uninstall \\"
 		print	"uninstall.test:"
 
+		print	"	-rm -f $(BINDIR)/$(PACKAGE)"
+
 		print	"	@$(SHELL) -c 'for src in $(TESTS); do \\"
 		print	"	dst=`echo $$src | $(TRANSFORM)`; \\"
-		print	"	rm -f $(BINDIR)/$$dst; \\"
+		print	"	rm -f $(REAL_BINDIR)/$$dst; \\"
 		print	"	done'"
 
 		print	"	@$(SHELL) -c 'for src in $(SCRIPTS); do \\"
 		print	"	dst=`echo $$src | sed -e 's,^.*/,,' | $(TRANSFORM)`; \\"
-		print	"	rm -f $(BINDIR)/$$dst; \\"
+		print	"	rm -f $(REAL_BINDIR)/$$dst; \\"
 		print	"	done'"
 
 		print	"	@$(SHELL) -c 'for src in $(DATAFILES); do \\"
@@ -144,6 +165,7 @@
 	print	"clean :: mostlyclean"
 	print	"	-$(SHELL) -c \"if test -n '$x' ; then $(MAKE) clean x=''; fi\""
 	print	"	-rm -rf *$o screendump *.lis $(TESTS) .libs *.dSYM"
+	print	"	-rm -f $(PACKAGE)"
 	print	""
 	print	"distclean :: clean"
 	print	"	-rm -f Makefile ncurses_cfg.h config.status config.log"
@@ -152,7 +174,7 @@
 	print	""
 	print	"lint:"
 	print	"	$(SHELL) -c 'for N in $(TESTS); do echo LINT:$$N; $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/$$N.c $(LINT_LIBS); done'"
-	print	"$(BINDIR) $(DATADIR) :"
+	print	"$(BINDIR) $(REAL_BINDIR) $(DATADIR) :"
 	print	"	mkdir -p $@"
 
 
Index: test/movewindow.c
Prereq:  1.51 
--- ncurses-6.3-20211211+/test/movewindow.c	2020-02-02 23:34:34.000000000 +0000
+++ ncurses-6.3-20211219/test/movewindow.c	2021-12-18 18:57:55.000000000 +0000
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2006-2013,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: movewindow.c,v 1.51 2020/02/02 23:34:34 tom Exp $
+ * $Id: movewindow.c,v 1.52 2021/12/18 18:57:55 tom Exp $
  *
  * Demonstrate move functions for windows and derived windows from the curses
  * library.
@@ -55,14 +55,6 @@
 #undef derwin
 #endif
 
-#if defined(NCURSES_CONST)
-#define CONST_FMT NCURSES_CONST
-#elif defined(PDCURSES)
-#define CONST_FMT const
-#else
-#define CONST_FMT		/* nothing */
-#endif
-
 #undef LINE_MAX
 
 #define LINE_MIN	2
Index: test/package/debian/rules
--- ncurses-6.3-20211211+/test/package/debian/rules	2017-08-11 14:52:01.000000000 +0000
+++ ncurses-6.3-20211219/test/package/debian/rules	2021-12-19 00:23:00.000000000 +0000
@@ -74,8 +74,7 @@
 	mkdir -p t/ncurses6
 
 	cd t/ncurses6; $(configure) \
-		--bindir=\$${prefix}/bin/$(NCURSES_PKG) \
-		--datadir=\$${prefix}/share/$(NCURSES_PKG) \
+		--datadir=\$${datarootdir}/$(NCURSES_PKG) \
 		--with-screen=ncursesw6
 
 	touch $@
@@ -87,8 +86,7 @@
 	mkdir -p t/ncursest6
 
 	cd t/ncursest6; $(configure) \
-		--bindir=\$${prefix}/bin/$(NCURSEST_PKG) \
-		--datadir=\$${prefix}/share/$(NCURSEST_PKG) \
+		--datadir=\$${datarootdir}/$(NCURSEST_PKG) \
 		--with-screen=ncursestw6
 
 	touch $@
@@ -113,7 +111,9 @@
 	dh_installdirs $(verbose)
 	dh_prep        $(verbose) -p$(NCURSES_PKG)
 
-	$(MAKE) -C t/ncurses6 install DESTDIR=$(CURDIR)/debian/$(NCURSES_PKG)
+	$(MAKE) -C t/ncurses6 install \
+		PACKAGE=$(NCURSES_PKG) \
+		DESTDIR=$(CURDIR)/debian/$(NCURSES_PKG)
 
 	touch $@
 
@@ -123,7 +123,9 @@
 	dh_installdirs $(verbose)
 	dh_prep        $(verbose) -p$(NCURSEST_PKG)
 
-	$(MAKE) -C t/ncursest6 install DESTDIR=$(CURDIR)/debian/$(NCURSEST_PKG)
+	$(MAKE) -C t/ncursest6 install \
+		PACKAGE=$(NCURSEST_PKG) \
+		DESTDIR=$(CURDIR)/debian/$(NCURSEST_PKG)
 
 	touch $@
 
@@ -151,6 +153,7 @@
 	rm -f $(PACKAGES.arch:%=install-%-stamp)
 	dh_testdir
 	dh_testroot
+	dh_installdocs       $(verbose) $(PACKAGES.arch:%=-p%)
 	dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%)  NEWS
 	dh_strip             $(verbose) $(PACKAGES.arch:%=-p%)
 	dh_compress          $(verbose) $(PACKAGES.arch:%=-p%)
Index: test/package/ncurses-examples.spec
Prereq:  1.16 
--- ncurses-6.3-20211211+/test/package/ncurses-examples.spec	2019-11-23 21:11:34.000000000 +0000
+++ ncurses-6.3-20211219/test/package/ncurses-examples.spec	2021-12-19 00:13:46.000000000 +0000
@@ -3,13 +3,13 @@
 %global AltProgram ncursest-examples
 %global AppVersion MAJOR.MINOR
 %global AppRelease YYYYMMDD
-# $Id: ncurses-examples.spec,v 1.16 2019/11/23 21:11:34 tom Exp $
+# $Id: ncurses-examples.spec,v 1.21 2021/12/19 00:13:46 tom Exp $
 Name: %{AppProgram}
 Version: %{AppVersion}
 Release: %{AppRelease}
 License: MIT
 Group: Applications/Development
-URL: ftp://ftp.invisible-island.net/%{AppProgram}
+URL: ftp://ftp.invisible-island.net/pub/%{AppProgram}
 Source0: %{AppProgram}-%{AppRelease}.tgz
 Packager: Thomas Dickey <dickey@invisible-island.net>
 
@@ -50,8 +50,7 @@
 %configure \
 	--target %{_target_platform} \
 	--prefix=%{_prefix} \
-	--bindir=%{_bindir}/%{AppProgram} \
-	--datadir=%{_datadir}/%{AppProgram} \
+	--datadir=%{_datarootdir}/%{AppProgram} \
 	--with-screen=ncursesw6dev \
 	--disable-rpath-hack
 
@@ -66,8 +65,7 @@
 %configure \
 	--target %{_target_platform} \
 	--prefix=%{_prefix} \
-	--bindir=%{_bindir}/%{AltProgram} \
-	--datadir=%{_datadir}/%{AltProgram} \
+	--datadir=%{_datarootdir}/%{AltProgram} \
 	--with-screen=ncursestw6dev \
 	--disable-rpath-hack
 
@@ -78,11 +76,11 @@
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
 
 pushd BUILD-%{AppProgram}
-make install DESTDIR=$RPM_BUILD_ROOT
+make install PACKAGE=%{AppProgram} DESTDIR=$RPM_BUILD_ROOT
 popd
 
 pushd BUILD-%{AltProgram}
-make install DESTDIR=$RPM_BUILD_ROOT
+make install PACKAGE=%{AltProgram} DESTDIR=$RPM_BUILD_ROOT
 popd
 
 %clean
@@ -95,17 +93,22 @@
 
 %files -n %{AppProgram}
 %defattr(-,root,root)
-%{_bindir}/%{AppProgram}/*
-%{_datadir}/%{AppProgram}/*
+%{_bindir}/%{AppProgram}
+%{_libexecdir}/%{AppProgram}/*
+%{_datarootdir}/%{AppProgram}/*
 
 %files -n %{AltProgram}
 %defattr(-,root,root)
-%{_bindir}/%{AltProgram}/*
-%{_datadir}/%{AltProgram}/*
+%{_bindir}/%{AltProgram}
+%{_libexecdir}/%{AltProgram}/*
+%{_datarootdir}/%{AltProgram}/*
 
 %changelog
 # each patch should add its ChangeLog entries here
 
+* Sat Dec 18 2021 Thomas Dickey
+- use libexecdir for programs rather than subdir of bindir
+
 * Sat Nov 16 2019 Thomas Dickey
 - modify clean-rule to work around Fedora NFS bugs.
 
Index: test/popup_msg.c
Prereq:  1.10 
--- ncurses-6.3-20211211+/test/popup_msg.c	2020-02-02 23:34:34.000000000 +0000
+++ ncurses-6.3-20211219/test/popup_msg.c	2021-12-18 21:19:19.000000000 +0000
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2017 Free Software Foundation, Inc.                            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: popup_msg.c,v 1.10 2020/02/02 23:34:34 tom Exp $
+ * $Id: popup_msg.c,v 1.11 2021/12/18 21:19:19 tom Exp $
  *
  * Show a multi-line message in a window which may extend beyond the screen.
  *
@@ -87,7 +87,7 @@
 
     if ((help = newwin(high, wide, y0, x0)) == 0)
 	return;
-    if ((data = newpad(length + 1, width)) == 0) {
+    if ((data = newpad(length + 1, width + 1)) == 0) {
 	delwin(help);
 	return;
     }
Index: test/programs
Prereq:  1.50 
--- ncurses-6.3-20211211+/test/programs	2021-12-11 17:46:18.000000000 +0000
+++ ncurses-6.3-20211219/test/programs	2021-12-18 18:46:56.000000000 +0000
@@ -1,4 +1,4 @@
-# $Id: programs,v 1.50 2021/12/11 17:46:18 tom Exp $
+# $Id: programs,v 1.51 2021/12/18 18:46:56 tom Exp $
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 2006-2016,2017 Free Software Foundation, Inc.                    #
@@ -40,7 +40,7 @@
 clip_printw	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	clip_printw popup_msg
 color_content	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	color_content
 color_set	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	color_set
-combine		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	combine popup_msg
+combine		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	combine dump_window popup_msg
 demo_altkeys	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	demo_altkeys
 demo_defkey	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	demo_defkey
 demo_forms	$(LDFLAGS_DEFAULT)	$(LOCAL_LIBS)	demo_forms edit_field popup_msg
Index: test/test.priv.h
Prereq:  1.197 
--- ncurses-6.3-20211211+/test/test.priv.h	2021-04-25 00:00:24.000000000 +0000
+++ ncurses-6.3-20211219/test/test.priv.h	2021-12-18 18:55:10.000000000 +0000
@@ -30,7 +30,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.197 2021/04/25 00:00:24 tom Exp $ */
+/* $Id: test.priv.h,v 1.198 2021/12/18 18:55:10 tom Exp $ */
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
@@ -1148,6 +1148,14 @@
 #define CONST_MENUS		/* nothing */
 #endif
 
+#if defined(NCURSES_CONST)
+#define CONST_FMT NCURSES_CONST
+#elif defined(PDCURSES)
+#define CONST_FMT const
+#else
+#define CONST_FMT		/* nothing */
+#endif
+
 /*
  * Simplify setting up demo of threading with these macros.
  */