From f3efe9c0eeff5f79b6a9515cff796e434c04ec33 Mon Sep 17 00:00:00 2001 From: Domen Tabernik Date: Mon, 27 Jul 2020 18:17:11 +0200 Subject: [PATCH] Reorganized dir structure --- Makefile | 16 +++++++++------- .../superfans-gpu-controller.json | 0 .../superfans-gpu-controller.service.template | 0 setup.py => python/setup.py | 0 superfans.py => python/superfans.py | 0 .../superfans_gpu_controller.py | 0 6 files changed, 9 insertions(+), 7 deletions(-) rename superfans-gpu-controller.json => etc/superfans-gpu-controller.json (100%) rename superfans-gpu-controller.service.template => etc/systemd/superfans-gpu-controller.service.template (100%) rename setup.py => python/setup.py (100%) rename superfans.py => python/superfans.py (100%) rename superfans_gpu_controller.py => python/superfans_gpu_controller.py (100%) diff --git a/Makefile b/Makefile index 5d7f42f..bf9a73d 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,18 @@ service_dir=/etc/systemd/system conf_dir=/etc awk_script='BEGIN {FS="="; OFS="="}{if ($$1=="ExecStart") {$$2=exec_path} if (substr($$1,1,1) != "\#") {print $$0}}' -superfans-gpu-controller: superfans_gpu_controller.py setup.py - pip3 install . +src_python_dir=python -superfans-gpu-controller.service: superfans_gpu_controller.py +superfans-gpu-controller: $(src_python_dir)/superfans_gpu_controller.py $(src_python_dir)/setup.py + pip3 install $(src_python_dir)/. + +superfans-gpu-controller.service: $(src_python_dir)/superfans_gpu_controller.py # awk is needed to replace the absolute path of mydaemon executable in the .service file - awk -v exec_path='$(shell which superfans-gpu-controller) $(conf_dir)/superfans-gpu-controller.json' $(awk_script) superfans-gpu-controller.service.template > superfans-gpu-controller.service + awk -v exec_path='$(shell which superfans-gpu-controller) $(conf_dir)/superfans-gpu-controller.json' $(awk_script) etc/systemd/system/superfans-gpu-controller.service.template > etc/systemd/system/superfans-gpu-controller.service install: $(service_dir) $(conf_dir) superfans-gpu-controller.service - cp superfans-gpu-controller.json $(conf_dir) - cp superfans-gpu-controller.service $(service_dir) + cp etc/superfans-gpu-controller.json $(conf_dir) + cp etc/systemd/system/superfans-gpu-controller.service $(service_dir) -systemctl enable superfans-gpu-controller.service -systemctl enable superfans-gpu-controller @@ -24,4 +26,4 @@ uninstall: -rm -r $(conf_dir)/superfans-gpu-controller.json clean: - -rm superfans-gpu-controller.service + -rm etc/systemd/system/superfans-gpu-controller.service diff --git a/superfans-gpu-controller.json b/etc/superfans-gpu-controller.json similarity index 100% rename from superfans-gpu-controller.json rename to etc/superfans-gpu-controller.json diff --git a/superfans-gpu-controller.service.template b/etc/systemd/superfans-gpu-controller.service.template similarity index 100% rename from superfans-gpu-controller.service.template rename to etc/systemd/superfans-gpu-controller.service.template diff --git a/setup.py b/python/setup.py similarity index 100% rename from setup.py rename to python/setup.py diff --git a/superfans.py b/python/superfans.py similarity index 100% rename from superfans.py rename to python/superfans.py diff --git a/superfans_gpu_controller.py b/python/superfans_gpu_controller.py similarity index 100% rename from superfans_gpu_controller.py rename to python/superfans_gpu_controller.py