Cleanup makefiles and curl calls

This commit is contained in:
Tristan 2022-06-07 04:06:13 +01:00
parent 60b21d9f39
commit b96c915703
No known key found for this signature in database
GPG Key ID: BDDFC4A0651ACDE4
6 changed files with 55 additions and 43 deletions

View File

@ -124,14 +124,14 @@ pkg:quictls:
artifacts: true
script: |
set -eu
PKG_VER=1.1.1o
if [ "$CI_COMMIT_REF_NAME" != "$CI_DEFAULT_BRANCH" ]; then
export PKG_VER="branch-$CI_COMMIT_REF_SLUG"
echo "Git reference $CI_COMMIT_REF_NAME is not the default branch. Setting version to $PKG_VER"
fi
curl -sS \
curl -fsSL \
-H"JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file "deps/quictls/quictls-dist.tar.gz" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/quictls/$PKG_VER/quictls.tar.gz"
@ -146,14 +146,14 @@ pkg:haproxy:
artifacts: true
script: |
set -eu
PKG_VER=2.6.0
if [ "$CI_COMMIT_REF_NAME" != "$CI_DEFAULT_BRANCH" ]; then
export PKG_VER="branch-$CI_COMMIT_REF_SLUG"
echo "Git reference $CI_COMMIT_REF_NAME is not the default branch. Setting version to $PKG_VER"
fi
curl -sS \
curl -fsSL \
-H"JOB-TOKEN: $CI_JOB_TOKEN" \
--upload-file "haproxy/haproxy-dist.tar.gz" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/haproxy/$PKG_VER/haproxy.tar.gz"

View File

@ -2,13 +2,12 @@
Build scripts for HAProxy with QUIC
**PROJECT STATUS: Alpha, __not exhaustively tested yet__**
**PROJECT STATUS: ALPHA**. Seriously, it has __not__ been well tested yet
[__TOC__]
## Quickstart
**NOTE FOR QUIC:** docker and docker-compose require explicit UDP protocol port
mapping, otherwise they assume only-TCP. See below.
```shell
docker run -it \
-v /path/to/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
@ -18,6 +17,11 @@ docker run -it \
registry.gitlab.com/mangadex-pub/haproxy:2.6-bullseye
```
## HTTP/3 and QUIC
**NOTE FOR QUIC:** docker and docker-compose require explicit UDP protocol port
mapping, otherwise they assume only-TCP. See the explicit port-mapping above.
Here's a sample configuration (requires you to figure out the certificate) to
test HTTP/3.0 support. The first connection should be over HTTP/1.1 or HTTP/2,
and

16
deps/lua/Makefile vendored
View File

@ -6,16 +6,16 @@ LUA_DESTDIR = dist
LUA_DESTDIR_ABS = $(shell realpath $(LUA_DESTDIR))
LUA_ARCHIVE = lua-dist.tar.gz
all: $(LUA_BUILDIR) $(LUA_DESTDIR) $(LUA_ARCHIVE)
all: build $(LUA_DESTDIR) $(LUA_ARCHIVE)
$(LUA_BUILDIR):
$(LUA_TARBALL):
curl -fsSL -o "$(LUA_TARBALL)" "$(LUA_SOURCES)"
$(LUA_BUILDIR): $(LUA_TARBALL)
@if ! [ -d "$(LUA_BUILDIR)" ]; then mkdir -v "$(LUA_BUILDIR)"; fi
$(LUA_BUILDIR)/lua-$(LUA_VERSION).tar.gz: $(LUA_BUILDIR)
curl -sSL -o "$(LUA_TARBALL)" "$(LUA_SOURCES)"
build: $(LUA_BUILDIR)/lua-$(LUA_VERSION).tar.gz
tar -C $(LUA_BUILDIR) --strip-components=1 -xf "$(LUA_TARBALL)"
build: $(LUA_BUILDIR)
$(MAKE) -C $(LUA_BUILDIR) -j$(shell nproc) linux
$(LUA_DESTDIR): build
@ -26,9 +26,9 @@ $(LUA_ARCHIVE): $(LUA_DESTDIR)
tar -C "$(LUA_DESTDIR)" -cjf "$(LUA_ARCHIVE)" $$(ls -1 $(LUA_DESTDIR))
clean:
rm -fv "$(LUA_TARBALL)"
rm -rf "$(LUA_BUILDIR)"
rm -rf "$(LUA_DESTDIR)"
rm -fv "$(LUA_TARBALL)"
rm -fv "$(LUA_ARCHIVE)"
.PHONY: clean build

