From e495e11e3be48033a8b7fb670bada0d89f332708 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Thu, 23 Aug 2018 14:28:24 +1000 Subject: [PATCH 1/4] Makefile fixes * Move to the root of the repo * Make the install script executable * Add install targets to the Makefile (defaults to install-unix, install-windows not actually tested) * Update doc Signed-off-by: Olivier Mehani --- src/Makefile => Makefile | 15 ++++++++++++--- README.md | 11 +++++------ 2 files changed, 17 insertions(+), 9 deletions(-) rename src/Makefile => Makefile (70%) diff --git a/src/Makefile b/Makefile similarity index 70% rename from src/Makefile rename to Makefile index ef32226..5a699d3 100644 --- a/src/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -VERSION := testing +VERSION ?= testing +BROWSER ?= firefox -SRC_DIR := . -TARGET_DIR := ../bin/$(VERSION) +SRC_DIR := ./src +TARGET_DIR := ./bin/$(VERSION) INSTALL_WIN_FILE := install_host_app.bat INSTALL_WIN_SRC := $(SRC_DIR)/$(INSTALL_WIN_FILE) @@ -20,12 +21,20 @@ HOST_TARGETS := $(INSTALL_WIN_TARGET) $(INSTALL_UNIX_TARGET) $(HOST_APP_TARGET) all: $(HOST_TARGETS) +install: install-unix +install-unix: $(HOST_TARGETS) + $(INSTALL_UNIX_TARGET) --local $(BROWSER) +install-win: $(HOST_TARGETS) + $(INSTALL_UNIX_TARGET) --local $(BROWSER) + %/.d: mkdir -p $(@D) @touch $@ $(HOST_TARGETS): $(TARGET_DIR)/%: $(SRC_DIR)/% $(TARGET_DIR)/.d sed -e "s/_VERSIONHOLDER_/$(VERSION)/g" < $(SRC_DIR)/$* > $@ + # Make install script executable + echo $@ | grep -vq '.sh$$' || chmod a+x $@ clean: rm -rf $(TARGET_DIR) diff --git a/README.md b/README.md index 9da928b..b0b6454 100644 --- a/README.md +++ b/README.md @@ -44,16 +44,15 @@ Note: Older Windows versions might require powershell to be installed manually a #### Latest from GitHub This is not recommended! Only for developers and for testing purposes! -Clone the repository. Then, from the project's `src/` directory, run `make` and execute the installation script in `bin/testing` for your desired browser (`firefox`, `chrome`, `opera`, `chromium`, or `vivaldi`): +Clone the repository. Then, run the following command. ``` -$ cd ./src -$ make -$ cd ../bin/testing -$ ./install_host_app.sh --local [firefox|chrome|opera|chromium|vivaldi] +$ make [VERSION=testing|...] [BROWSER=firefox|chrome|opera|chromium|vivaldi] install ``` -This will copy the host application and manifest files to the right place for your browser. The `--local` option makes the script use the files on disk rather than downloading them from GitHub. +This will generate the host application and installation scripts for the given `VERSION` (`testing` by default), and copy the host application and manifest files to the right place for your `BROWSER` (`firefox` by default). + +This uses the `--local` option of the the `install_host_app.sh` script, which instructs it to use the files on disk rather than downloading them from GitHub. If this doesn't work, you can link the files yourself. First, change the `path` value in the `passff.json` file to be the absolute path to the project's `bin/testing/passff.py` file. Then symlink (or copy) the file `bin/testing/passff.json` to the appropriate location for your browser and OS: From e1b2bc7c4142ee36aebfb9bfff1c14731969463d Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Thu, 23 Aug 2018 22:37:15 +1000 Subject: [PATCH 2/4] fixup! Makefile fixes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0b6454..0863cb7 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ $ make [VERSION=testing|...] [BROWSER=firefox|chrome|opera|chromium|vivaldi] ins This will generate the host application and installation scripts for the given `VERSION` (`testing` by default), and copy the host application and manifest files to the right place for your `BROWSER` (`firefox` by default). -This uses the `--local` option of the the `install_host_app.sh` script, which instructs it to use the files on disk rather than downloading them from GitHub. +This uses the `--local` option of the `install_host_app.sh` script, which instructs it to use the files on disk rather than downloading them from GitHub. If this doesn't work, you can link the files yourself. First, change the `path` value in the `passff.json` file to be the absolute path to the project's `bin/testing/passff.py` file. Then symlink (or copy) the file `bin/testing/passff.json` to the appropriate location for your browser and OS: From 5efd2a9320a81b6bcc97828ca8de746a60c3b6eb Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Mon, 10 Sep 2018 08:33:00 +1000 Subject: [PATCH 3/4] fixup! fixup! Makefile fixes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a699d3..57abc8b 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ install: install-unix install-unix: $(HOST_TARGETS) $(INSTALL_UNIX_TARGET) --local $(BROWSER) install-win: $(HOST_TARGETS) - $(INSTALL_UNIX_TARGET) --local $(BROWSER) + $(INSTALL_WIN_TARGET) --local $(BROWSER) %/.d: mkdir -p $(@D) From 8d9dd7a9c34c1870abd62b2f18465743cd8ffdc9 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 12 Sep 2018 11:46:25 +1000 Subject: [PATCH 4/4] fixup! fixup! fixup! Makefile fixes --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 57abc8b..3ca1a9e 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,8 @@ install-win: $(HOST_TARGETS) $(HOST_TARGETS): $(TARGET_DIR)/%: $(SRC_DIR)/% $(TARGET_DIR)/.d sed -e "s/_VERSIONHOLDER_/$(VERSION)/g" < $(SRC_DIR)/$* > $@ - # Make install script executable - echo $@ | grep -vq '.sh$$' || chmod a+x $@ + # Make scripts executable + echo $@ | grep -vq '\(\.sh\|\.py\)$$' || chmod a+x $@ clean: rm -rf $(TARGET_DIR)