2018-09-05 21:58:54 +02:00
|
|
|
DESTDIR ?= /
|
|
|
|
PREFIX ?= /usr
|
|
|
|
SYSCONFDIR ?= /etc
|
|
|
|
|
2019-06-15 18:00:17 +02:00
|
|
|
USR = $(DESTDIR)/$(PREFIX)
|
|
|
|
BIN = $(USR)/bin/
|
|
|
|
ETC = $(DESTDIR)/etc/
|
|
|
|
SHARE = $(USR)/share/
|
|
|
|
SYSTEMD_UNITS = $(ETC)/systemd/system/
|
|
|
|
|
2019-06-15 22:27:36 +02:00
|
|
|
all: pydoorlock/Protocol.py
|
2019-06-14 21:29:27 +02:00
|
|
|
|
|
|
|
package:
|
2019-06-15 20:00:25 +02:00
|
|
|
sed -i -r -e "s@(^SYSCONFDIR = ').*('$$)@\1$(SYSCONFDIR)\2@" pydoorlock/Config.py
|
|
|
|
sed -i -r -e "s@(^PREFIX = ').*('$$)@\1$(PREFIX)\2@" pydoorlock/Config.py
|
2018-10-16 21:23:52 +02:00
|
|
|
sed -i -r -e "s@(^__version__ = ').*('$$)@\1$(shell cat VERSION)\2@" doorlockd
|
2018-09-05 21:58:54 +02:00
|
|
|
|
2019-06-14 20:50:37 +02:00
|
|
|
pydoorlock/Protocol.py: avr-code/protocol.h
|
|
|
|
./scripts/gen_protocol.sh $^ > $@
|
|
|
|
|
2018-09-05 21:58:54 +02:00
|
|
|
install:
|
2019-06-15 18:00:17 +02:00
|
|
|
mkdir -p $(BIN)
|
|
|
|
mkdir -p $(SHARE)
|
|
|
|
mkdir -p $(SYSTEMD_UNITS)
|
|
|
|
mkdir -p $(ETC)
|
2018-09-05 21:58:54 +02:00
|
|
|
|
2019-06-15 22:27:36 +02:00
|
|
|
install doorlockd doorstate $(BIN)
|
2019-06-15 18:00:17 +02:00
|
|
|
install doorlockd-passwd $(BIN)
|
2019-06-15 18:02:15 +02:00
|
|
|
install -m 0644 etc/doorlockd.cfg $(ETC)
|
2019-06-15 18:00:17 +02:00
|
|
|
install -m 0644 systemd/doorlockd.service systemd/doorstate.service $(SYSTEMD_UNITS)
|
2018-09-05 21:58:54 +02:00
|
|
|
|
2021-10-22 23:14:00 +02:00
|
|
|
python setup.py install --root="$(DESTDIR)" --optimize=1
|
2018-10-16 21:34:45 +02:00
|
|
|
|
2019-06-15 18:00:17 +02:00
|
|
|
cp -av share/* $(SHARE)
|
2019-06-14 21:34:45 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf pydoorlock/__pycache__
|
2019-06-14 20:50:37 +02:00
|
|
|
rm -f pydoorlock/Protocol.py
|