14
deps/pcre2/Makefile vendored
View File

@ -8,14 +8,14 @@ PCRE2_ARCHIVE = pcre2-dist.tar.gz
all: build $(PCRE2_DESTDIR) $(PCRE2_ARCHIVE)
$(PCRE2_BUILDIR):
$(PCRE2_TARBALL):
curl -fsSL -o "$(PCRE2_TARBALL)" "$(PCRE2_SOURCES)"
$(PCRE2_BUILDIR): $(PCRE2_TARBALL)
@if ! [ -d "$(PCRE2_BUILDIR)" ]; then mkdir -v "$(PCRE2_BUILDIR)"; fi
$(PCRE2_BUILDIR)/pcre2-$(PCRE2_VERSION).tar.gz: $(PCRE2_BUILDIR)
curl -sSL -o "$(PCRE2_TARBALL)" "$(PCRE2_SOURCES)"
build: $(PCRE2_BUILDIR)/pcre2-$(PCRE2_VERSION).tar.gz
tar -C $(PCRE2_BUILDIR) --strip-components=1 -xf "$(PCRE2_TARBALL)"
build: $(PCRE2_BUILDIR)
if [ -f "$(PCRE2_BUILDIR)/CmakeCache.txt" ]; then rm -v "$(PCRE2_BUILDIR)/CmakeCache.txt"; fi
cd "$(PCRE2_BUILDIR)" && cmake -DPCRE2_STATIC_PIC=ON -DPCRE2_SUPPORT_JIT=ON -DCMAKE_INSTALL_PREFIX="$(PCRE2_DESTDIR_ABS)" . && make
@ -27,9 +27,9 @@ $(PCRE2_ARCHIVE): $(PCRE2_DESTDIR)
tar -C "$(PCRE2_DESTDIR)" -cjf "$(PCRE2_ARCHIVE)" $$(ls -1 $(PCRE2_DESTDIR))
clean:
rm -fv "$(PCRE2_TARBALL)"
rm -rf "$(PCRE2_BUILDIR)"
rm -rf "$(PCRE2_DESTDIR)"
rm -fv "$(PCRE2_TARBALL)"
rm -fv "$(PCRE2_ARCHIVE)"
.PHONY: clean build

16
deps/quictls/Makefile vendored
View File

@ -6,16 +6,16 @@ QUICTLS_DESTDIR = dist
QUICTLS_DESTDIR_ABS = $(shell realpath $(QUICTLS_DESTDIR))
QUICTLS_ARCHIVE = quictls-dist.tar.gz
all: $(QUICTLS_DESTDIR) $(QUICTLS_ARCHIVE)
all: build $(QUICTLS_DESTDIR) $(QUICTLS_ARCHIVE)
$(QUICTLS_BUILDIR):
$(QUICTLS_TARBALL):
curl -sfS -o "$(QUICTLS_TARBALL)" "$(QUICTLS_SOURCES)"
$(QUICTLS_BUILDIR): $(QUICTLS_TARBALL)
@if ! [ -d "$(QUICTLS_BUILDIR)" ]; then mkdir -v "$(QUICTLS_BUILDIR)"; fi
$(QUICTLS_BUILDIR)/quictls-$(QUICTLS_VERSION).tar.gz: $(QUICTLS_BUILDIR)
curl -sSL -o "$(QUICTLS_TARBALL)" "$(QUICTLS_SOURCES)"
build: $(QUICTLS_BUILDIR)/quictls-$(QUICTLS_VERSION).tar.gz
tar -C $(QUICTLS_BUILDIR) --strip-components=1 -xf "$(QUICTLS_TARBALL)"
build: $(QUICTLS_BUILDIR)
cd "$(QUICTLS_BUILDIR)" && ./config --prefix="/opt/quictls" --openssldir="/opt/quictls" no-shared
$(MAKE) -C "$(QUICTLS_BUILDIR)" -j "$(shell nproc)"
ldd "$(QUICTLS_BUILDIR)/apps/openssl" || true
@ -30,9 +30,9 @@ $(QUICTLS_ARCHIVE): $(QUICTLS_DESTDIR)
tar -C "$(QUICTLS_DESTDIR)" -cjf "$(QUICTLS_ARCHIVE)" "opt"
clean:
rm -fv "$(QUICTLS_TARBALL)"
rm -rf "$(QUICTLS_BUILDIR)"
rm -rf "$(QUICTLS_DESTDIR)"
rm -rf "$(QUICTLS_TARBALL)"
rm -fv "$(QUICTLS_ARCHIVE)"
.PHONY: clean build

