File obs-server-2.10-0008-backend-Set-proper-pathnames-when-installing-backend.patch of Package obs-server

From 18a8788df795b6d4f9b03006b5631e5a060f4563 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Tue, 28 Jun 2016 02:22:59 +0100
Subject: [PATCH] [backend] Set proper pathnames when installing backend files.

Edit backend files when installing them to contain proper pathnames
configured by OBS_API_PREFIX and OBS_BACKEND_DATA_DIR variables
from Makefile.include file.

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

diff --git a/src/backend/Makefile b/src/backend/Makefile
index d0a2601c7e..076087f9ca 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -21,6 +21,12 @@ install: prepare_dirs install_data_dirs bs_config
 	rm -rf $(DESTDIR)$(OBS_BACKEND_PREFIX)/examples
 	# just for check section, it is a %%ghost
 	ln -sf /usr/lib/build $(DESTDIR)$(OBS_BACKEND_PREFIX)/build 
+	sed -i \
+	    -e 's|/srv/www/obs/api|$(OBS_API_PREFIX)|' \
+	    -e 's|/srv/obs|$(OBS_BACKEND_DATA_DIR)|' \
+	    $(DESTDIR)$(OBS_BACKEND_PREFIX)/bs_* \
+	    $(DESTDIR)$(OBS_BACKEND_PREFIX)/*.pm \
+	    $(DESTDIR)$(OBS_BACKEND_PREFIX)/*.pm.template \
 
 install_data_dirs: prepare_dirs
 	$(foreach data_dir,$(OBS_BACKEND_DATA_SUBDIRS), \
-- 
2.31.1