mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-12 15:23:08 -05:00
SCRIPTS: build-vtest: allow to set a TMPDIR and a DESTDIR
Implement a way to set a destination directory using DESTDIR, and a tmp directory using TMPDIR. By default: - DESTDIR is ../vtest like it was done previously - TMPDIR is mktemp -d Only the vtest binary is copied in DESTDIR. Example: TMPDIR=/dev/shm/ DESTDIR=/home/user/.local/bin/ ./scripts/build-vtest.sh
This commit is contained in:
parent
d13164e105
commit
f47b800ac3
1 changed files with 9 additions and 4 deletions
|
|
@ -1,10 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
DESTDIR=${DESTDIR:-${PWD}/../vtest/}
|
||||
TMPDIR=${TMPDIR:-$(mktemp -d)}
|
||||
set -eux
|
||||
|
||||
curl -fsSL https://github.com/vtest/VTest2/archive/main.tar.gz -o VTest.tar.gz
|
||||
mkdir ../vtest
|
||||
tar xvf VTest.tar.gz -C ../vtest --strip-components=1
|
||||
curl -fsSL https://github.com/vtest/VTest2/archive/main.tar.gz -o "${TMPDIR}/VTest.tar.gz"
|
||||
mkdir -p "${TMPDIR}/vtest"
|
||||
tar xvf ${TMPDIR}/VTest.tar.gz -C "${TMPDIR}/vtest" --strip-components=1
|
||||
# Special flags due to: https://github.com/vtest/VTest/issues/12
|
||||
|
||||
# Note: do not use "make -C ../vtest", otherwise MAKEFLAGS contains "w"
|
||||
|
|
@ -13,7 +15,7 @@ tar xvf VTest.tar.gz -C ../vtest --strip-components=1
|
|||
# MFLAGS works on BSD but misses variable definitions on GNU Make.
|
||||
# Better just avoid the -C and do the cd ourselves then.
|
||||
|
||||
cd ../vtest
|
||||
cd "${TMPDIR}/vtest"
|
||||
|
||||
set +e
|
||||
CPUS=${CPUS:-$(nproc 2>/dev/null)}
|
||||
|
|
@ -28,3 +30,6 @@ if test -f /opt/homebrew/include/pcre2.h; then
|
|||
else
|
||||
make -j${CPUS} FLAGS="-O2 -s -Wall"
|
||||
fi
|
||||
|
||||
mkdir -p "${DESTDIR}"
|
||||
cp "${TMPDIR}/vtest/vtest" "${DESTDIR}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue