commit 4727c2cae4f73adabace3fbf8be748f55bc79e4b
parent 583b3d8bfdc9b2f08ec7eddcc7aa59e02b762c84
Author: gearsix <gearsix@tuta.io>
Date: Mon, 26 Dec 2022 13:45:42 +0000
replaced Makefile with install.sh ...
Not sure why I was using a Makefile for install of a Python script in
the first place, using a POSIX sh script now.
Diffstat:
2 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,27 +0,0 @@
-CURRDIR=$(shell pwd)
-DESTBINDIR=/usr/local/bin
-DESTMANDIR=/usr/local/man
-NAME=dotfm
-
-all: none
-
-none:
- @echo 'nothing to do, just run "make install", or "make uninstall"'
-
-install:
- install -pDm755 ${CURRDIR}/src/${NAME}.py ${DESTBINDIR}/${NAME}
- mkdir -p ${DESTMANDIR}/man1
- install ${CURRDIR}/src/${NAME}.1 ${DESTMANDIR}/man1/${NAME}.1
- ln -si ${DESTMANDIR}/man1/${NAME}.1 /usr/share/man/man1/${NAME}.1
-
-link:
- ln -si ${CURRDIR}/src/${NAME}.py ${DESTBINDIR}/${NAME}
- mkdir -p ${DESTMANDIR}/man1
- ln -si ${CURRDIR}/src/${NAME}.1 ${DESTMANDIR}/man1/${NAME}.1
- ln -si ${DESTMANDIR}/man1/${NAME}.1 /usr/share/man/man1/${NAME}.1
-
-uninstall:
- rm -i ${DESTBINDIR}/${NAME}
- rm ${DESTMANDIR}/man1/${NAME}.1 /usr/share/man/man1/${NAME}.1
-
-.PHONY: all none install link uninstall
diff --git a/install.sh b/install.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env sh
+
+set -e
+
+NAME="dotfm"
+CURRDIR=$(pwd)
+DESTBIN=/usr/local/bin
+DESTMAN=/usr/local/man/man1
+
+mkdir -p $DESTBIN $DESTMAN
+
+if [ "$1" = "-h" ]; then
+ echo "usage: ./install.sh [-h|-l|-u]"
+ echo ""
+ echo "options:"
+ echo " -h print this message"
+ echo " -l link the install files from source (not copy)"
+ echo " -u uninstall all install files"
+ echo ""
+elif [ "$1" = "-l" ]; then
+ ln -iv "$CURRDIR/src/$NAME.py" "$DESTBIN/$NAME"
+ ln -iv "$CURRDIR/src/$NAME.1" "$DESTMAN"
+elif [ "$1" = "-u" ]; then
+ rm -i "$DESTBIN/$NAME"
+ rm -i "$DESTMAN/$NAME.1"
+else
+ cp -v "$CURRDIR/src/$NAME.py" "$DESTBIN/$NAME"
+ chmod +x "$DESTBIN/$NAME"
+ cp -v "$CURRDIR/src/$NAME.1" "$DESTMAN"
+fi