diff options
author | Cem Keylan <cem@ckyln.com> | 2020-12-26 02:39:36 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-12-26 03:12:25 +0300 |
commit | d1590234d19724f14e8ba94582986963fce47267 (patch) | |
tree | 1bb6273414ef57443b3cdda21f0329b0dc8ae742 /default.do | |
parent | 06aca27d4b504ea5f42f4611fa3b44d9429bea75 (diff) | |
download | docs-d1590234d19724f14e8ba94582986963fce47267.tar.gz |
docs: switch to redo build system.20201226
Diffstat (limited to 'default.do')
-rw-r--r-- | default.do | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/default.do b/default.do new file mode 100644 index 0000000..231765f --- /dev/null +++ b/default.do @@ -0,0 +1,69 @@ +exec >&2 +. ./config.rc + +fn=${1%.*} + +date=$(date +%Y%m%d) +export date + +case "$1" in + *.txt|*.texi) + [ -f "$fn.org" ] || { + printf '%s\n' "Don't know how to build $1" + exit 1 + } + redo-ifchange "$fn.org" fdl.org + trap 'rm -f $3.org' EXIT INT + cp "$fn.org" "$3.org" +esac + +case "$1" in + all) redo-ifchange carbslinux.info install.txt carbslinux.txt ;; + allclean) + rm -f carbslinux.texi install.txt carbslinux.txt + redo clean + PHONY + ;; + htmldocs) + redo-ifchange carbslinux.org carbslinux.texi install.txt install.html + rm -f "${HTMLDIR:?}/"* + makeinfo --html -o "${HTMLDIR}" "${TEXI}" + cp install.txt "${HTMLDIR}/install.txt" + cp install.html "${HTMLDIR}/install.html" + PHONY + ;; + *.txt) + ${EMACS} "$3.org" -f org-ascii-export-to-ascii + mv "$3.txt" "$3" + ;; + *.texi) + ${EMACS} "$3.org" -f org-texinfo-export-to-texinfo + mv "$3.texi" "$3" + ;; + *.info) + redo-ifchange "$fn.texi" + ${MAKEINFO} "$fn.texi" -o "$3" + ;; + "carbs-docs-$date.tar.xz") + target=$1 dest=$3 + set -- README.md ./*.do ./*.org config.rc lib.rc carbslinux.info \ + install.txt carbslinux.txt + redo-ifchange "$@" + trap 'rm -rf carbs-docs-$date carbs-docs-$date.tar' EXIT INT + mkdir -p "carbs-docs-$date" + cp README.md ./*.do ./*.org config.rc lib.rc \ + carbslinux.info install.txt carbslinux.txt "carbs-docs-$date" + tar cf "carbs-docs-$date.tar" "carbs-docs-$date" + xz -cz "carbs-docs-$date.tar" > "$dest" + ;; + install) + redo-ifchange carbslinux.info carbslinux.txt + mkdir -p "${DESTDIR}${INFODIR}" "${DESTDIR}${DOCDIR}" + cp carbslinux.info "${DESTDIR}${INFODIR}/carbslinux.info" + cp carbslinux.txt "${DESTDIR}${DOCDIR}/carbslinux.txt" + ;; + dist) + redo-ifchange "carbs-docs-$date.tar.xz" + ;; + *) printf '%s\n' "Unknown operation $1"; exit 1 +esac |