aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2012-09-28 12:37:38 +0100
committerRyan Kavanagh <rak@debian.org>2012-09-28 12:37:38 +0100
commitee357bbbe62c5642323c79d2787fd14df884cab5 (patch)
tree18af99a579d633909b72ebe0575802c25587ad3d
parentDon't explicitly refer to grep's path in run-mailcheck (diff)
Abstract location of GPG in Make & scirpts to a SUBSTS var; binary is called gpg2 or gpg depending on system
Diffstat (limited to '')
-rwxr-xr-xMakefile9
-rw-r--r--SUBSTS3
-rwxr-xr-xbin/gpg-wrapper4
3 files changed, 11 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index c3e0259..be998a6 100755
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@ LOCAL_FILES = \
.xmonad/xmonad.hs \
.zsh/func/prompt_wunjo_setup \
.zshrc \
+ bin/gpg-wrapper \
bin/run-mailcheck
# GPG encrypted files
@@ -76,6 +77,7 @@ CURRENT_BRANCH = $(shell git branch --no-color | colrm 1 2)
SHA256 = $(call get-val,SHA256)
GPG_DISABLED = $(call get-val,GPG_DISABLED)
+GPG_BINARY = $(call get-val,GPG_BINARY)
VARS_.devscripts = MSMTP_PATH
VARS_.gitconfig = MSMTP_PATH
@@ -91,6 +93,7 @@ VARS_.xinitrc = SCREENLAYOUT REDSHIFT_MODE GSD_PATH
VARS_.xmonad/xmonad.hs = XMONAD_DZEN_W XMONAD_DZEN_X XMONAD_DZEN_Y
VARS_.zsh/func/prompt_wunjo_setup = ZSH_HOST_COLOUR
VARS_.zshrc = LOCALE SUBSTS_RM SUBSTS_LS MSMTP_PATH KEYCHAIN
+VARS_bin/gpg-wrapper = GPG_BINARY
VARS_bin/run-mailcheck = ZSH_PATH GREP_PATH
all: clean build
@@ -115,7 +118,7 @@ FORCE:
# $(patsubst gpg/,,$(wildcard gpg/.* gpg/*))
$(GPG_FILES):
touch $@ && chmod 600 $@
- [ "$(GPG_DISABLED)" = "True" ] || gpg --decrypt gpg/$@.gpg > $@
+ [ "$(GPG_DISABLED)" = "True" ] || $(GPG_BINARY) --decrypt gpg/$@.gpg > $@
build/%: % $(SUBSTS_FILE)
[ -d $(dir $@) ] || mkdir -p $(dir $@)
@@ -146,7 +149,7 @@ sha256sums: .git/refs/heads/$(CURRENT_BRANCH)
sha256sums.asc: sha256sums
rm -f $@
- gpg --armor --detach-sign $<
+ $(GPG_BINARY) --armor --detach-sign $<
merge: SUBSTS $(SUBSTS_FILE)
# sdiff has exit status 1 if files are different. Ignore
@@ -195,7 +198,7 @@ verify:
} END { \
print match_count, "matches, ", mismatch_count, "mismatches." \
}' sha256sums
- gpg --verify sha256sums.asc
+ $(GPG_BINARY) --verify sha256sums.asc
udh:
rsync -avz master.debian.org:/var/lib/misc/master.debian.org/ssh_known_hosts .ssh/known_hosts.d/debian
diff --git a/SUBSTS b/SUBSTS
index c0e64cd..7a96565 100644
--- a/SUBSTS
+++ b/SUBSTS
@@ -69,3 +69,6 @@ LOCALHOST epsilon.ryanak.ca
# REMOTE_GMAIL or LOCAL_GMAIL
IMAPFILTER_GMAIL_SERVER REMOTE_GMAIL
+
+# gpg or gpg2
+GPG_BINARY gpg2
diff --git a/bin/gpg-wrapper b/bin/gpg-wrapper
index a550858..614fbee 100755
--- a/bin/gpg-wrapper
+++ b/bin/gpg-wrapper
@@ -26,12 +26,12 @@ fi
# --lock-never is needed since encfs doesn't support locking any more
if [ -f ${decrypted_dir}/gpg.conf ]
then
- exec gpg --lock-never --homedir ${decrypted_dir} $@
+ exec GPG_BINARY --lock-never --homedir ${decrypted_dir} $@
else
gpg-mounter
if [ -f ${decrypted_dir}/gpg.conf ]
then
- exec gpg --lock-never --homedir ${decrypted_dir} $@
+ exec GPG_BINARY --lock-never --homedir ${decrypted_dir} $@
else
echo 'No gnupg.conf in ${decrypted_dir}'
exit 1