diff --git a/Makefile b/Makefile index cd74853..72b19b9 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,9 @@ DEFAULT_TEMPLATE := /etc/image-helpgen/template.tpl # Used during all builds LDFLAGS := -X main.version=${VERSION} -X main.commitHash=${COMMIT_HASH} -X main.buildTime=${BUILD_TIME} +PREFIX ?= /usr CONFIG_DIR ?= /etc -BIN_DIR ?= /usr/bin +BIN_DIR ?= ${PREFIX}/bin .PHONY: help build clean deps install lint static test @@ -46,8 +47,8 @@ deps: dep ensure -v install: clean build - install -d ${PREFIX}${BIN_DIR} - install --mode 755 pivot ${PREFIX}${BIN_DIR}/pivot + install -d ${DESTDIR}${BIN_DIR} + install --mode 755 pivot ${DESTDIR}${BIN_DIR}/pivot lint: go get -u github.com/golang/lint/golint diff --git a/pivot.spec b/pivot.spec index 8075c9a..d7f96ad 100644 --- a/pivot.spec +++ b/pivot.spec @@ -29,9 +29,8 @@ cd src/github.com/openshift/%{name}/ make build %install -ls -la -install -d %{buildroot}%{_bindir} -install --mode 755 src/github.com/openshift/%{name}/%{name} %{buildroot}%{_bindir}/%{name} +cd src/github.com/openshift/%{name}/ +make install DESTDIR=%{buildroot} %files %license LICENSE