From b0b85dc32f4d4059e7fdbbecfe2ee884fb32b1b3 Mon Sep 17 00:00:00 2001 From: Ed Robinson Date: Wed, 26 Jul 2017 20:11:03 +0100 Subject: [PATCH 1/3] Fix `make install` on OSX Fixes #383 Signed-off-by: Ed Robinson --- Makefile | 22 ++++++++++++++++------ hack/darwin_tag.sh | 5 ----- 2 files changed, 16 insertions(+), 11 deletions(-) delete mode 100755 hack/darwin_tag.sh diff --git a/Makefile b/Makefile index 89a106ec00..f0afd3e19d 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,13 @@ export GO15VENDOREXPERIMENT=1 +ifeq ($(shell uname),Darwin) +PREFIX ?= ${DESTDIR}/usr/local +DARWIN_BUILD_TAG=containers_image_ostree_stub +else PREFIX ?= ${DESTDIR}/usr +endif + INSTALLDIR=${PREFIX}/bin MANINSTALLDIR=${PREFIX}/share/man CONTAINERSSYSCONFIGDIR=${DESTDIR}/etc/containers @@ -34,7 +40,6 @@ MANPAGES_MD = $(wildcard docs/*.md) BTRFS_BUILD_TAG = $(shell hack/btrfs_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) BUILDTAGS += $(LOCAL_BUILD_TAGS) @@ -77,17 +82,22 @@ clean: install: install-binary install-docs install-completions install -d -m 755 ${SIGSTOREDIR} - install -D -m 644 default-policy.json ${CONTAINERSSYSCONFIGDIR}/policy.json - install -D -m 644 default.yaml ${REGISTRIESDDIR}/default.yaml + install -d -m 755 ${CONTAINERSSYSCONFIGDIR} + 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 -D -m 755 skopeo ${INSTALLDIR}/skopeo + install -d -m 755 ${INSTALLDIR} + install -m 755 skopeo ${INSTALLDIR}/skopeo 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 -m 644 -D completions/bash/skopeo ${BASHINSTALLDIR}/skopeo + install -m 755 -d ${BASHINSTALLDIR} + install -m 644 completions/bash/skopeo ${BASHINSTALLDIR}/skopeo shell: build-container $(DOCKER_RUN_DOCKER) bash diff --git a/hack/darwin_tag.sh b/hack/darwin_tag.sh deleted file mode 100755 index eaa09184e1..0000000000 --- a/hack/darwin_tag.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -if [ $(uname) == "Darwin" ]; then - echo "containers_image_ostree_stub" -fi From c448bc0a2905c47316db47d9a5ddd890f0334f52 Mon Sep 17 00:00:00 2001 From: Ed Robinson Date: Wed, 26 Jul 2017 20:14:49 +0100 Subject: [PATCH 2/3] Check make install on osx travis build --- hack/travis_osx.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hack/travis_osx.sh b/hack/travis_osx.sh index e4662f6a92..f2a3b59088 100755 --- a/hack/travis_osx.sh +++ b/hack/travis_osx.sh @@ -8,3 +8,5 @@ ln -vsf $(pwd) ${_projectatomic}/skopeo cd ${_projectatomic}/skopeo make validate-local test-unit-local binary-local +sudo make install +skopeo -v From a934622220cb7cdb7c639fb294d21367eeb74482 Mon Sep 17 00:00:00 2001 From: Ed Robinson Date: Wed, 26 Jul 2017 21:57:11 +0100 Subject: [PATCH 3/3] Install go-md2man on travis osx --- hack/travis_osx.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/travis_osx.sh b/hack/travis_osx.sh index f2a3b59088..4f22ed13b5 100755 --- a/hack/travis_osx.sh +++ b/hack/travis_osx.sh @@ -2,10 +2,14 @@ set -e export GOPATH=$(pwd)/_gopath +export PATH=$GOPATH/bin:$PATH + _projectatomic="${GOPATH}/src/github.com/projectatomic" mkdir -vp ${_projectatomic} ln -vsf $(pwd) ${_projectatomic}/skopeo +go get -u github.com/cpuguy83/go-md2man + cd ${_projectatomic}/skopeo make validate-local test-unit-local binary-local sudo make install