-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (29 loc) · 865 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SHELL := /bin/bash
mkfile_dir := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
.PHONY: setup
setup:
stat venv/bin/activate &> /dev/null || \
python3 -m venv venv
source venv/bin/activate; \
pip install -r requirements.txt
.PHONY: install
install:
sudo sed "s|{{DIR}}|$(mkfile_dir)|g" \
labelcommander.service \
> /lib/systemd/system/labelcommander.service
sudo chmod 644 /lib/systemd/system/labelcommander.service
sudo systemctl daemon-reload
sudo systemctl enable labelcommander.service
sudo systemctl start labelcommander
sudo systemctl status labelcommander
.PHONY: uninstall
uninstall:
sudo systemctl stop labelcommander
sudo systemctl disable labelcommander.service
sudo rm /lib/systemd/system/labelcommander.service
sudo systemctl daemon-reload
.PHONY: run
run:
source venv/bin/activate; \
source env.sh; \
python run.py