alfred-yubico-auth/Makefile

49 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2017-08-07 17:27:29 +00:00
.PHONY: default
default: run
2018-04-12 22:55:55 +00:00
.PHONY: build
build: venv install-ports
2017-08-07 17:27:29 +00:00
2018-04-12 22:55:55 +00:00
.PHONY: install
install: venv
./replace-workflow.sh
2017-08-07 17:27:29 +00:00
2018-04-12 22:55:55 +00:00
Yauth.alfredWorkflow: venv
mkdir Yauth.alfredWorkflow
cp -r alfred_yauth Yauth.alfredworkflow/
cp -r venv Yauth.alfredWorkflow/
cp info.plist Yauth.alfredWorkflow/
cp icon.png Yauth.alfredWorkflow/
2017-08-07 17:27:29 +00:00
2018-04-12 22:55:55 +00:00
# Installs required MacPorts
.PHONY: install-ports
install-ports:
sudo port install swig swig-python ykpers libu2f-host libusb
2017-08-07 17:27:29 +00:00
2018-04-12 22:55:55 +00:00
# Creates venv using MacPorts Python (Required for it to refrence libusb)
venv:
virtualenv --python=/opt/local/bin/python2.7 venv
./venv/bin/pip install -r ./requirements.txt
2017-08-07 17:27:29 +00:00
2018-04-12 22:55:55 +00:00
# Simple execution of the workflow to see all results
.PHONY: run
run: venv
@./venv/bin/python -m alfred_yauth.main
2017-08-07 17:27:29 +00:00
2018-04-12 22:55:55 +00:00
# Runs workflow and prompts for Yubikey password
.PHONY: set-password
set-password: venv
@./venv/bin/python -m alfred_yauth.main set-password
2017-08-07 17:27:29 +00:00
# Clears the virtualenv and other installed files
.PHONY: clean
clean:
2018-04-12 22:55:55 +00:00
rm -fr venv Yauth.alfredWorkflow
2017-08-07 17:27:29 +00:00
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
# Install precommit hooks
.PHONY: intall-hooks
install-hooks:
tox -e pre-commit -- install -f --install-hooks