From 263b8a78efe12dfde24cb1e71b361fe7d85c2ec0 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Fri, 26 Mar 2021 22:30:19 -0700 Subject: [PATCH] Fix how calc(1) cat page, if needed, is formed --- CHANGES | 2 ++ Makefile | 11 ----------- Makefile.ship | 16 +++++++++++----- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index 0c0daff..fac352c 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,8 @@ The following are the changes from calc version 2.12.9.2 to date: Fixed how the calc(1) man page is installed under macOS. + Fixed how calc man page in ${CATDIR} is formed. + The following are the changes from calc version 2.12.8.2 to 2.12.9.1: diff --git a/Makefile b/Makefile index 101aaec..566c7c7 100644 --- a/Makefile +++ b/Makefile @@ -103,16 +103,6 @@ endif CCBAN= -UUNBAN #CCBAN= -DUNBAN -# where man section 1 pages are installed -# -#if 0 /* start of skip for non-Gnu makefiles */ -ifeq ($(target),Darwin) -MANDIR= /usr/local/share/man/man1 -else -MANDIR= /usr/share/man/man1 -#if 0 /* start of skip for non-Gnu makefiles */ -endif - # Determine of the GNU-readline facility will be used instead of the # built-in calc binding method. # @@ -250,7 +240,6 @@ XVAR= \ EXT='${EXT}' \ H='${H}' \ MAKE_FILE='${MAKE_FILE}' \ - MANDIR='${MANDIR}' \ NROFF='${NROFF}' \ Q='${Q}' \ READLINE_INCLUDE='${READLINE_INCLUDE}' \ diff --git a/Makefile.ship b/Makefile.ship index b8f6558..ce3e6bc 100644 --- a/Makefile.ship +++ b/Makefile.ship @@ -866,6 +866,9 @@ endif # # Use CATDIR= to disable installation of the calc cat (formatted) page. # +# NOTE: If CATDIR is non-empty, then one should have either the +# ${NROFF} executable and/or the ${MANMAKE} executable. +# CATDIR= #CATDIR= /usr/local/man/cat1 #CATDIR= /usr/local/catman/cat1 @@ -4987,7 +4990,7 @@ endif #if 0 /* start of skip for non-Gnu makefiles */ ifdef ALLOW_CUSTOM #endif /* end of skip for non-Gnu makefiles */ - ${V} echo '=-=-=-=-= Invoking $@ rule for custom =-=-=-=-=' + ${V} echo 'XXX =-=-=-=-= Invoking $@ rule for custom =-=-=-=-=' ${Q} cd custom; ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} install ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' #if 0 /* start of skip for non-Gnu makefiles */ @@ -5102,10 +5105,7 @@ endif if ${CMP} -s calc.1 ${T}${MANDIR}/calc.${MANEXT}; then \ ${TRUE}; \ else \ - if [ -z "${NROFF}" ]; then \ - echo "${MANMAKE} calc.1 ${T}${CATDIR}"; \ - ${MANMAKE} calc.1 ${T}${CATDIR}; \ - else \ + if [ -n "${NROFF}" ]; then \ ${RM} -f ${T}${CATDIR}/calc.${CATEXT}.new; \ ${NROFF} ${NROFF_ARG} calc.1 > \ ${T}${CATDIR}/calc.${CATEXT}.new; \ @@ -5113,6 +5113,12 @@ endif ${MV} -f ${T}${CATDIR}/calc.${CATEXT}.new \ ${T}${CATDIR}/calc.${CATEXT}; \ echo "installed ${T}${CATDIR}/calc.${CATEXT}"; \ + elif [ -x "${MANNAME}" ]; then \ + echo "${MANMAKE} calc.1 ${T}${CATDIR}"; \ + ${MANMAKE} calc.1 ${T}${CATDIR}; \ + else \ + echo "Notice: no ${MROFF} and no ${MANMAKE}: this is OK" 1>&2; \ + echo "Notice: skipping forming ${T}${MANDIR}/calc.${MANEXT}" 1>&2; \ fi; \ fi; \ fi