Skip to content

Commit

Permalink
Makefile: set CONTAINERSCONFDIR based on the OS.
Browse files Browse the repository at this point in the history
This will put config dir under $PREFIX for FreeBSD.

Continuing PR#1298 by @mateuszkwiatkowski.

Fixes: containers#787

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Nov 16, 2021
1 parent 0029782 commit ad93280
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ GPGME_ENV := CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS
# The following variables very roughly follow https://www.gnu.org/prep/standards/standards.html#Makefile-Conventions .
DESTDIR ?=
PREFIX ?= /usr/local
CONTAINERSCONFDIR ?= /etc/containers
# FreeBSD installs to /usr/local
ifeq ($(shell uname -s),FreeBSD)
CONTAINERSCONFDIR ?= $(PREFIX)/etc/containers
else
CONTAINERSCONFDIR ?= /etc/containers
endif
REGISTRIESDDIR ?= ${CONTAINERSCONFDIR}/registries.d
SIGSTOREDIR ?= /var/lib/containers/sigstore
BINDIR ?= ${PREFIX}/bin
Expand Down Expand Up @@ -91,7 +96,12 @@ CONTAINER_RUN ?= $(CONTAINER_CMD) --security-opt label=disable -v $(CURDIR):$(CO
GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null || true)

EXTRA_LDFLAGS ?=
SKOPEO_LDFLAGS := -ldflags '-X main.gitCommit=${GIT_COMMIT} $(EXTRA_LDFLAGS)'
SKOPEO_LDFLAGS := -ldflags '-X main.gitCommit=${GIT_COMMIT} \
-X github.com/containers/image/v5/docker.systemRegistriesDirPath=${REGISTRIESDDIR} \
-X github.com/containers/image/v5/signature.systemDefaultPolicyPath=${CONTAINERSCONFDIR}/policy.json \
-X github.com/containers/image/v5/pkg/sysregistriesv2.systemRegistriesConfPath=${CONTAINERSCONFDIR}/registries.conf \
-X github.com/containers/image/v5/internal/tmpdir.unixTempDirForBigFiles=/var/tmp \
$(EXTRA_LDFLAGS)'

MANPAGES_MD = $(wildcard docs/*.md)
MANPAGES ?= $(MANPAGES_MD:%.md=%)
Expand Down

0 comments on commit ad93280

Please sign in to comment.