summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-17 17:42:28 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-17 17:42:28 +0200
commit2ba85daddf46422aa510a8c03ff75ba59761c190 (patch)
tree15d1a19953b732871ab0cee9905ca1a8be0f5cab /Makefile
parent658fe0ac863a4d1c62b3c64d2ed9c92981274bd4 (diff)
downloadpass-2ba85daddf46422aa510a8c03ff75ba59761c190.tar.gz
pass-2ba85daddf46422aa510a8c03ff75ba59761c190.tar.bz2
pass-2ba85daddf46422aa510a8c03ff75ba59761c190.zip
makefile: allow platform files with gnu sed
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 32c2d6a..bee69e1 100644
--- a/Makefile
+++ b/Makefile
@@ -6,14 +6,13 @@ MANDIR ?= $(PREFIX)/share/man
PLATFORMFILE := src/platform/$(shell uname | cut -d _ -f 1 | tr '[:upper:]' '[:lower:]').sh
-.PHONY: install uninstall install-pass
+.PHONY: install uninstall install-common
all:
@echo "Password store is a shell script, so there is nothing to do. Try \"make install\" instead."
-install-pass:
+install-common:
@mkdir -p "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(LIBDIR)" "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(PREFIX)/share/bash-completion/completions/"
- @install -m 0755 -v src/password-store.sh "$(DESTDIR)$(BINDIR)/pass"
@install -m 0644 -v man/pass.1 "$(DESTDIR)$(MANDIR)/man1/pass.1"
@install -m 0644 -v src/completion/pass.bash-completion "$(DESTDIR)$(PREFIX)/share/bash-completion/completions/pass"
@@ -24,12 +23,14 @@ install-pass:
# @install -m 0644 -v src/completion/pass.fish-completion "$(DESTDIR)$(PREFIX)/share/fish/completions/pass.fish"
ifneq ($(strip $(wildcard $(PLATFORMFILE))),)
-install: install-pass
+install: install-common
@install -m 0644 -v "$(PLATFORMFILE)" "$(DESTDIR)$(LIBDIR)/password-store.platform.sh"
-# The -i "" doesn't work on GNU, where the extra argument isn't needed. Fortuantely, platform file is for non-GNU only.
- sed -i "" 's:.*platform-defined-functions.*:source $(DESTDIR)$(LIBDIR)/password-store.platform.sh:' "$(DESTDIR)$(BINDIR)/pass"
+ @mkdir -p -v "$(DESTDIR)$(BINDIR)/"
+ sed 's:.*platform-defined-functions.*:source $(DESTDIR)$(LIBDIR)/password-store.platform.sh:' src/password-store.sh > "$(DESTDIR)$(BINDIR)/pass"
+ @chmod 0755 "$(DESTDIR)$(BINDIR)/pass"
else
-install: install-pass
+install: install-common
+ @install -m 0755 -v src/password-store.sh "$(DESTDIR)$(BINDIR)/pass"
endif
uninstall: