File obs-server-2.10-0005-api-Use-OBS_API_PREFIX-instead-of-explicit-pathname-.patch of Package obs-server

From 6a660cb927d757363142d34571c07d1b12e70990 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Tue, 28 Jun 2016 01:09:26 +0100
Subject: [PATCH] [api] Use $OBS_API_PREFIX instead of explicit pathname for
 installing.

This allows installing OBS API correctly when OBS_API_PREFIX variable
defined in Makefile.include has value different than "/srv/www/obs/api".

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 src/api/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/api/Makefile b/src/api/Makefile
index ebc98532f5..1b5ccefbaf 100644
--- a/src/api/Makefile
+++ b/src/api/Makefile
@@ -48,10 +48,10 @@ log_files:
 	$(foreach logfile,$(OBS_API_LOGS),$(shell touch $(DESTDIR)$(OBS_API_PREFIX)/log/$(logfile) ))
 
 build: config
-	$(shell [ -d $(DESTDIR)/srv/www/obs/api/.bundle ] && rm -rf $(DESTDIR)/srv/www/obs/api/.bundle)
+	$(shell [ -d $(DESTDIR)$(OBS_API_PREFIX)/.bundle ] && rm -rf $(DESTDIR)$(OBS_API_PREFIX)/.bundle)
 	# we need to have *something* as secret key
-	echo "" | sha256sum| cut -d\  -f 1 > $(DESTDIR)/srv/www/obs/api/config/secret.key
-	cd $(DESTDIR)/srv/www/obs/api ;\
+	echo "" | sha256sum| cut -d\  -f 1 > $(DESTDIR)$(OBS_API_PREFIX)/config/secret.key
+	cd $(DESTDIR)$(OBS_API_PREFIX) ;\
 	bin/rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets || exit 1 ;\
 	rm -rf tmp/cache/sass tmp/cache/assets config/secret.key ;\
 	bin/bundle config --local frozen 1 || exit 1 ;\
-- 
2.31.1