View File

@ -1,6 +1,9 @@
HAPROXY_VERSION = 2.6
HAPROXY_REPOSRC = http://git.haproxy.org/git/haproxy-$(HAPROXY_VERSION).git
HAPROXY_VERSION = 2.6.0
HAPROXY_VERSION_TAG = v$(HAPROXY_VERSION)
HAPROXY_VERSION_MINOR = $(shell echo "$(HAPROXY_VERSION)" | cut -d'.' -f1-2)
HAPROXY_SOURCES = https://git.haproxy.org/?p=haproxy-$(HAPROXY_VERSION_MINOR).git;a=snapshot;h=$(HAPROXY_VERSION_TAG);sf=tgz
HAPROXY_TARBALL = haproxy-$(HAPROXY_VERSION).tar.gz
HAPROXY_BUILDIR = src
HAPROXY_DESTDIR = dist
HAPROXY_DESTDIR_ABS = $(shell realpath $(HAPROXY_DESTDIR))
@ -41,16 +44,20 @@ HAPROXY_MAKE_ARGS := DEBUG="-DDEBUG_STRICT -DDEBUG_MEMORY_POOLS" \
USE_TFO=1 \
USE_SYSTEMD=1
all: build $(HAPROXY_DESTDIR) $(HAPROXY_ARCHIVE)
all: dist-bin
$(HAPROXY_BUILDIR):
git clone "$(HAPROXY_REPOSRC)" $(HAPROXY_BUILDIR)
git -C "$(HAPROXY_BUILDIR)" checkout "master"
dist-bin: build $(HAPROXY_DESTDIR) $(HAPROXY_ARCHIVE)
$(HAPROXY_TARBALL):
curl -sfS -o "$(HAPROXY_TARBALL)" "$(HAPROXY_SOURCES)"
$(HAPROXY_BUILDIR): $(HAPROXY_TARBALL)
@if ! [ -d "$(HAPROXY_BUILDIR)" ]; then mkdir -v "$(HAPROXY_BUILDIR)"; fi
tar -C "$(HAPROXY_BUILDIR)" --strip-components=1 -xf "$(HAPROXY_TARBALL)"
build: $(HAPROXY_BUILDIR)
make -C "$(HAPROXY_BUILDIR)" -j "$(shell nproc)" clean
make -C "$(HAPROXY_BUILDIR)" -j "$(shell nproc)" $(HAPROXY_MAKE_ARGS) opts
make -C "$(HAPROXY_BUILDIR)" -j "$(shell nproc)" $(HAPROXY_MAKE_ARGS)
$(MAKE) -C "$(HAPROXY_BUILDIR)" -j "$(shell nproc)" $(HAPROXY_MAKE_ARGS) opts
$(MAKE) -C "$(HAPROXY_BUILDIR)" -j "$(shell nproc)" $(HAPROXY_MAKE_ARGS)
$(HAPROXY_DESTDIR):
@if ! [ -d "$(HAPROXY_DESTDIR)" ]; then mkdir -v "$(HAPROXY_DESTDIR)"; fi
@ -60,8 +67,9 @@ $(HAPROXY_ARCHIVE): $(HAPROXY_DESTDIR)
tar -C "$(HAPROXY_DESTDIR)" -cjf "$(HAPROXY_ARCHIVE)" "usr"
clean:
rm -fv "$(HAPROXY_TARBALL)"
rm -rf "$(HAPROXY_BUILDIR)"
rm -rf "$(HAPROXY_DESTDIR)"
rm -fv "$(HAPROXY_ARCHIVE)"
.PHONY: clean build $(HAPROXY_DESTDIR)
.PHONY: clean build