File obs-server-2.9-0010-api-Use-absolute-pathnames-for-apidocs-in-config-env.patch of Package obs-server

From 9212e2b8c75ffe1298fca8a7cc471fc15c4ba945 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Tue, 28 Jun 2016 18:29:12 +0100
Subject: [PATCH] [api] Use absolute pathnames for apidocs in
 "config/environment.rb".

API docs pathname is configured by OBS_APIDOCS_PREFIX variable
from Makefile.include file and is not guaranteed to be in
specific place relative to OBS_API_PREFIX.
Hence, full pathname is needed instead of assuming relative location.

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

diff --git a/src/api/Makefile b/src/api/Makefile
index 5adcc1b577..918c4c216c 100644
--- a/src/api/Makefile
+++ b/src/api/Makefile
@@ -28,8 +28,8 @@ docs:
 	cp -av ../../docs/api/api $(DESTDIR)$(OBS_APIDOCS_PREFIX)
 	cp -av ../../docs/api/html/* $(DESTDIR)$(OBS_APIDOCS_PREFIX)/api/html/
 	ln -sf $(OBS_APIDOCS_PREFIX)/api/ $(DESTDIR)$(OBS_API_PREFIX)/public/schema
-	echo 'CONFIG["apidocs_location"] ||= File.expand_path("../docs/api/html/")' >> $(DESTDIR)$(OBS_API_PREFIX)/config/environment.rb
-	echo 'CONFIG["schema_location"] ||= File.expand_path("../docs/api/")' >> $(DESTDIR)$(OBS_API_PREFIX)/config/environment.rb
+	echo 'CONFIG["apidocs_location"] ||= File.expand_path("$(OBS_APIDOCS_PREFIX)/api/html/")' >> $(DESTDIR)$(OBS_API_PREFIX)/config/environment.rb
+	echo 'CONFIG["schema_location"] ||= File.expand_path("$(OBS_APIDOCS_PREFIX)/api/")' >> $(DESTDIR)$(OBS_API_PREFIX)/config/environment.rb
 
 config: prepare_dirs
 	# we need config also in building environment, otherwise rake will break
-- 
2.20.1