2023-10-28 20:37:09 +00:00
|
|
|
# Copyright (C) 2023 Umorpha Systems
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
|
|
|
export osi_tools = $(CURDIR)/../notsystemd-tests
|
|
|
|
PATH := $(osi_tools):$(PATH)
|
|
|
|
|
|
|
|
all: $(patsubst boxes/%.sh,out/%.img,$(wildcard boxes/*.sh))
|
|
|
|
.PHONY: all
|
|
|
|
|
|
|
|
deps.mk: boxes $(wildcard boxes/*.sh) | out
|
|
|
|
grep -H -o -e '--module=\S*' boxes/*.sh | sed -E 's,boxes/([^:]*).sh:--module=(.*),out/\1.img: \2,' >$@
|
|
|
|
-include deps.mk
|
|
|
|
|
2023-10-31 16:26:46 +00:00
|
|
|
images/%.img: images/%.sh
|
2023-10-28 20:37:09 +00:00
|
|
|
rm -f $@
|
|
|
|
$< $@
|
2023-10-28 22:12:25 +00:00
|
|
|
chmod 444 $@
|
|
|
|
|
2023-10-31 16:26:46 +00:00
|
|
|
run/%: images/%.img
|
|
|
|
rm -f images/$*.tmp.img
|
|
|
|
cp --reflink $< images/$*.tmp.img
|
|
|
|
chmod 600 images/$*.tmp.img
|
|
|
|
qemu-system-x86_64 -accel kvm -m 2G -hda images/$*.tmp.img -net user,hostfwd=tcp::8022-:22,hostfwd=tcp::8080-:80 -net nic
|
|
|
|
rm -f images/$*.tmp.img
|
2023-10-28 22:12:25 +00:00
|
|
|
.PHONY: run/%
|
2023-10-28 20:37:09 +00:00
|
|
|
|
2023-10-31 16:26:46 +00:00
|
|
|
modules/service-gitea.sh: modules/service-gitea.sh.in
|
|
|
|
modules/service-gitea.sh: secrets/gitea-infomaniak-clientid.txt
|
|
|
|
modules/service-gitea.sh: secrets/gitea-infomaniak-clientsecret.txt
|
|
|
|
sed \
|
|
|
|
-e "s,@CLIENT_ID@,$$(cat secrets/gitea-infomaniak-clientid.txt),g" \
|
|
|
|
-e "s,@CLIENT_SECRET@,$$(cat secrets/gitea-infomaniak-clientsecret.txt),g" \
|
|
|
|
<$< >$@
|
|
|
|
|
2023-10-28 20:37:09 +00:00
|
|
|
.SECONDARY:
|
|
|
|
.DELETE_ON_ERROR:
|