diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d99234d --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.POSIX: + +DESTDIR = +PREFIX = /usr/local +BASEDIR = $(DESTDIR)$(PREFIX) + +install: __phony + mkdir -m 0755 -p "$(BASEDIR)/share/nadeshiko" "$(BASEDIR)/bin" + cp -r lib modules exampleconf nadeshiko.sh nadeshiko-mpv.sh nadeshiko-do-postponed.sh "$(BASEDIR)/share/nadeshiko" + ln -sf "$(PREFIX)/share/nadeshiko/nadeshiko.sh" "$(BASEDIR)/bin/nadeshiko" + ln -sf "$(PREFIX)/share/nadeshiko/nadeshiko-mpv.sh" "$(BASEDIR)/bin/nadeshiko-mpv" + ln -sf "$(PREFIX)/share/nadeshiko/nadeshiko-do-postponed.sh" "$(BASEDIR)/bin/nadeshiko-do-postponed" + +uninstall: __phony + rm -rf "$(BASEDIR)/share/nadeshiko" + rm -f "$(BASEDIR)/bin/nadeshiko" + rm -f "$(BASEDIR)/bin/nadeshiko-mpv" + rm -f "$(BASEDIR)/bin/nadeshiko-do-postponed" + +__phony: diff --git a/nadeshiko-do-postponed.sh b/nadeshiko-do-postponed.sh index c7110f4..92d93de 100755 --- a/nadeshiko-do-postponed.sh +++ b/nadeshiko-do-postponed.sh @@ -8,7 +8,7 @@ set -feEuT -. "$(dirname "$0")/lib/bahelite/bahelite.sh" +. "$(dirname "$(realpath "$0")")/lib/bahelite/bahelite.sh" prepare_cachedir 'nadeshiko' start_log set_libdir 'nadeshiko' diff --git a/nadeshiko-mpv.sh b/nadeshiko-mpv.sh index 5c7547c..7ba5ff0 100755 --- a/nadeshiko-mpv.sh +++ b/nadeshiko-mpv.sh @@ -8,7 +8,7 @@ set -feEuT shopt -s extglob -. "$(dirname "$0")/lib/bahelite/bahelite.sh" +. "$(dirname "$(realpath "$0")")/lib/bahelite/bahelite.sh" prepare_cachedir 'nadeshiko' start_log set_libdir 'nadeshiko' diff --git a/nadeshiko.sh b/nadeshiko.sh index ad83025..6e759dd 100755 --- a/nadeshiko.sh +++ b/nadeshiko.sh @@ -17,7 +17,7 @@ set -feEuT shopt -s extglob # Logging, error handling, messages to console and desktop. -. "$(dirname "$0")/lib/bahelite/bahelite.sh" +. "$(dirname "$(realpath "$0")")/lib/bahelite/bahelite.sh" prepare_cachedir start_log set +f