File obs-server-2.9-0007-backend-Set-proper-pathnames-when-installing-backend.patch of Package obs-server

From 87f76b1fc5458cf74a10047c206bb454801d9892 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 1ed555b4df..9e9f621f0b 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.20.1