From a994b0934cea446511802e09a48f484a60ceab330f4d3b0352326aa0d7880913 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 16 Mar 2021 13:58:41 +0000 Subject: [PATCH] Update to ncurses-6.2 patch 20210313, new sub package for ncurses-tests OBS-URL: https://build.opensuse.org/package/show/Base:System/ncurses?expand=0&rev=535 --- cursescheck | 156 ++++++++++++++++++++++++++++++++++++ ncurses-6.2-patches.tar.bz2 | 4 +- ncurses.changes | 17 ++++ ncurses.spec | 78 ++++++++++++------ 4 files changed, 228 insertions(+), 27 deletions(-) create mode 100644 cursescheck diff --git a/cursescheck b/cursescheck new file mode 100644 index 0000000..53cc942 --- /dev/null +++ b/cursescheck @@ -0,0 +1,156 @@ +#!/bin/bash +# Test ACS Line Graphics and REP capability of a terminal line +# Author: Werner Fink + +typeset -i rep=0 line=0 +for s in 0 1 2 +do + test -c /proc/$$/fd/$s || { echo "Missing /proc/$$/fd/$s" 1>&2; exit 1; } +done +for d in null tty +do + test -c /dev/$d || { echo "Missing /dev/$d" 1>&2; exit 1; } +done +for d in pts fd +do + test -d /dev/$d || { echo "Missing /dev/$d/" 1>&2; exit 1; } +done +for p in tput infocmp fold tty grep od +do + type -p $p 1> /dev/null 2>&1 || { echo "Missing $p in path" 1>&2; exit 1; } +done + +typeset -r tty=$(tty) || { echo "Not on a terminal line" 1>&2; exit 1; } +typeset -i width=$(tput cols) || { echo "No terminal size" 1>&2; exit 1; } +typeset -i height=$(tput lines) || { echo "No terminal size" 1>&2; exit 1; } + +# +# There are terminal type which uses non printable characters for +# Line Graphic. Therefore store them as numbers or sequences within +# arrays used later on. +# +typeset -i c +typeset -a tmp="($(tput acsc | od -A none -tx1))" acsc acsn +for ((c=0;c<${#tmp[@]};c+=2)) +do + acsc[0x${tmp[c]}]="0x${tmp[c+1]}" + acsn[0x${tmp[c]}]=\\x${tmp[c+1]} +done +unset tmp c + +# +# Init terminal +# +tput init || { echo "Not a terminal" 1>&2; exit 1; } + +# +# Restore screen at exit +# +trap 'tput cvvis; tput rmcup' EXIT HUP INT TERM + +# +# Save screen, make curse invisible, and goto upper left +# +tput smcup +tput civis +tput cup 0 0 +tput ed + +echo Checking for Line Graphics on $tty with TERM=$TERM +let line++ +if ((${#acsc[@]} > 0)) +then + echo Terminal TERM=$TERM has ASC Line Graphics, check them. + let line++ + tput cup $((height/2)) 0 + tput -S <<-! + enacs + smacs + ! + echo -ne ${acsn[0x6c]} + for ((c=0;c<20;c++)); do echo -ne ${acsn[0x71]}; done + echo -ne ${acsn[0x6b]} + tput cup $((height/2+1)) 0 + echo -ne ${acsn[0x78]} + tput hpa 21 + echo -ne ${acsn[0x78]} + tput cup $((height/2+2)) 0 + echo -ne ${acsn[0x78]} + tput hpa 21 + echo -ne ${acsn[0x78]} + tput cup $((height/2+3)) 0 + echo -ne ${acsn[0x78]} + tput hpa 21 + echo -ne ${acsn[0x78]} + tput cup $((height/2+4)) 0 + echo -ne ${acsn[0x6d]} + for ((c=0;c<20;c++)); do echo -ne ${acsn[0x71]}; done + echo -ne ${acsn[0x6a]} + tput -S <<-! + rmacs + ! + tput cup $line 0 + tput cvvis + echo -n "OK> " + read -t 5 yesno +else + echo Terminal TERM=$TERM has no ASC Line Graphics. Done + exit 0 +fi + +# +# Could use clear +# +tput -S <<-! + cup 0 0 + ed + ! +let line=0 +if test -n "$(infocmp -T $TERM -1 | grep rep=)" +then + echo Found rep capability in terminfo database for TERM=$TERM + let rep++ + let line++ +else + echo No rep capability given in terminfo database for TERM=$TERM + echo -n "OK> " + read -t 5 yesno + exit 0 +fi +if ((rep > 0)) +then + echo Testing rep capability of TERM=$TERM + let line++ + tput -S <<-! + civis + enacs + smacs + bold + cup $((height/2)) 0 + rep ${acsc[0x6c]} 0 + rep ${acsc[0x71]} 20 + rep ${acsc[0x6b]} 0 + cup $((height/2+1)) 0 + rep ${acsc[0x78]} 0 + hpa 21 + rep ${acsc[0x78]} 0 + cup $((height/2+2)) 0 + rep ${acsc[0x78]} 0 + hpa 21 + rep ${acsc[0x78]} 0 + cup $((height/2+3)) 0 + rep ${acsc[0x78]} 0 + hpa 21 + rep ${acsc[0x78]} 0 + cup $((height/2+4)) 0 + rep ${acsc[0x6d]} 0 + rep ${acsc[0x71]} 20 + rep ${acsc[0x6a]} 0 + sgr0 + rmacs + cvvis + ! + tput cup $line 0 + echo -n "OK> " + read -t 5 yesno +fi diff --git a/ncurses-6.2-patches.tar.bz2 b/ncurses-6.2-patches.tar.bz2 index eab1840..3c6c228 100644 --- a/ncurses-6.2-patches.tar.bz2 +++ b/ncurses-6.2-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a3b21ac4bdea232b8833d71bf9b8ff5a47474733404463f655a54d789c01437 -size 1965955 +oid sha256:1daabf054484e9eba9c115243d0c75f72fc52ce43ea06c58cefa3111503807ad +size 1970432 diff --git a/ncurses.changes b/ncurses.changes index c55c22c..69c85a8 100644 --- a/ncurses.changes +++ b/ncurses.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Tue Mar 16 12:20:59 UTC 2021 - Dr. Werner Fink + +- New package ncurses-tests which includes examples and tests +- Include bash script cursescheck for ASC and REP capabilities + +------------------------------------------------------------------- +Mon Mar 15 07:36:19 UTC 2021 - Dr. Werner Fink + +- Add ncurses patch 20210313 + + improve configure CF_LD_SEARCHPATH macro used for ncurses*-config and + ".pc" files, from dialog changes. + + reduce dependency of math-library in test programs. + + minor fixes for test_tparm.c (cf: 20210306) + + mention "ncurses" prefix in curses_version() manpage (report by + Michal Bielinski). + ------------------------------------------------------------------- Tue Mar 9 11:16:31 UTC 2021 - Dr. Werner Fink diff --git a/ncurses.spec b/ncurses.spec index ca9fd11..ccfbdfe 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -84,6 +84,7 @@ Source4: ncurses-rpmlintrc Source5: ftp://ftp.invisible-island.net/pub/ncurses/current/tack-1.09-20200220.tgz Source6: edit.sed Source7: baselibs.conf +Source8: cursescheck Patch0: ncurses-6.2.dif Patch1: ncurses-5.9-ibm327x.dif Patch2: ncurses-5.7-tack.dif @@ -120,6 +121,14 @@ tset -- terminal-initialization utility reset -- terminal initialization utility +%package -n ncurses-tests +Summary: Tools using the new curses libraries +License: MIT +Group: System/Base + +%description -n ncurses-tests +The ncurses based test programs + %package -n terminfo-base Summary: A terminal descriptions database License: MIT @@ -671,16 +680,17 @@ mv tack-* tack CFLAGS="$CFLAGS -I%{root}%{_incdir}/ncursesw/ -I%{root}%{_incdir}/" \ LDFLAGS="$LDFLAGS -Wl,-rpath-link=%{root}%{_libdir} -L%{root}%{_libdir}" \ LIBS="$LDFLAGS" \ - ./configure --with-ncursesw --enable-widec --prefix=$PWD + ./configure --with-ncursesw --with-screen=ncursesw --enable-widec --prefix=%{_prefix} --bindir=%{_libexecdir}/ncurses --datadir=%{_datadir}/ncurses + LD_LIBRARY_PATH=%{root}%{_libdir} \ %if %{with usepcre2} make %{?_smp_mflags} TEST_ARGS='-lformw -lmenuw -lpanelw -lncursesw -lticw -l%{soname_tinfo} -Wl,--as-needed' TEST_LIBS='-lutil -lpthread -lpcre2-posix -lpcre2-8' - make install TEST_ARGS='-lformw -lmenuw -lpanelw -lncursesw -lticw -l%{soname_tinfo} -Wl,--as-needed' TEST_LIBS='-lutil -lpthread -lpcre2-posix -lpcre2-8' + make install DESTDIR=${PWD} TEST_ARGS='-lformw -lmenuw -lpanelw -lncursesw -lticw -l%{soname_tinfo} -Wl,--as-needed' TEST_LIBS='-lutil -lpthread -lpcre2-posix -lpcre2-8' %else make %{?_smp_mflags} TEST_ARGS='-lformw -lmenuw -lpanelw -lncursesw -lticw -l%{soname_tinfo} -Wl,--as-needed' TEST_LIBS='-lutil -lpthread' - make install TEST_ARGS='-lformw -lmenuw -lpanelw -lncursesw -lticw -l%{soname_tinfo} -Wl,--as-needed' TEST_LIBS='-lutil -lpthread' + make install DESTDIR=${PWD} TEST_ARGS='-lformw -lmenuw -lpanelw -lncursesw -lticw -l%{soname_tinfo} -Wl,--as-needed' TEST_LIBS='-lutil -lpthread' %endif - mv bin binw + mv usr usr.back make distclean popd %endif @@ -814,15 +824,16 @@ includedir5=%{_incdir}/ncurses5' "$pc" CFLAGS="$CFLAGS -I%{root}%{_incdir}ncurses/ -I%{root}%{_incdir}/" \ LDFLAGS="$LDFLAGS -Wl,-rpath-link=%{root}%{_libdir} -L%{root}%{_libdir}" \ LIBS="$LDFLAGS" \ - ./configure --with-ncurses --disable-widec --prefix=$PWD + ./configure --with-ncurses --with-screen=ncurses --disable-widec --prefix=%{_prefix} --bindir=%{_libexecdir}/ncurses --datadir=%{_datadir}/ncurses LD_LIBRARY_PATH=%{root}%{_libdir} \ %if %{with usepcre2} make %{?_smp_mflags} TEST_ARGS='-lform -lmenu -lpanel -lncurses -ltic -ltinfo -Wl,--as-needed' TEST_LIBS='-lutil -lpthread -lpcre2-posix -lpcre2-8' - make install TEST_ARGS='-lform -lmenu -lpanel -lncurses -ltic -ltinfo -Wl,--as-needed' TEST_LIBS='-lutil -lpthread -lpcre2-posix -lpcre2-8' + make install DESTDIR=${PWD} TEST_ARGS='-lform -lmenu -lpanel -lncurses -ltic -ltinfo -Wl,--as-needed' TEST_LIBS='-lutil -lpthread -lpcre2-posix -lpcre2-8' %else make %{?_smp_mflags} TEST_ARGS='-lform -lmenu -lpanel -lncurses -ltic -ltinfo -Wl,--as-needed' TEST_LIBS='-lutil -lpthread' - make install TEST_ARGS='-lform -lmenu -lpanel -lncurses -ltic -ltinfo -Wl,--as-needed' TEST_LIBS='-lutil -lpthread' + make install DESTDIR=${PWD} TEST_ARGS='-lform -lmenu -lpanel -lncurses -ltic -ltinfo -Wl,--as-needed' TEST_LIBS='-lutil -lpthread' %endif + rm -rf usr/ make distclean popd %endif @@ -1119,6 +1130,15 @@ includedir5=%{_incdir}/ncurses5' "$pc" # cp -p pc/*.pc %{buildroot}%{_libdir}/pkgconfig/ +# +# Install test binaries and, if exists, the manual pages +# +pushd test + mv usr.back usr + (cd usr/; tar -cpSf - .) | tar -xpsSf - -C %{buildroot}%{_prefix} + install -m 0755 %{S:8} %{buildroot}%{_libexecdir}/ncurses/ +popd + %if 0%{?_crossbuild} # No test here %else @@ -1134,7 +1154,7 @@ pushd test expect -d <<-'EOF' set env(TERM) xterm set timeout 20 - spawn -noecho "binw/newdemo" + spawn -noecho ".%{_libexecdir}/ncurses/newdemo" send -- "x" sleep 5 send -- "x" @@ -1147,7 +1167,7 @@ pushd test expect -d <<-'EOF' set env(TERM) xterm set timeout 20 - spawn -noecho "bin/newdemo" + spawn -noecho ".%{_libexecdir}/ncurses/newdemo" send -- "x" sleep 5 send -- "x" @@ -1195,16 +1215,24 @@ popd %{_bindir}/toe %{_bindir}/tput %{_bindir}/tset -%doc %{_mandir}/man1/clear.1.gz -%doc %{_mandir}/man1/infocmp.1.gz -%doc %{_mandir}/man1/reset.1.gz -%doc %{_mandir}/man1/tabs.1.gz -%doc %{_mandir}/man1/toe.1.gz -%doc %{_mandir}/man1/tput.1.gz -%doc %{_mandir}/man1/tset.1.gz -%doc %{_mandir}/man5/*.gz +%doc %{_mandir}/man1/clear.1%{ext_man} +%doc %{_mandir}/man1/infocmp.1%{ext_man} +%doc %{_mandir}/man1/reset.1%{ext_man} +%doc %{_mandir}/man1/tabs.1%{ext_man} +%doc %{_mandir}/man1/toe.1%{ext_man} +%doc %{_mandir}/man1/tput.1%{ext_man} +%doc %{_mandir}/man1/tset.1%{ext_man} +%doc %{_mandir}/man5/*%{ext_man} %doc AUTHORS +%files -n ncurses-tests +%defattr(-,root,root) +%dir %{_libexecdir}/ncurses/ +%{_libexecdir}/ncurses/* +%dir %{_datadir}/ncurses/ +%{_datadir}/ncurses/* +#%doc %{_mandir}/man6/*%{ext_man} + %files -n libncurses5 %defattr(-,root,root) %{_libdir}/lib*.so.5* @@ -1228,12 +1256,12 @@ popd %{_incdir}/ncursesw/*.h %{_libdir}/lib*.so %{_libdir}/pkgconfig/*[clmosuw\+].pc -%doc %{_mandir}/man1/ncurses*6-config.1.gz -%doc %{_mandir}/man1/captoinfo.1.gz -%doc %{_mandir}/man1/infotocap.1.gz -%doc %{_mandir}/man1/tic.1.gz -%doc %{_mandir}/man3/*.gz -%doc %{_mandir}/man7/*.gz +%doc %{_mandir}/man1/ncurses*6-config.1%{ext_man} +%doc %{_mandir}/man1/captoinfo.1%{ext_man} +%doc %{_mandir}/man1/infotocap.1%{ext_man} +%doc %{_mandir}/man1/tic.1%{ext_man} +%doc %{_mandir}/man3/*%{ext_man} +%doc %{_mandir}/man7/*%{ext_man} %files -n ncurses-devel-static %{_libdir}/lib*.a @@ -1250,7 +1278,7 @@ popd %dir %{_libdir}/ncurses5/ %{_libdir}/ncurses5/lib*.so %{_libdir}/pkgconfig/*5.pc -%doc %{_mandir}/man1/ncurses*5-config.1.gz +%doc %{_mandir}/man1/ncurses*5-config.1%{ext_man} %files -n ncurses5-devel-static %{_libdir}/ncurses5/lib*.a @@ -1258,7 +1286,7 @@ popd %files -n tack %defattr(-,root,root) %{_bindir}/tack -%doc %{_mandir}/man1/tack.1.gz +%doc %{_mandir}/man1/tack.1%{ext_man} %files -f extension.list -n terminfo %defattr(-,root,root)