Module: sip-router
Branch: master
Commit: b9571f8b3967611605a3e46e05a46fc4100ff78a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b9571f8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Jan 28 14:07:45 2010 +0100
Makefile: test if cfg, -basic and -oob exist
- cfg install check the existence of the files before atempting to copy
- name of cfg to install depends on flavour
---
Makefile | 54 +++++++++++++++++++++++++++++++++++-------------------
1 files changed, 35 insertions(+), 19 deletions(-)
diff --git a/Makefile b/Makefile
index 360aaf0..356641d 100644
--- a/Makefile
+++ b/Makefile
@@ -888,26 +888,42 @@ $(man_prefix)/$(man_dir)/man5:
# note: sed with POSIX.1 regex doesn't support |, + or ? (darwin, solaris ...)
install-cfg: $(cfg_prefix)/$(cfg_dir)
- @sed $(foreach m,$(modules_dirs),\
- -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
- < etc/$(CFG_NAME)-basic.cfg > \
- $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample
- @chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample
- @if [ -z "${skip_cfg_install}" -a \
- ! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg ]; then \
- mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample \
- $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg; \
+ @if [ -f etc/$(CFG_NAME).cfg ]; then \
+ sed $(foreach m,$(modules_dirs),\
+ -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g")
\
+ < etc/$(CFG_NAME).cfg > \
+ $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample; \
+ chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample; \
+ if [ -z "${skip_cfg_install}" -a \
+ ! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg ]; then \
+ mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg.sample \
+ $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME).cfg; \
+ fi; \
+ fi
+ @if [ -f etc/$(CFG_NAME)-basic.cfg ]; then \
+ sed $(foreach m,$(modules_dirs),\
+ -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g")
\
+ < etc/$(CFG_NAME)-basic.cfg > \
+ $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
+ chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample; \
+ if [ -z "${skip_cfg_install}" -a \
+ ! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg ]; then \
+ mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg.sample \
+ $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-basic.cfg; \
+ fi; \
fi
- @sed $(foreach m,$(modules_dirs),\
- -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
- < etc/$(CFG_NAME)-oob.cfg \
- > $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample
- @chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample
- @if [ -z "${skip_cfg_install}" -a \
- ! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg ]; \
- then \
- mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample \
- $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg; \
+ @if [ -f etc/$(CFG_NAME)-oob.cfg ]; then \
+ sed $(foreach m,$(modules_dirs),\
+ -e "s#/usr/[^:]*lib/$(CFG_NAME)/$(m)\([:/\"]\)#$($(m)_target)\1#g") \
+ < etc/$(CFG_NAME)-oob.cfg \
+ > $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
+ chmod 644 $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample; \
+ if [ -z "${skip_cfg_install}" -a \
+ ! -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg ]; \
+ then \
+ mv -f $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg.sample \
+ $(cfg_prefix)/$(cfg_dir)$(MAIN_NAME)-advanced.cfg; \
+ fi; \
fi
# other configs
@for r in $(C_INSTALL_CFGS) ; do \