diff options
author | merakor <cem@ckyln.com> | 2020-12-24 13:08:32 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-12-24 13:08:32 +0000 |
commit | 70a32fc9b0969fc9ee8c5e2ea6077d08ae304dbe (patch) | |
tree | af2a77f4c78612da91880bdf5c93afd8a427f0a1 | |
parent | c847ccf03d8d5e16e5095de8a1f0f06db6d64e0e (diff) | |
download | cpt-70a32fc9b0969fc9ee8c5e2ea6077d08ae304dbe.tar.gz |
cpt: add info page to the build system
- Made the info page an optional part of the build system, meaning that
'redo' will not attempt to build or install the info page if you don't
have 'makeinfo' available on your system.
- The info page is installed to the 'info/' directory relative to the
$SHAREDIR. It can be overriden by setting the INFODIR variable.
FossilOrigin-Name: 4df60a4d7dbaac4948453208251b1210974d931bfcf74b583cd862e9d28fd57c
-rw-r--r-- | config.rc | 1 | ||||
-rw-r--r-- | docs/default.do | 5 | ||||
-rw-r--r-- | install.do | 9 | ||||
-rw-r--r-- | uninstall.do | 5 |
4 files changed, 20 insertions, 0 deletions
@@ -22,6 +22,7 @@ setv BINDIR = "${PREFIX}/bin" setv SHAREDIR = "${PREFIX}/share" setv DOCDIR = "${SHAREDIR}/doc" setv CPTDOC = "${DOCDIR}/cpt" +setv INFODIR = "${SHAREDIR}/info" setv MANPREFIX = "${SHAREDIR}/man" setv MAN1 = "${MANPREFIX}/man1" diff --git a/docs/default.do b/docs/default.do index a66ed9b..3519aec 100644 --- a/docs/default.do +++ b/docs/default.do @@ -8,6 +8,11 @@ case "$1" in allclean) redo ../clean; rm -f cpt.texi ;; info) redo-ifchange cpt.info cpt.texi cpt.org ;; *.info) + # Don't bother if makeinfo doesn't exist on the system, exit with success. + if ! command -v $MAKEINFO; then + PHONY + exit 0 + fi redo-ifchange "$fn.texi" $MAKEINFO "$fn.texi" -o "$3" ;; @@ -14,3 +14,12 @@ for man in man/*.1; do cp "$man" "${DESTDIR}${MAN1}/${man##*/}" chmod 644 "${DESTDIR}${MAN1}/${man##*/}" done + +# Install the documentation info page. +# We don't want to bother if the info page wasn't created, just exit without an +# error. +[ -f docs/cpt.info ] || exit 0 + +mkdir -p "${DESTDIR}${INFODIR}" +cp docs/cpt.info "${DESTDIR}${INFODIR}/cpt.info" +chmod 644 "${DESTDIR}${INFODIR}/cpt.info" diff --git a/uninstall.do b/uninstall.do index d2f4585..3347874 100644 --- a/uninstall.do +++ b/uninstall.do @@ -1,9 +1,14 @@ . ./config.rc +# Remove executables. getbin | while read -r file; do rm -f "${DESTDIR}${BINDIR}/${file##*/}" done +# Remove manual pages. for man in man/*.1; do rm -f "${DESTDIR}${MAN1}/${man##*/}" done + +# Remove the info page. +rm -f "${DESTDIR}${INFODIR}/cpt.info" |