diff --git a/less-394-time.patch b/less-394-time.patch deleted file mode 100644 index 85f52b3476b7267516ad49c21f6749f3b92bd9fd..0000000000000000000000000000000000000000 --- a/less-394-time.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- less-394/Makefile.in.time 2005-09-14 04:21:38.000000000 +0200 -+++ less-394/Makefile.in 2007-02-07 13:21:24.000000000 +0100 -@@ -6,7 +6,7 @@ - VPATH = @srcdir@ - - CC = @CC@ --INSTALL = @INSTALL@ -+INSTALL = @INSTALL@ -p - INSTALL_PROGRAM = @INSTALL_PROGRAM@ - INSTALL_DATA = @INSTALL_DATA@ - diff --git a/less-429-more.patch b/less-429-more.patch new file mode 100644 index 0000000000000000000000000000000000000000..21155d43e2d628205fc2e70dc873e05d9c92e512 --- /dev/null +++ b/less-429-more.patch @@ -0,0 +1,13 @@ +--- option.c ++++ option.c +@@ -134,6 +134,10 @@ + s--; + optc = 'z'; + break; ++ case 'l': ++ if (less_is_more) ++ continue; ++ break; + case 'n': + if (less_is_more) + optc = 'z'; diff --git a/less-429-shell.patch b/less-429-shell.patch new file mode 100644 index 0000000000000000000000000000000000000000..d78f950ec0d47dd8eadfbcfafd15a12d4954fcc5 --- /dev/null +++ b/less-429-shell.patch @@ -0,0 +1,64 @@ +diff -ru a/filename.c b/filename.c +--- a/filename.c 2020-05-11 23:36:17.000000000 +0200 ++++ b/filename.c 2020-05-12 14:01:23.624217811 +0200 +@@ -574,7 +574,7 @@ + #if HAVE_SHELL + char *shell; + +- shell = lgetenv("SHELL"); ++ shell = lgetenv("LESSSHELL"); + if (!isnullenv(shell)) + { + char *scmd; +diff -ru a/less.hlp b/less.hlp +--- a/less.hlp 2020-05-11 23:36:21.000000000 +0200 ++++ b/less.hlp 2020-05-12 14:00:58.680162327 +0200 +@@ -101,7 +101,7 @@ + ___<_n_a_m_e_> Display the setting of an option, by name. + +_c_m_d Execute the less cmd each time a new file is examined. + +- !_c_o_m_m_a_n_d Execute the shell command with $SHELL. ++ !_c_o_m_m_a_n_d Execute the shell command with $LESSSHELL. + |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. + s _f_i_l_e Save input to a file. + v Edit the current file with $VISUAL or $EDITOR. +diff -ru a/less.nro b/less.nro +--- a/less.nro 2020-05-11 23:36:21.000000000 +0200 ++++ b/less.nro 2020-05-12 14:02:02.728304787 +0200 +@@ -420,7 +420,7 @@ + A pound sign (#) is replaced by the name of the previously examined file. + "!!" repeats the last shell command. + "!" with no shell command simply invokes a shell. +-On Unix systems, the shell is taken from the environment variable SHELL, ++On Unix systems, the shell is taken from the environment variable LESSSHELL, + or defaults to "sh". + On MS-DOS and OS/2 systems, the shell is the normal command processor. + .IP "| shell-command" +@@ -1793,7 +1793,7 @@ + .IP PATH + User's search path (used to find a lesskey file + on MS-DOS and OS/2 systems). +-.IP SHELL ++.IP LESSSHELL + The shell used to execute the !\& command, as well as to expand filenames. + .IP TERM + The type of terminal on which +diff -ru a/lsystem.c b/lsystem.c +--- a/lsystem.c 2020-05-11 23:36:17.000000000 +0200 ++++ b/lsystem.c 2020-05-12 14:02:25.352355117 +0200 +@@ -127,13 +127,13 @@ + + /* + * Pass the command to the system to be executed. +- * If we have a SHELL environment variable, use ++ * If we have a LESSSHELL environment variable, use + * <$SHELL -c "command"> instead of just . + * If the command is empty, just invoke a shell. + */ + #if HAVE_SHELL + p = NULL; +- if ((shell = lgetenv("SHELL")) != NULL && *shell != '\0') ++ if ((shell = lgetenv("LESSSHELL")) != NULL && *shell != '\0') + { + if (*cmd == '\0') + p = save(shell); diff --git a/less-475-fsync.patch b/less-475-fsync.patch deleted file mode 100644 index 4371461c899f68e196d5dfa5cdefbda27b57d69f..0000000000000000000000000000000000000000 --- a/less-475-fsync.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -ur less-418.orig/configure.ac less-418/configure.ac ---- less-418.orig/configure.ac 2008-12-22 07:10:44.000000000 -0500 -+++ less-418/configure.ac 2008-12-22 07:28:58.000000000 -0500 -@@ -203,6 +203,8 @@ - [Define HAVE_TIME_T if your system supports the "time_t" type.]) - AH_TEMPLATE([HAVE_STRERROR], - [Define HAVE_STRERROR if you have the strerror() function.]) -+AH_TEMPLATE([HAVE_FSYNC], -+ [Define HAVE_FSYNC if fsync() on a tty works.]) - AH_TEMPLATE([HAVE_FILENO], - [Define HAVE_FILENO if you have the fileno() macro.]) - AH_TEMPLATE([HAVE_ERRNO], -@@ -251,7 +253,7 @@ - - # Checks for library functions. - AC_TYPE_SIGNAL --AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system ttyname usleep]) -+AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod realpath]) - - # AC_CHECK_FUNCS may not work for inline functions, so test these separately. - AC_MSG_CHECKING(for memcpy) -@@ -298,6 +300,16 @@ - #endif], [static char *x; x = strerror(0);], - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)]) - -+AC_MSG_CHECKING(for fsync) -+AC_TRY_RUN([ -+#include -+#include -+int main(void) -+{ -+ int fd = open("/dev/tty", O_RDWR); -+ return fsync(fd); -+}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)]) -+ - AC_MSG_CHECKING(for sys_errlist) - AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;], - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)]) diff --git a/less-608.sig b/less-608.sig new file mode 100644 index 0000000000000000000000000000000000000000..e17fa3b71fd7ed3565c70ee6d40555401122a23c Binary files /dev/null and b/less-608.sig differ diff --git a/less-608.tar.gz b/less-608.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e3cf9db6ecbb05f0591780837175c3e2eec31ed2 Binary files /dev/null and b/less-608.tar.gz differ diff --git a/less.keyring b/less.keyring new file mode 100644 index 0000000000000000000000000000000000000000..e9db0ffc9b01189bbde98f2d00afeb022e025d07 --- /dev/null +++ b/less.keyring @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.2 (MingW32) + +mQGiBEGxJ/oRBADqyDKgNZNZSBVjYa++6I53TEbRc/ySPE8O5xnl+tJdW9Vr8Lr/ +vUd+xLSW10Ej48ISY/Vnw1N1Z3CqypLSVy3EJn5Kt9FE+yED5doRl3xLQ4f2zpLV ++6r7+62D5CkuNIO1SHVfqjHYQdMIa+pIj8tfWHODUM63iDOHjy2QQalSWwCg/zN3 +A5hZoo+7FwmmyndtIZzNfu8EANGohWj4wjrGP+qz12eQGctD76jlX9m9GSUWSDfz +iflox9xSElOoa0kGlNe3iB4JbfgeWsDc8u1pKvWaOu7SVT1ob0X6ZSGDF+sZ178B +YDbQEZ8wNK7vh7PvYmNTAdx8TjdeZH7BP0CqFXAefUIcf7IjxsCyoJKc0N/bBW5/ +wcXXBACRzkz2plYFRHuQJuma+vv1TZEnqUdU3xsDstiQzSUMltzHDNbGtDhZ+9XA +ZfhkM3sSimyljUbdjnUf/F/ulFGJfFp+C0+CIDqtOeLwtq1oNRFzsPAXMJGTh0IY +vss6/cpAGVBWhCt4nIL/o40xwte1YhcT3vEZ//CHKhlVhD+ozrQrTWFyayBOdWRl +bG1hbiA8bWFya25AZ3JlZW53b29kc29mdHdhcmUuY29tPohgBBARAgAgAhkBBQJD +AkHCBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ8VOnyDMjUlmy0wCfXc0HXCRm +kcAmNIhzuk2luW0sx7gAoJHwtEAf/54QboxUlXfJ//IvsFhBuQINBEGxJ/oQCAD2 +Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4INoBp1ajFOmPQFXz0AfGy0OplK33 +TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3bzpnhV5JZzf24rnRPxfx2vIPFRzBh +znzJZv8V+bv9kV7HAarTW56NoKVyOtQa8L9GAFgr5fSI/VhOSdvNILSd5JEHNmsz +bDgNRR0PfIizHHxbLY7288kjwEPwpVsYjY67VYy4XTjTNP18F1dDox0YbN4zISy1 +Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9 +iUsiGSa6q6Jew1XpMgs7AAICB/95h7/V29mwuVP/uP55I6NmEyYwI2gLUNdRPmNj +V+u/5gdh9DF9LQWj3Ko5vRmxVz3iAI3Nf2x7de+ULjEQruWsAvQgqjL1/NGQYupM +k5gPLdYrd8pjJfcLOjOM5ykArSHLtnPvg8OgiwBBb2YezLed3U0Li6fpV/sI4vD/ +rE55LNP3vijgXtLEdA2BTVJk7cJnjAOseWD8ZesJIbWPMfgD5CrM5jDFOnFqTBNX +YbrlEkI5faFL8y6HUTk5o9C1oHehgPtaDfYKmLVUWFQWVr1RzCILb8TiBjmlVvrH +q01dBUrsXOHiuAdYc4mSVAzGEjZdy2OrbgQyHMxSYFWCHRCkiEYEGBECAAYFAkGx +J/oACgkQ8VOnyDMjUlmPgACfZiXhixWbCD/W6D9dm7+isKy6D2oAn38AYHzvs+2L +Uz6yQ9xi5xz636J9 +=QjER +-----END PGP PUBLIC KEY BLOCK----- diff --git a/less.spec b/less.spec index 2cb0b21ef3ee0303a46827cd408c8d2285b76ac6..8f2555f4ff425759b86e06e99f0a4f65144b4620 100644 --- a/less.spec +++ b/less.spec @@ -1,50 +1,78 @@ -Name: less -Version: 590 -Release: 2 -Summary: Less is a pager that displays text files. -License: GPLv3+ or BSD -URL: http://www.greenwoodsoftware.com/less -Source0: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz -Patch0: less-394-time.patch -Patch1: less-475-fsync.patch - -BuildRequires: gcc make ncurses-devel autoconf automake libtool +Name: less +Version: 608 +Release: 1.1 +Summary: Text File Browser and Pager Similar to more +License: BSD-2-Clause OR GPL-3.0-or-later +Group: Productivity/Text/Utilities +URL: https://www.greenwoodsoftware.com/less/ +Source: https://www.greenwoodsoftware.com/less/less-%{version}.tar.gz +Source1: README.SUSE +Source2: lessopen.sh +Source3: lessclose.sh +Source4: lesskey.src +Source5: https://www.greenwoodsoftware.com/less/less-%{version}.sig +Source6: https://www.greenwoodsoftware.com/less/pubkey.asc#/%{name}.keyring +Patch0: less-429-shell.patch +Patch2: less-429-more.patch +BuildRequires: automake +BuildRequires: ncurses-devel +BuildRequires: pkgconfig +Requires: file +# lessopen.sh uses which +Requires: /usr/bin/which %description -Less is a pager. A pager is a program that displays text files. -Other pagers commonly in use are more and pg. Pagers are often -used in command-line environments like the Unix shell and the MS-DOS -command prompt to display files. - -Less is not an editor. You can't change the contents of the file -you're viewing. Less is not a windowing system. It doesn't have -fancy scroll bars or other GUI (graphical user interface) elements. - -%package_help +less is a text file browser and pager similar to more. It allows +backward as well as forward movement within a file. Also, less does not +have to read the entire input file before starting. It is possible to +start an editor at any time from within less. %prep -%autosetup -n %{name}-%{version} -p1 +%setup -q +%patch0 -p1 +%patch2 +# +# the ./configure script is not writable for the normal user +# rather fix permissions for all files +chmod u+w * +# +cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} . %build -rm -f ./configure -autoreconf -ivf +autoreconf -fiv +export CFLAGS="%{optflags} -fPIE" +export LDFLAGS="-pie" %configure -%make_build CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" +# +# regenerate help.c because less.hlp was patched +./mkhelp.pl help.c +# +# build less +%make_build %install %make_install - +# +# lesskey +install -m 755 -d %{buildroot}/%{_distconfdir} +install -m 644 lesskey.src %{buildroot}/%{_distconfdir}/lesskey +%{buildroot}%{_bindir}/lesskey -o %{buildroot}%{_distconfdir}/lesskey.bin %{buildroot}%{_distconfdir}/lesskey +# +# preprocessor +install -m 755 lessopen.sh lessclose.sh %{buildroot}/%{_bindir} +chmod -x LICENSE COPYING NEWS README.SUSE %files -%defattr(-,root,root) %license LICENSE COPYING -%{_bindir}/less* - -%files help -%doc README NEWS INSTALL -%{_mandir}/man1/* +%doc NEWS README.SUSE +%{_mandir}/*/* +%{_distconfdir}/* +%{_bindir}/* %changelog +* Tue Nov 8 2022 hkgy - 608-1 +- Upgrade to v608 + * Thu Oct 13 2022 fuanan - 590-2 - DESC:fix the changelog exception macro diff --git a/lessclose.sh b/lessclose.sh new file mode 100644 index 0000000000000000000000000000000000000000..9dc24a1f518b1951578cbcb0f752a6dc444e4a1c --- /dev/null +++ b/lessclose.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Copyright (c) 2001 SUSE GmbH, Nuernberg, Germany +# Copyright (c) 2002 SUSE Linux AG, Nuernberg, Germany +# +# Author: Vladimír Linek +# +# Postprocessor for 'less'. +# Use with environment variable: LESSCLOSE="lessclose.sh %s %s" +# + +test "$1" = "$2" || rm -f "$2" diff --git a/lesskey.src b/lesskey.src new file mode 100644 index 0000000000000000000000000000000000000000..9550c13def4f63fea5e16d26630537ea55e729d1 --- /dev/null +++ b/lesskey.src @@ -0,0 +1,101 @@ +#command +\e[A back-line +\e[B forw-line +\eO5A back-line +\eO5B forw-line +\eO5C right-scroll +\eO5D left-scroll +\e[6~ forw-scroll +\e[5~ back-scroll +\217A back-line +\217B forw-line +\217C right-scroll +\217D left-scroll +\2336~ forw-scroll +\2335~ back-scroll +\177 back-screen +^H back-screen +\e[3~ back-screen +\e[3;5~ back-screen +\2333~ back-screen +\e[2~ visual +\e[2;5~ visual +\2332~ visual +\e[1~ goto-line +\eOH goto-line +\eO5H goto-line +\e[4~ goto-end +\eOF goto-end +\eO5F goto-end +\eOM forw-line +#line-edit +\eO5A up +\eO5B down +\eO5C right +\eO5D left +\217A up +\217B down +\217C right +\217D left +\177 backspace +^H backspace +\e[3~ delete +\e[3;5~ delete +\2333~ delete +\e[1~ home +\eOH home +\eO5H home +\217H home +\e[4~ end +\eOF end +\eO5F end +\217F end +\e[5~ up +\e[6~ down +\e[5;5~ up +\e[6;5~ down +\2335~ up +\2336~ down +\e[2~ insert +\e[2;5~ insert +\2332~ insert +\e[E insert +\e[G insert +\eOE insert +\eOo insert : +\eOj insert * +\eOm insert - +\eOk insert + +\eOl insert , +\eOM insert +\eOw insert 7 +\eOx insert 8 +\eOy insert 9 +\eOt insert 4 +\eOu insert 5 +\eOv insert 6 +\eOq insert 1 +\eOr insert 2 +\eOs insert 3 +\eOp insert 0 +\eOn insert . +\217E insert +\217o insert : +\217j insert * +\217m insert - +\217k insert + +\217l insert , +\217M insert +\217w insert 7 +\217x insert 8 +\217y insert 9 +\217t insert 4 +\217u insert 5 +\217v insert 6 +\217q insert 1 +\217r insert 2 +\217s insert 3 +\217p insert 0 +\217n insert . +#env +LESSBINFMT=*s\%o diff --git a/lessopen.sh b/lessopen.sh new file mode 100644 index 0000000000000000000000000000000000000000..2895e3fc3217e6f29309265269bf07535380aa2b --- /dev/null +++ b/lessopen.sh @@ -0,0 +1,188 @@ +#!/bin/bash +# +# Copyright (c) 2001 SUSE GmbH, Nuernberg, Germany +# Copyright (c) 2002 SUSE Linux AG, Nuernberg, Germany +# +# Author: Vladimir Linek +# Support for directory listing by Dimitar Pashov +# +# Preprocessor for 'less'. +# Use with environment variable: LESSOPEN="lessopen.sh %s" + +# the following hack does not break anything but helps to view file whose name +# begins with a "-" or "+" with names +if echo "$1" | grep -q ^/; then + # absolute path + SRC="$1" +else + # relative path + SRC="./$1" +fi + +NAME="${SRC##*/}" + +[ ! -r "$SRC" ] && exit 1 + +cleaner() { + test "$TMPF_pre" = "$SRC" -o "$TMPF_pre" = "$TMPF" && return + rm -f "$TMPF_pre" +} +trap 'cleaner' EXIT SIGHUP +TMPF=$(mktemp /tmp/less.XXXXXXXXX) || exit 1 +TMPF_pre=$(mktemp /tmp/less.XXXXXXXXX) || exit 1 + +lang=$LANG +test -n "$LC_CTYPE" && lang="$LC_CTYPE" +case "$lang" in + *.UTF-8|*.UTF8) + GROFF_DEVICE=utf8 + ;; + ja*) + GROFF_DEVICE=nippon + ;; + *) + GROFF_DEVICE=latin1 + ;; +esac + +CMD= +type=`/usr/bin/file -L "$SRC"` +case ${type#"$SRC": } in + *"gzip compressed data"*|\ + *"compress'd data"*|\ + *"packed data"*) + CMD="gzip -dc" ;; + *"Zip archive data"*) + CMD="unzip -v" ;; + *"bzip"*" compressed data"*) + CMD="bzip2 -dc" ;; + *"xz compressed data"*|\ + *"XZ compressed data"*) + CMD="xz -dc" ;; + *) + rm -f "$TMPF_pre" + TMPF_pre="$SRC" ;; +esac + +test -n "$CMD" && $CMD "$SRC" >"$TMPF_pre" 2>/dev/null + + type=`/usr/bin/file -L "$TMPF_pre"` + case ${type#"$TMPF_pre": } in + *tar\ archive*) + if [ -x "`/usr/bin/which tar 2>/dev/null`" ]; then + tar tvvf "$TMPF_pre" >"$TMPF" 2>/dev/null + else echo "tar is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *Microsoft\ Cabinet\ *\ data*) + if [ -x "`/usr/bin/which cabextract 2>/dev/null`" ]; then + cabextract -l "$TMPF_pre" >"$TMPF" 2>/dev/null + else echo "cabextract is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *RPM*) + if [ -x "`/usr/bin/which rpm 2>/dev/null`" ]; then + (echo -e "=============================== Information ====================================\n"; + rpm -qip "\"$TMPF_pre\""; + echo -e "\n\n================================= Changelog (head) =============================\n"; + rpm -qp --changelog "\"$TMPF_pre\"" | head -n 16 + echo -e "\n\n================================= Content ======================================\n"; + rpm -qlp "\"$TMPF_pre\"" + ) >"$TMPF" 2>/dev/null + else echo "rpm is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *DVI*) + if [ -x "`/usr/bin/which dvi2tty 2>/dev/null`" ]; then + if [ "${TMPF_pre%.dvi}" != "$TMPF_pre" ] ; then + dvi2tty -q "$TMPF_pre" >"$TMPF" 2>/dev/null + else echo "dvi2tty requires an input file name with the suffix .dvi" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre" ; fi + else echo "dvi2tty is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *PDF*) + if [ -x "`/usr/bin/which pdftotext 2>/dev/null`" ]; then + pdftotext "$TMPF_pre" "$TMPF" 2>/dev/null + else echo "pdftotext is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *Debian\ binary\ package*) + if [ -x "`/usr/bin/which dpkg-deb 2>/dev/null`" ]; then + dpkg-deb -c "$TMPF_pre" >"$TMPF" 2>/dev/null + else echo "dpkg-deb is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *\ ar\ archive*) + if [ -x "`/usr/bin/which nm 2>/dev/null`" ]; then + nm "$TMPF_pre" >"$TMPF" 2>/dev/null + else echo "nm is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *directory*) + # assuming ls is always available + ls -lh "$TMPF_pre" >"$TMPF" 2>/dev/null + ;; + *diff\ output*) + # I haven't found way, to set less -R from this script + # so check, if '-R' or '--RAW-CONTROL-CHARS' is set in environment + R_NOT_SET=true + for i in $LESS; do + if [ "${i:0:1}" = "-" ]; then + if [ "${i:1:1}" = "-" ]; then + if [ "$i" = --RAW-CONTROL-CHARS ]; then + R_NOT_SET=false + break + else + continue + fi + else + for j in `seq 1 $((${#i} - 1 ))`; do + if [ "${i:j:1}" = R ]; then + R_NOT_SET=false + break + fi + done + fi + fi + done + # if we have -R and colordiff, we can continue + if [ $R_NOT_SET = false ] && \ + [ -x "`/usr/bin/which colordiff 2>/dev/null`" ]; then + colordiff < "$TMPF_pre" | cat > "$TMPF" 2>/dev/null + else rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *) + if [ "$LESS_ADVANCED_PREPROCESSOR" = "yes" ]; then + case ${type#"$TMPF_pre": } in + *troff*) + if [ -x "`/usr/bin/which groff 2>/dev/null`" ]; then + case "$NAME" in + *.[1-9nxp]*|*.man|*.[1-9nxp]*.*|*.man.*) + groff -s -p -t -e -T$GROFF_DEVICE -mandoc "$TMPF_pre" >"$TMPF" 2>/dev/null ;; + *.ms|*.ms.*) + groff -T$GROFF_DEVICE -ms "$TMPF_pre" >"$TMPF" 2>/dev/null ;; + *.me|*.me.*) + groff -T$GROFF_DEVICE -me "$TMPF_pre" >"$TMPF" 2>/dev/null ;; + *) + groff -T$GROFF_DEVICE "$TMPF_pre" >"$TMPF" 2>/dev/null ;; + esac + else echo "groff is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *PostScript*) + if [ -x "`/usr/bin/which ps2ascii 2>/dev/null`" ]; then + ps2ascii "$TMPF_pre" >"$TMPF" 2>/dev/null + else echo "ps2ascii is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *HTML*) + if [ -x "`/usr/bin/which w3m 2>/dev/null`" ]; then + w3m -dump -T text/html "$TMPF_pre" >"$TMPF" 2>/dev/null + elif [ -x "`/usr/bin/which lynx 2>/dev/null`" ]; then + lynx -dump -force_html "$TMPF_pre" >"$TMPF" 2>/dev/null + else echo "lynx/w3m not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi + ;; + *) + rm -f "$TMPF" + TMPF="$TMPF_pre" + ;; + esac + else + rm -f "$TMPF" + TMPF="$TMPF_pre" + fi + ;; + esac + +test "$TMPF" = "$SRC" || echo "$TMPF"