aboutsummaryrefslogtreecommitdiffstats
path: root/gnupg/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-06-25 20:44:21 +0200
committerMattias Andrée <maandree@kth.se>2021-06-25 20:44:21 +0200
commitd5fb2d47307557219a5d4814aef24d8b544f1c68 (patch)
tree320c772174104efa42f4b74c77b47e878b8a0b94 /gnupg/Makefile
parentFix bugs (diff)
downloaddotfiles-d5fb2d47307557219a5d4814aef24d8b544f1c68.tar.gz
dotfiles-d5fb2d47307557219a5d4814aef24d8b544f1c68.tar.bz2
dotfiles-d5fb2d47307557219a5d4814aef24d8b544f1c68.tar.xz
Link ~/.var/lib/gnupg to ~/.dotfiles/.secrets/gnupg; also fix GNUPG_HOME in gnupg/user-profile
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'gnupg/Makefile')
-rw-r--r--gnupg/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/gnupg/Makefile b/gnupg/Makefile
index f89880c..6583b2d 100644
--- a/gnupg/Makefile
+++ b/gnupg/Makefile
@@ -2,7 +2,14 @@
include ../common.mk
install:
- mkdir -p -- ~/.var/lib/gnupg
+ mkdir -p -- ~/.dotfiles/.secrets/gnupg
+ mkdir -p -- ~/.var/lib
+ if test -L ~/.var/lib/gnupg; then \
+ test "$$(readlink -- ~/.var/lib/gnupg)" = ~/.dotfiles/.secrets/gnupg; \
+ else \
+ test ! -e ~/.var/lib/gnupg && \
+ ln -s -- ~/.dotfiles/.secrets/gnupg ~/.var/lib/gnupg; \
+ fi
mkdir -p -- ~/.config/profile.d
test ! -d ~/.config/profile.d/gnupg
ln -sf -- ~/.dotfiles/gnupg/user-profile ~/.config/profile.d/gnupg
@@ -10,6 +17,6 @@ install:
uninstall:
-unlink -- ~/.config/profile.d/gnupg
-rmdir -- ~/.config/profile.d
- -rmdir -- ~/.var/lib/gnupg
+ -unlink -- ~/.var/lib/gnupg
.PHONY: install uninstall