commit b22893ff824e73ab05bd86930f018b45853afdab
parent a6a1979a9d9bbcebba58544dcffea05e089f39b3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 21 May 2023 13:50:45 +0200
Fix the uninstall target
Add "prefix" target as a prerequisite for "uninstall" target for git
and Star-PacKaGe Makefiles. For the latter, correct the invocation of
the uninstall script: the path where the files should be deleted was not
correctly defined. Finally, remove from the installation directory the
checksum sha512sum of the package.
Diffstat:
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/git.mk.in b/git.mk.in
@@ -24,9 +24,9 @@ clean_@NAME@:
cd -- @NAME@_dir && make clean;\
fi
-uninstall_@NAME@:
- @if [ -d @NAME@_dir ]; then \
- cd -- @NAME@_dir && make PREFIX="$$(cat ../.prefix)" uninstall; \
+uninstall_@NAME@: prefix
+ @if [ -d @NAME@_dir ]; then\
+ cd -- @NAME@_dir && make PREFIX="$$(cat ../.prefix)" uninstall;\
fi
distclean_@NAME@:
diff --git a/spkg.mk.in b/spkg.mk.in
@@ -1,5 +1,6 @@
@NAME@: @ARCH@.tgz @ARCH@.sha512sum prefix
- @if ! cmp @ARCH@.sha512sum "$$(cat .prefix)/share/spkg/@ARCH@.sha512sum" > /dev/null 2>&1; then\
+ @if ! cmp @ARCH@.sha512sum "$$(cat .prefix)/share/spkg/@ARCH@.sha512sum"\
+ > /dev/null 2>&1; then\
sha512sum -c @ARCH@.sha512sum;\
tar -xvf @ARCH@.tgz -C $$(cat .prefix);\
$(SHELL) "$$(cat .prefix)/share/spkg/@NAME@.sh" install "$$(cat .prefix)";\
@@ -9,10 +10,11 @@
@ARCH@.sha512sum @ARCH@.tgz:
curl -O "@PATH@/$@"
-uninstall_@NAME@:
- @if [ -f "$$(cat .prefix)/share/spkg/@NAME@.sh" ]; then \
- $(SHELL) "$$(cat .prefix)/share/spkg/@NAME@.sh" uninstall "$(cat .prefix)"; \
+uninstall_@NAME@: prefix
+ if [ -f "$$(cat .prefix)/share/spkg/@NAME@.sh" ]; then\
+ $(SHELL) "$$(cat .prefix)/share/spkg/@NAME@.sh" uninstall "$$(cat .prefix)";\
fi
+ rm -f "$$(cat .prefix)/share/spkg/@ARCH@.sha512sum"
distclean_@NAME@:
rm -rf @ARCH@.tgz @ARCH@.sha512sum