summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorxengineering <mail2xengineering@protonmail.com>2020-10-29 12:11:32 +0100
committerxengineering <mail2xengineering@protonmail.com>2020-10-29 12:15:46 +0100
commit84b9ddcc2905f5d8667cfef1359b724c23d27365 (patch)
tree4e5a4c9ba39d8ec8c1a63a2bda4d7e9fc402ae40 /Makefile
parent56503ecf9bccd9a318142e2946f84e5f57be5eeb (diff)
downloadiot-barcode-scanner-84b9ddcc2905f5d8667cfef1359b724c23d27365.tar
iot-barcode-scanner-84b9ddcc2905f5d8667cfef1359b724c23d27365.tar.zst
iot-barcode-scanner-84b9ddcc2905f5d8667cfef1359b724c23d27365.zip
Setup basic Systemd Units
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 77c7fcf..895cb38 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
-PKGNAME=iot_barcode_scanner
+PKGNAME=iot_barcode
PREFIX=/usr
INSTALL=install
INSTALL_PROGRAM=$(INSTALL) -m 755
@@ -8,8 +8,9 @@ INSTALL_DATA=$(INSTALL) -m 644
bindir=$(DESTDIR)$(PREFIX)/bin
sharedir=$(DESTDIR)$(PREFIX)/share
-confdir=$(DESTDIR)/etc/xengineering.eu/$(PKGNAME)
+confdir=$(DESTDIR)/etc/$(PKGNAME)
libdir=$(DESTDIR)$(PREFIX)/lib/python3/dist-packages/$(PKGNAME)
+systemddir=$(DESTDIR)/lib/systemd/system
.PHONY: install uninstall
@@ -19,20 +20,24 @@ install:
# install executables
mkdir -p $(bindir)
- $(INSTALL_PROGRAM) barcode_scanner_daemon.py $(bindir)/eu.xengineering.$(PKGNAME).scanner
- $(INSTALL_PROGRAM) barcode_transmit_daemon.py $(bindir)/eu.xengineering.$(PKGNAME).transmitter
+ $(INSTALL_PROGRAM) iot_barcode_device_handler $(bindir)/
+ $(INSTALL_PROGRAM) iot_barcode_daemon $(bindir)/
# install library / package
mkdir -p $(libdir)/
- $(INSTALL_DATA) iot_barcode_scanner/__init__.py $(libdir)/__init__.py
- $(INSTALL_DATA) iot_barcode_scanner/config.py $(libdir)/config.py
- $(INSTALL_DATA) iot_barcode_scanner/mqtt.py $(libdir)/mqtt.py
- $(INSTALL_DATA) iot_barcode_scanner/static.py $(libdir)/static.py
+ $(INSTALL_DATA) iot_barcode/__init__.py $(libdir)/__init__.py
+ $(INSTALL_DATA) iot_barcode/config.py $(libdir)/config.py
+ $(INSTALL_DATA) iot_barcode/mqtt.py $(libdir)/mqtt.py
+ $(INSTALL_DATA) iot_barcode/static.py $(libdir)/static.py
# install config file
mkdir -p $(confdir)/
$(INSTALL_DATA) config.json $(confdir)/config.json
+ # install systemd unit files
+ $(INSTALL_DATA) iot-barcode.service $(systemddir)/
+ $(INSTALL_DATA) iot-barcode-device-handler.service $(systemddir)/
+
# install license
mkdir -p $(sharedir)/licenses/
$(INSTALL_DATA) LICENSE $(sharedir)/licenses/$(PKGNAME)
@@ -40,10 +45,12 @@ install:
uninstall:
- rm -f $(bindir)/eu.xengineering.$(PKGNAME).scanner
- rm -f $(bindir)/eu.xengineering.$(PKGNAME).transmitter
+ rm -f $(bindir)/iot_barcode_device_handler
+ rm -f $(bindir)/iot_barcode_daemon
rm -f $(libdir)/__init__.py
rm -f $(libdir)/config.py
rm -f $(libdir)/mqtt.py
rm -f $(libdir)/static.py
+ rm -f $(systemddir)/iot-barcode.service
+ rm -f $(systemddir)/iot-barcode-device-handler.service
rm -f $(sharedir)/licenses/$(PKGNAME)