mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 09:55:47 +01:00
Support Windows/OS-X in 'make install'. Closes issue #33.
This commit is contained in:
@@ -41,9 +41,6 @@ BUILD_DIR = build.$(VERSION).$(OS)
|
|||||||
AWK ?= awk
|
AWK ?= awk
|
||||||
B64ENCODE ?= base64
|
B64ENCODE ?= base64
|
||||||
CURL ?= curl
|
CURL ?= curl
|
||||||
FIREFOX ?= firefox
|
|
||||||
PROFILES ?= $(HOME)/.mozilla/firefox
|
|
||||||
export PROFILES
|
|
||||||
|
|
||||||
.SILENT:
|
.SILENT:
|
||||||
|
|
||||||
@@ -66,8 +63,8 @@ help:
|
|||||||
@echo " make xpi - build an XPI ($(XPI_NAME))"
|
@echo " make xpi - build an XPI ($(XPI_NAME))"
|
||||||
@echo " make installxpi - build an XPI and install it to your profile"
|
@echo " make installxpi - build an XPI and install it to your profile"
|
||||||
@echo " make install - installs this source tree directly to your Firefox profile"
|
@echo " make install - installs this source tree directly to your Firefox profile"
|
||||||
@echo ' set $$PROFILE to select a profile and $$PROFILES to change'
|
@echo ' set $$PROFILE to select a profile and $$PROFILEPATHS to change'
|
||||||
@echo ' the directory where profiles are searched for'
|
@echo ' the directory where profiles are searched'
|
||||||
@echo " make release - updates update.rdf (this is not for you)"
|
@echo " make release - updates update.rdf (this is not for you)"
|
||||||
@echo " make dist - uploads to Google Code (this is not for you)"
|
@echo " make dist - uploads to Google Code (this is not for you)"
|
||||||
@echo " make clean - clean up"
|
@echo " make clean - clean up"
|
||||||
@@ -107,14 +104,22 @@ dist: $(XPI)
|
|||||||
-i "$(GOOGLE)" | sed -n '/^Location/{p;q;}'
|
-i "$(GOOGLE)" | sed -n '/^Location/{p;q;}'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
profile=$${PROFILE:-$$(sed 's/^$$/\#/' $(PROFILES)/profiles.ini |\
|
export dir; \
|
||||||
|
for dir in $(PROFILEPATHS); do \
|
||||||
|
test -f "$$dir/profiles.ini" && break; \
|
||||||
|
done; \
|
||||||
|
profile=$${PROFILE:-$$(sed 's/^$$/\#/' "$$dir/profiles.ini" |\
|
||||||
awk -v"profile=$(PROFILE)" \
|
awk -v"profile=$(PROFILE)" \
|
||||||
'BEGIN { RS="#" } index("\n" profile "\n", $$0) || !profile && /\nDefault=1/' |\
|
'BEGIN { RS="#" } index("\n" profile "\n", $$0) || !profile && /\nDefault=1/' |\
|
||||||
awk -F= '{ args[$$1] = $$2 } \
|
awk -F= '{ args[$$1] = $$2 } \
|
||||||
END {\
|
END {\
|
||||||
if (args["IsRelative"]) print ENVIRON["PROFILES"] "/" args["Path"];\
|
if (args["IsRelative"]) print ENVIRON["dir"] "/" args["Path"];\
|
||||||
else print args["Path"]\
|
else print args["Path"]\
|
||||||
}')}; \
|
}')}; \
|
||||||
|
if ! test -d "$$profile"; then \
|
||||||
|
echo >&2 "Can't locate profile directory"; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
ext="$$profile/extensions/$(UUID)"; \
|
ext="$$profile/extensions/$(UUID)"; \
|
||||||
rm -f "$$ext.xpi"; \
|
rm -f "$$ext.xpi"; \
|
||||||
rm -rf "$$ext"; \
|
rm -rf "$$ext"; \
|
||||||
|
|||||||
@@ -2,4 +2,10 @@
|
|||||||
|
|
||||||
NAME = pentadactyl
|
NAME = pentadactyl
|
||||||
|
|
||||||
|
FIREFOX ?= firefox
|
||||||
|
HOSTAPP ?= $(FIREFOX)
|
||||||
|
PROFILEPATHS ?= "$$HOME/.mozilla/firefox" \
|
||||||
|
"$$HOME/Library/Mozilla/Firefox" \
|
||||||
|
"$$APPDATA/Mozilla/Firefox"
|
||||||
|
|
||||||
include ../common/Makefile
|
include ../common/Makefile
|
||||||
|
|||||||
Reference in New Issue
Block a user