From d5c638ca1d390284c4e944a82c2a52f61a4b39bd Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 16 Nov 2019 04:22:03 +0000 Subject: [PATCH] rpm build: Make the RPM build directory configurable Signed-off-by: Daniel Ahlin git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8658 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 8 ++++---- scstadmin/Makefile | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ab5e5c5c3..68ab52e9f 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,8 @@ REVISION ?= $(shell if [ -e .svn ]; then \ fi) VERSION := $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)$(REVISION)") DEBIAN_REVISION=1 +RPMTOPDIR ?= $(shell if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ + else echo $$PWD/rpmbuilddir; fi) help: @echo " all : make all" @@ -397,8 +399,7 @@ scst-dist-gzip: scst-rpm: name=scst && \ - rpmtopdir="$$(if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ - else echo $$PWD/rpmbuilddir; fi)" && \ + rpmtopdir=$(RPMTOPDIR) && \ $(MAKE) scst-dist-gzip && \ for d in BUILD RPMS SOURCES SPECS SRPMS; do \ mkdir -p $${rpmtopdir}/$$d; \ @@ -415,8 +416,7 @@ scst-rpm: scst-dkms-rpm: name=scst-dkms && \ - rpmtopdir="$$(if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ - else echo $$PWD/rpmbuilddir; fi)" && \ + rpmtopdir=$(RPMTOPDIR) && \ $(MAKE) scst-dist-gzip && \ for d in BUILD RPMS SOURCES SPECS SRPMS; do \ mkdir -p $${rpmtopdir}/$$d; \ diff --git a/scstadmin/Makefile b/scstadmin/Makefile index 5ed1e3ac7..b0aa0a05f 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -67,6 +67,9 @@ DEFAULTDIR := $(shell if [ -f /etc/gentoo-release ]; then \ echo /etc/default; \ fi) +RPMTOPDIR ?= $(shell if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ + else echo $$PWD/rpmbuilddir; fi) + all: cd $(SCSTADMIN_DIR) && $(MAKE) $@ @@ -139,8 +142,7 @@ dist-gzip: rpm: name=$(shell basename $$PWD) && \ - rpmtopdir="$$(if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\ - else echo $$PWD/rpmbuilddir; fi)" && \ + rpmtopdir=$(RPMTOPDIR) && \ $(MAKE) dist-gzip && \ for d in BUILD RPMS SOURCES SPECS SRPMS; do \ mkdir -p $${rpmtopdir}/$$d; \