forked from machinekoder/querierd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (32 loc) · 1.11 KB
/
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
35
36
37
38
39
40
41
42
PY_FILES = $(shell find . -type f -name '*.py')
VERSION = $(shell grep "__version__ =" querier/__init__.py | cut -d '"' -f2)
SDIST = dist/querier-$(VERSION).tar.gz
.PHONY: all sdist docker install_module install_service install uninstall_module uninstall_service uninstall
all:
@echo "Nothing to build"
$(SDIST): $(PY_FILES)
@echo "Building source distribution"
python3 setup.py sdist
docker: $(SDIST)
@echo "Building Docker image"
docker build -t igmp-querier .
install_module:
@echo "Installing Python module"
python3 setup.py install --record files.txt
install_service:
@echo "Installing QuerierD service"
cp lib/systemd/system/querierd.service /lib/systemd/system
systemctl daemon-reload
systemctl start querierd.service
systemctl enable querierd.service
install: install_module install_service
uninstall_module:
@echo "Removing Python module"
cat files.txt | xargs rm -rf
rm files.txt
uninstall_service:
@echo "Uninstalling QuerierD service"
systemctl stop querierd.service
systemctl disable querierd.service
rm /lib/systemd/system/querierd.service
uninstall: uninstall_module uninstall_service