Merge pull request #387 from errm/errm/osx-install

Fix `make install` on OSX
This commit is contained in:
Miloslav Trmač 2017-07-27 18:00:26 +02:00 committed by GitHub
commit 72e662bcb7
3 changed files with 22 additions and 11 deletions

View File

@ -2,7 +2,13 @@
export GO15VENDOREXPERIMENT=1 export GO15VENDOREXPERIMENT=1
ifeq ($(shell uname),Darwin)
PREFIX ?= ${DESTDIR}/usr/local
DARWIN_BUILD_TAG=containers_image_ostree_stub
else
PREFIX ?= ${DESTDIR}/usr PREFIX ?= ${DESTDIR}/usr
endif
INSTALLDIR=${PREFIX}/bin INSTALLDIR=${PREFIX}/bin
MANINSTALLDIR=${PREFIX}/share/man MANINSTALLDIR=${PREFIX}/share/man
CONTAINERSSYSCONFIGDIR=${DESTDIR}/etc/containers CONTAINERSSYSCONFIGDIR=${DESTDIR}/etc/containers
@ -34,7 +40,6 @@ MANPAGES_MD = $(wildcard docs/*.md)
BTRFS_BUILD_TAG = $(shell hack/btrfs_tag.sh) BTRFS_BUILD_TAG = $(shell hack/btrfs_tag.sh)
LIBDM_BUILD_TAG = $(shell hack/libdm_tag.sh) LIBDM_BUILD_TAG = $(shell hack/libdm_tag.sh)
DARWIN_BUILD_TAG = $(shell hack/darwin_tag.sh)
LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBDM_BUILD_TAG) $(DARWIN_BUILD_TAG) LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBDM_BUILD_TAG) $(DARWIN_BUILD_TAG)
BUILDTAGS += $(LOCAL_BUILD_TAGS) BUILDTAGS += $(LOCAL_BUILD_TAGS)
@ -77,17 +82,22 @@ clean:
install: install-binary install-docs install-completions install: install-binary install-docs install-completions
install -d -m 755 ${SIGSTOREDIR} install -d -m 755 ${SIGSTOREDIR}
install -D -m 644 default-policy.json ${CONTAINERSSYSCONFIGDIR}/policy.json install -d -m 755 ${CONTAINERSSYSCONFIGDIR}
install -D -m 644 default.yaml ${REGISTRIESDDIR}/default.yaml install -m 644 default-policy.json ${CONTAINERSSYSCONFIGDIR}/policy.json
install -d -m 755 ${REGISTRIESDDIR}
install -m 644 default.yaml ${REGISTRIESDDIR}/default.yaml
install-binary: ./skopeo install-binary: ./skopeo
install -D -m 755 skopeo ${INSTALLDIR}/skopeo install -d -m 755 ${INSTALLDIR}
install -m 755 skopeo ${INSTALLDIR}/skopeo
install-docs: docs/skopeo.1 install-docs: docs/skopeo.1
install -D -m 644 docs/skopeo.1 ${MANINSTALLDIR}/man1/skopeo.1 install -d -m 755 ${MANINSTALLDIR}/man1
install -m 644 docs/skopeo.1 ${MANINSTALLDIR}/man1/skopeo.1
install-completions: install-completions:
install -m 644 -D completions/bash/skopeo ${BASHINSTALLDIR}/skopeo install -m 755 -d ${BASHINSTALLDIR}
install -m 644 completions/bash/skopeo ${BASHINSTALLDIR}/skopeo
shell: build-container shell: build-container
$(DOCKER_RUN_DOCKER) bash $(DOCKER_RUN_DOCKER) bash

View File

@ -1,5 +0,0 @@
#!/bin/bash
if [ $(uname) == "Darwin" ]; then
echo "containers_image_ostree_stub"
fi

View File

@ -2,9 +2,15 @@
set -e set -e
export GOPATH=$(pwd)/_gopath export GOPATH=$(pwd)/_gopath
export PATH=$GOPATH/bin:$PATH
_projectatomic="${GOPATH}/src/github.com/projectatomic" _projectatomic="${GOPATH}/src/github.com/projectatomic"
mkdir -vp ${_projectatomic} mkdir -vp ${_projectatomic}
ln -vsf $(pwd) ${_projectatomic}/skopeo ln -vsf $(pwd) ${_projectatomic}/skopeo
go get -u github.com/cpuguy83/go-md2man
cd ${_projectatomic}/skopeo cd ${_projectatomic}/skopeo
make validate-local test-unit-local binary-local make validate-local test-unit-local binary-local
sudo make install
skopeo -v