From 6b0f2bb6377c821a908d0b3e60d18e15ff7eee8b Mon Sep 17 00:00:00 2001 From: Guo-Rong Koh <5484552+gkoh@users.noreply.github.com> Date: Sun, 18 Feb 2024 08:00:22 +0000 Subject: [PATCH] caddy: add version 2.7.6 to extra.omnios Add v2.7.6 of the Caddy web server. Add patch to fix Solaris-derivative build. Comes from caddy master:76611fa15079b755ddf3c859ae2ea0ad2123223f and this PR 6021: https://github.com/caddyserver/caddy/pull/6021 --- build/caddy/build.sh | 52 +++++++++++++++++++ build/caddy/local.mog | 13 +++++ ...is-derivatives-away-from-listen_unix.patch | 36 +++++++++++++ build/caddy/patches/series | 1 + doc/baseline | 1 + doc/packages.md | 1 + 6 files changed, 104 insertions(+) create mode 100755 build/caddy/build.sh create mode 100644 build/caddy/local.mog create mode 100644 build/caddy/patches/0001-Switch-Solaris-derivatives-away-from-listen_unix.patch create mode 100644 build/caddy/patches/series diff --git a/build/caddy/build.sh b/build/caddy/build.sh new file mode 100755 index 000000000..f69160864 --- /dev/null +++ b/build/caddy/build.sh @@ -0,0 +1,52 @@ +#!/usr/bin/bash +# +# {{{ CDDL HEADER +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# }}} + +# Copyright 2024 Guo-Rong Koh + +. ../../lib/build.sh + +PROG=caddy +VER=2.7.6 +PKG=ooce/server/caddy +SUMMARY="Caddy web server" +DESC="Fast and extensible multi-platform HTTP/1-2-3 web server with automatic \ +HTTPS" + +set_arch amd64 +set_gover + +build() { + pushd $TMPDIR/$BUILDDIR > /dev/null + + logmsg "Building $PROG" + export CGO_ENABLED=0 + export GOOS=illumos + + logcmd go build -o caddy cmd/caddy/main.go || logerr "Unable to build $PROG" + + popd >/dev/null +} + +# create package functions +init +clone_go_source $PROG caddyserver v$VER +patch_source +prep_build +build +install_go $PROG +make_package +clean_up + +# Vim hints +# vim:ts=4:sw=4:et:fdm=marker diff --git a/build/caddy/local.mog b/build/caddy/local.mog new file mode 100644 index 000000000..62999ce78 --- /dev/null +++ b/build/caddy/local.mog @@ -0,0 +1,13 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. + +# Copyright 2024 Guo-Rong Koh + +license LICENSE license=Apache2 diff --git a/build/caddy/patches/0001-Switch-Solaris-derivatives-away-from-listen_unix.patch b/build/caddy/patches/0001-Switch-Solaris-derivatives-away-from-listen_unix.patch new file mode 100644 index 000000000..bde20b391 --- /dev/null +++ b/build/caddy/patches/0001-Switch-Solaris-derivatives-away-from-listen_unix.patch @@ -0,0 +1,36 @@ +diff --git a/listen.go b/listen.go +index 0cd3fabb..34812b54 100644 +--- a/listen.go ++++ b/listen.go +@@ -12,7 +12,7 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + +-//go:build !unix ++//go:build !unix || solaris + + package caddy + +diff --git a/listen_unix.go b/listen_unix.go +index 34cd76c5..9ec65c39 100644 +--- a/listen_unix.go ++++ b/listen_unix.go +@@ -15,7 +15,7 @@ + // Even though the filename ends in _unix.go, we still have to specify the + // build constraint here, because the filename convention only works for + // literal GOOS values, and "unix" is a shortcut unique to build tags. +-//go:build unix ++//go:build unix && !solaris + + package caddy + +diff --git a/listen_unix_setopt.go b/listen_unix_setopt.go +index c9675f92..13ee7b83 100644 +--- a/listen_unix_setopt.go ++++ b/listen_unix_setopt.go +@@ -1,4 +1,4 @@ +-//go:build unix && !freebsd ++//go:build unix && !freebsd && !solaris + + package caddy + diff --git a/build/caddy/patches/series b/build/caddy/patches/series new file mode 100644 index 000000000..09fd46b6b --- /dev/null +++ b/build/caddy/patches/series @@ -0,0 +1 @@ +0001-Switch-Solaris-derivatives-away-from-listen_unix.patch diff --git a/doc/baseline b/doc/baseline index 5a451d756..0f3101e91 100644 --- a/doc/baseline +++ b/doc/baseline @@ -230,6 +230,7 @@ extra.omnios ooce/server/apache-24 extra.omnios ooce/server/apache-24/modules/fcgid extra.omnios ooce/server/apache-24/modules/subversion extra.omnios ooce/server/apache-24/modules/wsgi +extra.omnios ooce/server/caddy extra.omnios ooce/server/freeradius extra.omnios ooce/server/haproxy extra.omnios ooce/server/nginx diff --git a/doc/packages.md b/doc/packages.md index db2cd2144..7a849e50c 100644 --- a/doc/packages.md +++ b/doc/packages.md @@ -189,6 +189,7 @@ | ooce/server/apache-24 | 2.4.58 | https://downloads.apache.org/httpd/ | [omniosorg](https://github.com/omniosorg) | ooce/server/apache-24/modules/fcgid | 2.3.9 | https://downloads.apache.org/httpd/mod_fcgid/ | [omniosorg](https://github.com/omniosorg) | ooce/server/apache-24/modules/wsgi | 5.0.0 | https://github.com/GrahamDumpleton/mod_wsgi/tags/ | [cgrzemba](https://github.com/cgrzemba) +| ooce/server/caddy | 2.7.6 | https://github.com/caddyserver/caddy/releases | [gkoh](https://github.com/gkoh) | ooce/server/freeradius | 3.2.3 | https://github.com/FreeRADIUS/freeradius-server/releases https://freeradius.org/releases | [omniosorg](https://github.com/omniosorg) | ooce/server/haproxy | 2.8.5 | https://www.haproxy.org/ | [omniosorg](https://github.com/omniosorg) | ooce/server/nginx | 1.25.3 | https://nginx.org/en/download.html | [omniosorg](https://github.com/omniosorg)