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

From fa444b1da8d7d1f465f3e076e688010219b3f40a 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 1b5ccefbaf..867483949d 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.31.1