mirror of
https://github.com/containers/skopeo.git
synced 2025-07-31 06:31:06 +00:00
Fix Makefile to handle PREFIX correctly
PREFIX should default to /usr/local according to GNU coding standards. DESTDIR should just be used for install This will allow us to specify make PREFIX=/usr DESTDIR=/tmp/build/ install Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
ef6f46a3b5
commit
18e6c6f17b
38
Makefile
38
Makefile
@ -1,9 +1,9 @@
|
|||||||
.PHONY: all binary build-container docs docs-in-container build-local clean install install-binary install-completions shell test-integration .install.vndr vendor vendor-in-container
|
.PHONY: all binary build-container docs docs-in-container build-local clean install install-binary install-completions shell test-integration .install.vndr vendor vendor-in-container
|
||||||
|
|
||||||
export GOPROXY=https://proxy.golang.org
|
export GOPROXY=https://proxy.golang.org
|
||||||
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
ifeq ($(shell uname),Darwin)
|
ifeq ($(shell uname),Darwin)
|
||||||
PREFIX ?= ${DESTDIR}/usr/local
|
|
||||||
DARWIN_BUILD_TAG=
|
DARWIN_BUILD_TAG=
|
||||||
# On macOS, (brew install gpgme) installs it within /usr/local, but /usr/local/include is not in the default search path.
|
# On macOS, (brew install gpgme) installs it within /usr/local, but /usr/local/include is not in the default search path.
|
||||||
# Rather than hard-code this directory, use gpgme-config. Sadly that must be done at the top-level user
|
# Rather than hard-code this directory, use gpgme-config. Sadly that must be done at the top-level user
|
||||||
@ -12,16 +12,14 @@ DARWIN_BUILD_TAG=
|
|||||||
# If gpgme is not installed or gpgme-config can’t be found for other reasons, the error is silently ignored
|
# If gpgme is not installed or gpgme-config can’t be found for other reasons, the error is silently ignored
|
||||||
# (and the user will probably find out because the cgo compilation will fail).
|
# (and the user will probably find out because the cgo compilation will fail).
|
||||||
GPGME_ENV := CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS="$(shell gpgme-config --libs 2>/dev/null)"
|
GPGME_ENV := CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS="$(shell gpgme-config --libs 2>/dev/null)"
|
||||||
else
|
|
||||||
PREFIX ?= ${DESTDIR}/usr
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INSTALLDIR=${PREFIX}/bin
|
CONTAINERSCONFDIR=/etc/containers
|
||||||
MANINSTALLDIR=${PREFIX}/share/man
|
REGISTRIESDDIR=${CONTAINERSCONFDIR}/registries.d
|
||||||
CONTAINERSSYSCONFIGDIR=${DESTDIR}/etc/containers
|
SIGSTOREDIR=/var/lib/containers/sigstore
|
||||||
REGISTRIESDDIR=${CONTAINERSSYSCONFIGDIR}/registries.d
|
BINDIR=${PREFIX}/bin
|
||||||
SIGSTOREDIR=${DESTDIR}/var/lib/containers/sigstore
|
MANDIR=${PREFIX}/share/man
|
||||||
BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions
|
BASHCOMPLETIONSDIR=${PREFIX}/share/bash-completion/completions
|
||||||
|
|
||||||
GO ?= go
|
GO ?= go
|
||||||
GOBIN := $(shell $(GO) env GOBIN)
|
GOBIN := $(shell $(GO) env GOBIN)
|
||||||
@ -149,23 +147,23 @@ clean:
|
|||||||
rm -rf bin docs/*.1
|
rm -rf bin docs/*.1
|
||||||
|
|
||||||
install: install-binary install-docs install-completions
|
install: install-binary install-docs install-completions
|
||||||
install -d -m 755 ${SIGSTOREDIR}
|
install -d -m 755 ${DESTDIR}/${SIGSTOREDIR}
|
||||||
install -d -m 755 ${CONTAINERSSYSCONFIGDIR}
|
install -d -m 755 ${DESTDIR}/${CONTAINERSCONFIGDIR}
|
||||||
install -m 644 default-policy.json ${CONTAINERSSYSCONFIGDIR}/policy.json
|
install -m 644 default-policy.json ${DESTDIR}/${CONTAINERSCONFIGDIR}/policy.json
|
||||||
install -d -m 755 ${REGISTRIESDDIR}
|
install -d -m 755 ${DESTDIR}/${REGISTRIESDDIR}
|
||||||
install -m 644 default.yaml ${REGISTRIESDDIR}/default.yaml
|
install -m 644 default.yaml ${DESTDIR}/${REGISTRIESDDIR}/default.yaml
|
||||||
|
|
||||||
install-binary: bin/skopeo
|
install-binary: bin/skopeo
|
||||||
install -d -m 755 ${INSTALLDIR}
|
install -d -m 755 ${DESTDIR}/${BINDIR}
|
||||||
install -m 755 bin/skopeo ${INSTALLDIR}/skopeo
|
install -m 755 bin/skopeo ${DESTDIR}/${BINDIR}/skopeo
|
||||||
|
|
||||||
install-docs: docs
|
install-docs: docs
|
||||||
install -d -m 755 ${MANINSTALLDIR}/man1
|
install -d -m 755 ${DESTDIR}/${MANDIR}/man1
|
||||||
install -m 644 docs/*.1 ${MANINSTALLDIR}/man1/
|
install -m 644 docs/*.1 ${DESTDIR}/${MANDIR}/man1
|
||||||
|
|
||||||
install-completions:
|
install-completions:
|
||||||
install -m 755 -d ${BASHINSTALLDIR}
|
install -m 755 -d ${DESTDIR}/${BASHCOMPLETIONSDIR}
|
||||||
install -m 644 completions/bash/skopeo ${BASHINSTALLDIR}/skopeo
|
install -m 644 completions/bash/skopeo ${DESTDIR}/${BASHCOMPLETIONSDIR}/skopeo
|
||||||
|
|
||||||
shell: build-container
|
shell: build-container
|
||||||
$(CONTAINER_RUN) bash
|
$(CONTAINER_RUN) bash
|
||||||
|
@ -30,7 +30,7 @@ git clone https://github.com/containers/skopeo /root/skopeo/src/github.com/conta
|
|||||||
export GOPATH=/root/skopeo; \
|
export GOPATH=/root/skopeo; \
|
||||||
cd /root/skopeo/src/github.com/containers/skopeo; \
|
cd /root/skopeo/src/github.com/containers/skopeo; \
|
||||||
make bin/skopeo;\
|
make bin/skopeo;\
|
||||||
make install;\
|
make PREFIX=/usr install;\
|
||||||
rm -rf /root/skopeo/*; \
|
rm -rf /root/skopeo/*; \
|
||||||
yum -y remove git golang go-md2man make; \
|
yum -y remove git golang go-md2man make; \
|
||||||
yum -y clean all; yum -y clean all; rm -rf /var/cache/dnf/* /var/log/dnf* /var/log/yum*
|
yum -y clean all; yum -y clean all; rm -rf /var/cache/dnf/* /var/log/dnf* /var/log/yum*
|
||||||
|
@ -9,6 +9,6 @@ bundle_test_integration() {
|
|||||||
# subshell so that we can export PATH without breaking other things
|
# subshell so that we can export PATH without breaking other things
|
||||||
(
|
(
|
||||||
make bin/skopeo ${BUILDTAGS:+BUILDTAGS="$BUILDTAGS"}
|
make bin/skopeo ${BUILDTAGS:+BUILDTAGS="$BUILDTAGS"}
|
||||||
make install
|
make PREFIX=/usr install
|
||||||
bundle_test_integration
|
bundle_test_integration
|
||||||
) 2>&1
|
) 2>&1
|
||||||
|
@ -12,7 +12,7 @@ sed -i \
|
|||||||
|
|
||||||
# Build skopeo, install into /usr/bin
|
# Build skopeo, install into /usr/bin
|
||||||
make bin/skopeo ${BUILDTAGS:+BUILDTAGS="$BUILDTAGS"}
|
make bin/skopeo ${BUILDTAGS:+BUILDTAGS="$BUILDTAGS"}
|
||||||
make install
|
make PREFIX=/usr install
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
SKOPEO_BINARY=/usr/bin/skopeo bats --tap systemtest
|
SKOPEO_BINARY=/usr/bin/skopeo bats --tap systemtest
|
||||||
|
@ -19,7 +19,7 @@ to start a container, then within the container:
|
|||||||
SKOPEO_CONTAINER_TESTS=1 PS1='nested> ' go test -tags openshift_shell -timeout=24h ./integration -v -check.v -check.vv -check.f='CopySuite.TestRunShell'
|
SKOPEO_CONTAINER_TESTS=1 PS1='nested> ' go test -tags openshift_shell -timeout=24h ./integration -v -check.v -check.vv -check.f='CopySuite.TestRunShell'
|
||||||
|
|
||||||
An example of what can be done within the container:
|
An example of what can be done within the container:
|
||||||
cd ..; make bin/skopeo install
|
cd ..; make bin/skopeo PREFIX=/usr install
|
||||||
./skopeo --tls-verify=false copy --sign-by=personal@example.com docker://busybox:latest atomic:localhost:5000/myns/personal:personal
|
./skopeo --tls-verify=false copy --sign-by=personal@example.com docker://busybox:latest atomic:localhost:5000/myns/personal:personal
|
||||||
oc get istag personal:personal -o json
|
oc get istag personal:personal -o json
|
||||||
curl -L -v 'http://localhost:5000/v2/'
|
curl -L -v 'http://localhost:5000/v2/'
|
||||||
|
Loading…
Reference in New Issue
Block a user