Makefile: add support for building freebsd release tarballs

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson
2023-06-30 16:35:53 +01:00
parent e0846ac383
commit 92fc0f4818
2 changed files with 9 additions and 4 deletions

View File

@ -33,6 +33,7 @@ PROJECT := github.com/containers/podman
GIT_BASE_BRANCH ?= origin/main GIT_BASE_BRANCH ?= origin/main
LIBPOD_INSTANCE := libpod_dev LIBPOD_INSTANCE := libpod_dev
PREFIX ?= /usr/local PREFIX ?= /usr/local
RELEASE_PREFIX = /usr
BINDIR ?= ${PREFIX}/bin BINDIR ?= ${PREFIX}/bin
LIBEXECDIR ?= ${PREFIX}/libexec LIBEXECDIR ?= ${PREFIX}/libexec
LIBEXECPODMAN ?= ${LIBEXECDIR}/podman LIBEXECPODMAN ?= ${LIBEXECDIR}/podman
@ -180,6 +181,10 @@ else ifeq ($(GOOS),darwin)
BINSFX := BINSFX :=
SRCBINDIR := bin/darwin SRCBINDIR := bin/darwin
CGO_ENABLED := 0 CGO_ENABLED := 0
else ifeq ($(GOOS),freebsd)
BINSFX := -remote
SRCBINDIR := bin
RELEASE_PREFIX = /usr/local
else else
BINSFX := -remote BINSFX := -remote
SRCBINDIR := bin SRCBINDIR := bin
@ -711,7 +716,7 @@ podman-release: podman-release-$(GOARCH).tar.gz # Build all Linux binaries for
podman-release-%.tar.gz: test/version/version podman-release-%.tar.gz: test/version/version
$(eval TMPDIR := $(shell mktemp -d podman_tmp_XXXX)) $(eval TMPDIR := $(shell mktemp -d podman_tmp_XXXX))
$(eval SUBDIR := podman-v$(call err_if_empty,RELEASE_NUMBER)) $(eval SUBDIR := podman-v$(call err_if_empty,RELEASE_NUMBER))
$(eval _DSTARGS := "DESTDIR=$(TMPDIR)/$(SUBDIR)" "PREFIX=/usr") $(eval _DSTARGS := "DESTDIR=$(TMPDIR)/$(SUBDIR)" "PREFIX=$(RELEASE_PREFIX)")
$(eval GOARCH := $*) $(eval GOARCH := $*)
mkdir -p "$(call err_if_empty,TMPDIR)/$(SUBDIR)" mkdir -p "$(call err_if_empty,TMPDIR)/$(SUBDIR)"
$(MAKE) GOOS=$(GOOS) GOARCH=$(NATIVE_GOARCH) \ $(MAKE) GOOS=$(GOOS) GOARCH=$(NATIVE_GOARCH) \
@ -730,7 +735,7 @@ podman-release-%.tar.gz: test/version/version
podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$GOOS_$GOARCH, and docs. into an installation zip. podman-remote-release-%.zip: test/version/version ## Build podman-remote for %=$GOOS_$GOARCH, and docs. into an installation zip.
$(eval TMPDIR := $(shell mktemp -d podman_tmp_XXXX)) $(eval TMPDIR := $(shell mktemp -d podman_tmp_XXXX))
$(eval SUBDIR := podman-$(call err_if_empty,RELEASE_NUMBER)) $(eval SUBDIR := podman-$(call err_if_empty,RELEASE_NUMBER))
$(eval _DSTARGS := "DESTDIR=$(TMPDIR)/$(SUBDIR)" "PREFIX=/usr") $(eval _DSTARGS := "DESTDIR=$(TMPDIR)/$(SUBDIR)" "PREFIX=$(RELEASE_PREFIX)")
$(eval GOOS := $(firstword $(subst _, ,$*))) $(eval GOOS := $(firstword $(subst _, ,$*)))
$(eval GOARCH := $(lastword $(subst _, ,$*))) $(eval GOARCH := $(lastword $(subst _, ,$*)))
$(eval _GOPLAT := GOOS=$(call err_if_empty,GOOS) GOARCH=$(call err_if_empty,GOARCH)) $(eval _GOPLAT := GOOS=$(call err_if_empty,GOOS) GOARCH=$(call err_if_empty,GOARCH))

View File

@ -23,7 +23,7 @@ fi
function usage() { function usage() {
echo >&2 "$0 PLATFORM TARGET SOURCES..." echo >&2 "$0 PLATFORM TARGET SOURCES..."
echo >&2 "PLATFORM: Is either linux, darwin or windows." echo >&2 "PLATFORM: Is either linux, darwin, windows or freebsd."
echo >&2 "TARGET: Is the directory where files will be staged. eg, docs/build/remote/linux" echo >&2 "TARGET: Is the directory where files will be staged. eg, docs/build/remote/linux"
echo >&2 "SOURCES: Are the directories of source files. eg, docs/source/markdown" echo >&2 "SOURCES: Are the directories of source files. eg, docs/source/markdown"
} }
@ -34,7 +34,7 @@ function fail() {
} }
case $PLATFORM in case $PLATFORM in
darwin|linux) darwin|linux|freebsd)
PUBLISHER=man_fn PUBLISHER=man_fn
ext=1 ext=1
;; ;;