File obs-server-2.9-0009-dist-Use-configuration-variables-instead-of-hardcode.patch of Package obs-server
From 54487b7daa70a27a2467ceb4fee2ee6532d2f8fb Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Tue, 28 Jun 2016 16:39:50 +0100
Subject: [PATCH] [dist] Use configuration variables instead of hardcoded
paths.
This change introduces BINDIR, SBINDIR and INITDDIR configuration variables
that are used instead of hardcoded "/usr/bin", "/usr/sbin" and "/etc/init.d"
paths to install user utilities, system utilities and init scripts.
Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
Makefile.include | 6 +++++-
dist/Makefile | 22 +++++++++++-----------
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/Makefile.include b/Makefile.include
index a7537d5d92..71da21a83b 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -1,4 +1,8 @@
-INSTALL=/usr/bin/install
+BINDIR=/usr/bin
+SBINDIR=/usr/sbin
+INITDDIR=/etc/init.d
+
+INSTALL=$(BINDIR)/install
OBS_BACKEND_PREFIX=/usr/lib/obs/server
OBS_BACKEND_DATA_DIR=/srv/obs
OBS_DOCUMENT_ROOT=/srv/www/obs
diff --git a/dist/Makefile b/dist/Makefile
index 419be51f0b..46b5c7c2a7 100644
--- a/dist/Makefile
+++ b/dist/Makefile
@@ -13,14 +13,14 @@ install: install_obsapisetup install_apache install_initscripts install_project_
#install_overview
install_obsapisetup: system_dirs
- $(INSTALL) -m 755 obsapisetup $(DESTDIR)/etc/init.d/obsapisetup
+ $(INSTALL) -m 755 obsapisetup $(DESTDIR)$(INITDDIR)/obsapisetup
$(INSTALL) -m 755 setup-appliance.sh $(DESTDIR)$(OBS_BACKEND_PREFIX)/setup-appliance.sh
sed -i \
-e 's|wwwrun\.www|$(APACHE_USER).$(APACHE_GROUP)|g' \
-e 's|/srv/www/obs/api|$(OBS_API_PREFIX)|g' \
-e 's|/srv/www/obs/overview|$(OBS_DOCUMENT_ROOT)/overview|g' \
-e 's|/srv/obs|$(OBS_BACKEND_DATA_DIR)|g' \
- $(DESTDIR)/etc/init.d/obsapisetup \
+ $(DESTDIR)$(INITDDIR)/obsapisetup \
$(DESTDIR)$(OBS_BACKEND_PREFIX)/setup-appliance.sh
install_apache:
@@ -35,20 +35,20 @@ install_apache:
$(DESTDIR)$(APACHE_CONIFGDIR_VHOST)/obs.conf
install_initscripts: system_dirs
- $(foreach script,$(INIT_SCRIPTS),$(shell $(INSTALL) -m 755 $(script) $(DESTDIR)/etc/init.d/$(script)) )
- $(foreach script,$(INIT_SCRIPTS),$(shell ln -sf /etc/init.d/$(script) $(DESTDIR)/usr/sbin/rc$(script)) )
+ $(foreach script,$(INIT_SCRIPTS),$(shell $(INSTALL) -m 755 $(script) $(DESTDIR)$(INITDDIR)/$(script)) )
+ $(foreach script,$(INIT_SCRIPTS),$(shell ln -sf $(INITDDIR)/$(script) $(DESTDIR)$(SBINDIR)/rc$(script)) )
sed -i \
-e 's|wwwrun:www|$(APACHE_USER):$(APACHE_GROUP)|g' \
-e 's|/srv/www/obs/api|$(OBS_API_PREFIX)|g' \
-e 's|/srv/obs|$(OBS_BACKEND_DATA_DIR)|g' \
- $(INIT_SCRIPTS:%=$(DESTDIR)/etc/init.d/%)
+ $(INIT_SCRIPTS:%=$(DESTDIR)$(INITDDIR)/%)
install_systemd_services: system_dirs
$(foreach service,$(SYSTEMD_SERVICE_FILES),$(shell $(INSTALL) -m 644 ./systemd/$(service).service $(DESTDIR)$(UNITDIR)$(service).service) )
$(foreach service,$(SYSTEMD_SERVICE_FILES),$(shell ln -sf /usr/sbin/service $(DESTDIR)/usr/sbin/rc$(service) ) )
install_project_update: system_dirs
- $(INSTALL) -m 0755 obs_project_update $(DESTDIR)/usr/sbin/obs_project_update
+ $(INSTALL) -m 0755 obs_project_update $(DESTDIR)$(SBINDIR)/obs_project_update
install_logrotate: system_dirs
@@ -70,8 +70,8 @@ install_slp: system_dirs
$(INSTALL) -m 644 obs.repo_server.reg $(DESTDIR)/etc/slp.reg.d/
install_obs_bin: system_dirs
- $(foreach script,$(OBS_BIN_SCRIPTS),$(shell $(INSTALL) -m 755 $(script) $(DESTDIR)/usr/bin/$(script)) )
- $(foreach script,$(OBS_SBIN_SCRIPTS),$(shell $(INSTALL) -m 755 $(script) $(DESTDIR)/usr/sbin/$(script)) )
+ $(foreach script,$(OBS_BIN_SCRIPTS),$(shell $(INSTALL) -m 755 $(script) $(DESTDIR)$(BINDIR)/$(script)) )
+ $(foreach script,$(OBS_SBIN_SCRIPTS),$(shell $(INSTALL) -m 755 $(script) $(DESTDIR)$(SBINDIR)/$(script)) )
install_crontabs:
$(INSTALL) -m 644 cleanup_scm_cache.cron $(DESTDIR)/etc/cron.d/cleanup_scm_cache
@@ -84,12 +84,12 @@ install_crontabs:
system_dirs:
$(INSTALL) -d -m 755 $(DESTDIR)$(OBS_BACKEND_PREFIX)
- $(INSTALL) -d -m 755 $(DESTDIR)/etc/init.d/
+ $(INSTALL) -d -m 755 $(DESTDIR)$(INITDDIR)/
$(INSTALL) -d -m 755 $(DESTDIR)/etc/logrotate.d/
$(INSTALL) -d -m 755 $(DESTDIR)/etc/slp.reg.d/
$(INSTALL) -d -m 755 $(DESTDIR)/etc/cron.d/
- $(INSTALL) -d -m 755 $(DESTDIR)/usr/bin/
- $(INSTALL) -d -m 755 $(DESTDIR)/usr/sbin/
+ $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/
+ $(INSTALL) -d -m 755 $(DESTDIR)$(SBINDIR)/
$(INSTALL) -d -m 755 $(DESTDIR)/var/adm/fillup-templates
$(INSTALL) -d -m 755 $(DESTDIR)/usr/share/doc/packages/obs-devel
$(INSTALL) -d -m 755 $(DESTDIR)/usr/lib/obs/tests/appliance
--
2.20.1