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 901
 		@if [ -f etc/$(CFG_NAME)-basic.cfg ]; then \
902 902
 			sed $(foreach m,$(modules_dirs),\
903 903
 					-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; \
904
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
905
+				< etc/$(CFG_NAME)-basic.cfg \
906
+				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
906 907
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
907 908
 			if [ -z "${skip_cfg_install}" -a \
908 909
 					! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg ]; then \
... ...
@@ -912,7 +914,8 @@ install-cfg: $(cfg_prefix)/$(cfg_dir)
912 912
 		fi
913 913
 		@if [ -f etc/$(CFG_NAME)-oob.cfg ]; then \
914 914
 			sed $(foreach m,$(modules_dirs),\
915
-				-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
915
+					-e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
916
+					-e "s#/usr/local/etc/$(CFG_NAME)/#$(cfg_target)#g" \
916 917
 				< etc/$(CFG_NAME)-oob.cfg \
917 918
 				> $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
918 919
 			chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \