From f8b71b494608dde5ef69c25e784bfb31f4b288ca Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Thu, 22 Oct 2015 11:41:56 -0200 Subject: [PATCH] Fixed make to allow building packages in vagrant envs --- src/pkg-rpm/Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/pkg-rpm/Makefile b/src/pkg-rpm/Makefile index cb00f93..40a6251 100644 --- a/src/pkg-rpm/Makefile +++ b/src/pkg-rpm/Makefile @@ -1,4 +1,11 @@ OBSPROJECT = isv:spb:devel +COPR_PROJECT = softwarepublico/v4 +LOCAL_BUILD_DIR = $(PWD)/build + +# Vagrant environment does not accept links from/to shared folder +ifeq "$(PWD)" "/vagrant" +LOCAL_BUILD_DIR = /home/vagrant/rpmbuild/ +endif ############################################################################# @@ -20,7 +27,7 @@ all: @echo '$$ make build-all builds all packages locally' @echo @echo - @echo 'Working with OBS (deprecated):' + @echo 'Working with OBS (deprecated):' @echo @echo '$$ make $${pkg}-checkout-obs checkout $${pkg}' @echo '$$ make $${pkg}-upload-obs uploads package $${pkg}' @@ -52,10 +59,10 @@ diff_packages_obs = $(patsubst %, %-diff-obs, $(packages)) build-all: $(build_packages) $(build_packages): %-build : % - mkdir -p build/SOURCES - cp $*/*.tar.* build/SOURCES/ - cp $*/*.patch build/SOURCES/ || true - cd $* && $(BUILD_PREFIX) rpmbuild --define "_topdir $(PWD)/build/" -bb $*.spec + mkdir -p $(LOCAL_BUILD_DIR)/SOURCES + cp $*/*.tar.* $(LOCAL_BUILD_DIR)/SOURCES/ + cp $*/*.patch $(LOCAL_BUILD_DIR)/SOURCES/ || true + cd $* && $(BUILD_PREFIX) rpmbuild --define "_topdir $(LOCAL_BUILD_DIR)" -bb $*.spec $(build_src_packages): %-build-src : % mkdir -p build/SOURCES -- libgit2 0.21.2