summaryrefslogtreecommitdiff
path: root/support/proof/install
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/proof/install
Initial commit
Diffstat (limited to 'support/proof/install')
-rwxr-xr-xsupport/proof/install71
1 files changed, 71 insertions, 0 deletions
diff --git a/support/proof/install b/support/proof/install
new file mode 100755
index 0000000000..d4d73fa3db
--- /dev/null
+++ b/support/proof/install
@@ -0,0 +1,71 @@
+#!/bin/bash -e
+
+# $Id: install,v 1.2 2002/09/30$
+
+#
+# Proof install script
+#
+
+# show system configuration!
+function list_progs
+{
+ cmds=('bash --version' 'xterm -version' 'tex --version' \
+ 'etex --version' 'pdftex --version' 'pdfetex --version' \
+ 'mf --version' 'mpost --version' 'dvips --version' \
+ 'dvipdfm --version' 'gs --version' 'rcs -V')
+ names=('GNU bash ' 'XFree86 ' 'TeX ' 'e-TeX '\
+ 'pdfTeX ' 'pdf-e-TeX ' 'METAFONT ' 'MetaPost ' \
+ 'dvips ' 'dvipdfm ' 'Ghostscript' 'RCS ')
+
+ local i=0 cmd
+ until [ $i = 12 ]; do
+ cmd=${cmds[$i]}
+ echo -n "${names[$i]}: "
+ if type ${cmd% *} >/dev/null 2>&1; then
+ ver=$(echo "$(eval $cmd | sed '/^$/d;s/-release//g' | head -1)" | \
+ sed 's/.*\ \([0-9]\+\.[0-9]\+[^\ ,]*\).*/\1/')
+ echo "${ver:+version $ver }found"
+ else
+ echo "<-- not installed!"
+ fi
+ i=$((i+1))
+ done
+}
+
+echo -e "You'll see a short list of those applications now Proof expects\nto be installed on your system. 'install' will complain if a\nparticular program cannot be found...\n"
+
+list_progs; echo
+
+read -p 'Install Proof? (y/n) '
+[ "$REPLY" = 'n' ] && { echo 'Ok, aborting...'; exit 0; }
+
+# copy Proof files!
+inst_dirs=(/usr/local/bin ~ /usr/man/man1)
+files=(proof .proofrc proof.1.gz)
+types=(shellscript 'configuration file' 'manual page')
+
+function _cp
+{
+sed '
+/^\.SH FILES/,/^$/{
+ s:^\.I proof$:\.I '${inst_dirs[0]}'/proof:
+ s:^\.I proofrc$:\.I ~/\.proofrc:
+ s:^\.I proof\.1$:\.I '${inst_dirs[2]}'/proof\.1\.gz:
+}' $1 | gzip -c >$2
+}
+
+echo
+for i in 0 2; do
+ read -p "Install ${types[$i]} ${files[$i]} to ${inst_dirs[$i]}? (y/n) "
+ if [ "$REPLY" = 'n' ]; then
+ read -p 'Path? '
+ eval inst_dirs[$i]=$REPLY
+ fi
+done
+
+cp proof ${inst_dirs[0]}/${files[0]}
+cp proofrc ${inst_dirs[1]}/${files[1]}
+_cp proof.1 ${inst_dirs[2]}/${files[2]}
+
+echo -e '\nProof is now installed.'
+