osi-tools/runtests

84 lines
2.8 KiB
Plaintext
Raw Normal View History

2018-08-12 02:26:38 +00:00
#!/usr/bin/make -f
2018-08-06 01:49:45 +00:00
# 2018 Luke Shumaker
2018-08-06 00:09:42 +00:00
2018-08-12 02:26:38 +00:00
# Runtime/user options##########################################################
GITREV ?= systemd/master
WORKDIR ?= $(CURDIR)/workdir
2018-08-06 00:09:42 +00:00
2018-08-12 02:26:38 +00:00
# Configure Make ###############################################################
.ONESHELL:
SHELL = bash -eE -o pipefail
.DELETE_ON_ERROR:
.SECONDARY:
.DEFAULT_GOAL = all
2018-08-12 02:26:38 +00:00
################################################################################
.PHONY: FORCE
${WORKDIR}/systemd.git: FORCE
mkdir -p -- '$(@D)'
gitget bare https://git.parabola.nu/~lukeshu/systemd.git '$@'
test -d '$@'
touch '$@'
${WORKDIR}/.COMMIT.mk: ${WORKDIR}/systemd.git
cd $< && git rev-parse --verify '${GITREV}' | sed 's/^/COMMIT=/' | ./write-ifchanged '$@'
-include ${WORKDIR}/.COMMIT.mk
# Build systemd 232
${WORKDIR}/build-232/build.raw: osi-mk.d/libretools.sh
${WORKDIR}/build-232/build.raw: osi-mk.d/builddeps.sh
${WORKDIR}/build-232/build.raw: osi-mk.d/systemd-dhcpcd.sh
${WORKDIR}/build-232/build.raw: osi-mk.d/systemd-osi-run.sh
${WORKDIR}/build-232/build.raw: abs/systemd-232 $(wildcard abs/systemd-232/*)
${WORKDIR}/build-232/build.raw: | ${WORKDIR}/systemd.git
${WORKDIR}/build-232/build.raw:
rm -f -- '$@'
mkdir -p -- '$(@D)'
2018-08-06 01:56:44 +00:00
./osi-mk \
2018-08-10 00:22:41 +00:00
--size=4G \
2018-08-06 01:49:45 +00:00
--package='base' \
2018-08-12 02:26:38 +00:00
$(addpreix --module=,$(filter osi-mk.d/%.sh,$^)) \
2018-08-06 01:56:44 +00:00
--directory="$workdir/systemd.git:/home/testuser/packages/srcdest/systemd" \
2018-08-10 00:22:41 +00:00
--directory="abs/systemd-232:/home/testuser/packages/abs/systemd" \
2018-08-12 02:26:38 +00:00
'$@'
${WORKDIR}/build-232/build.log: %/build.log: %/build.raw
./osi-run '$<' <<-EOF | tee '$@'
2018-08-06 00:09:42 +00:00
#!/usr/bin/env bash
set -ex
2018-08-10 00:22:41 +00:00
cd ~/packages/abs/systemd
script --return --quiet --command 'sudo libremakepkg' /dev/null
EOF
2018-08-12 02:26:38 +00:00
all: ${WORKDIR}/build-232/pkgdest
2018-08-06 04:02:37 +00:00
2018-08-12 02:26:38 +00:00
# Build the code under under test
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/libretools.sh
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/builddeps.sh
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/systemd-dhcpcd.sh
${WORKDIR}/build-$(COMMIT)/build.raw: osi-mk.d/systemd-osi-run.sh
${WORKDIR}/build-$(COMMIT)/build.raw: abs/systemd $(wildcard abs/systemd/*)
${WORKDIR}/build-$(COMMIT)/build.raw: | ${WORKDIR}/systemd.git
rm -f -- '$@'
mkdir -p -- '$(@D)'
2018-08-10 00:22:41 +00:00
./osi-mk \
--size=4G \
--package='base' \
2018-08-12 02:26:38 +00:00
$(addpreix --module=,$(filter osi-mk.d/%.sh,$^)) \
2018-08-10 00:22:41 +00:00
--directory="$workdir/systemd.git:/home/testuser/packages/srcdest/systemd" \
--directory="abs/systemd:/home/testuser/packages/abs/systemd" \
2018-08-12 02:26:38 +00:00
'$@'
${WORKDIR}/build-$(COMMIT)/build.log: %/build.log: %/build.raw
./osi-run '$<' <<-EOF | tee '$@'
2018-08-10 00:22:41 +00:00
#!/usr/bin/env bash
set -ex
2018-08-06 00:09:42 +00:00
cd ~/packages/abs/systemd
sed 's:@COMMIT@:${COMMIT}:' < PKGBUILD.in > PKGBUILD
2018-08-10 00:22:41 +00:00
script --return --quiet --command 'sudo libremakepkg' /dev/null
2018-08-06 00:09:42 +00:00
EOF
2018-08-12 02:26:38 +00:00
all: ${WORKDIR}/build-$(COMMIT)/pkgdest
%/pkgdest: %/build.log
rm -rf -- '$@'
./osi-extract '$*/build.raw' /home/testuser/packages/pkgdest '$@'