Browse code

Makefile: update path to cfg dir at install

- in case some parameters use absolute path to cfg dir, they are updated
with $cfg_target value

Daniel-Constantin Mierla authored on 06/09/2010 22:28:50
Showing 1 changed files
... ...
@@ -889,8 +889,9 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
889 889
 		@if [ -f etc/$(CFG_NAME).cfg ]; then \
890 890
 			sed $(foreach m,$(modules_dirs),\
891 891
 					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
892
-				< etc/$(CFG_NAME).cfg > \
893
-				$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample; \
892
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
893
+				< etc/$(CFG_NAME).cfg \
894
+				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample; \
894 895
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample; \
895 896
 			if [ -z "${skip_cfg_install}" -a \
896 897
 					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg ]; then \
... ...
@@ -901,8 +902,9 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
901 902
 		@if [ -f etc/$(CFG_NAME)-basic.cfg ]; then \
902 903
 			sed $(foreach m,$(modules_dirs),\
903 904
 					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
904
-				< etc/$(CFG_NAME)-basic.cfg > \
905
-				$(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
905
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
906
+				< etc/$(CFG_NAME)-basic.cfg \
907
+				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
906 908
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
907 909
 			if [ -z "${skip_cfg_install}" -a \
908 910
 					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg ]; then \
... ...
@@ -912,7 +914,8 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
912 914
 		fi
913 915
 		@if [ -f etc/$(CFG_NAME)-oob.cfg ]; then \
914 916
 			sed $(foreach m,$(modules_dirs),\
915
-				-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
917
+					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
918
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
916 919
 				< etc/$(CFG_NAME)-oob.cfg \
917 920
 				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
918 921
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \