[Asterisk-code-review] Build System: Create 'make install-configs' target. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Fri Jul 27 05:51:52 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/9616 )

Change subject: Build System: Create 'make install-configs' target.
......................................................................

Build System: Create 'make install-configs' target.

This target requires specifying CONFIG_SRC=path_to_configs.  This can be
used to install custom configs for the Asterisk build while still
performing directory replacements on asterisk.conf.

Modify internal INSTALL_CONFIGS so first argument requires full path to
the config sources relative to Asterisk source root.

Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab
---
M Makefile
1 file changed, 12 insertions(+), 3 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/Makefile b/Makefile
index fc53406..72ac710 100644
--- a/Makefile
+++ b/Makefile
@@ -767,7 +767,7 @@
 #  (1) the configuration directory to install from
 #  (2) the extension to strip off
 define INSTALL_CONFIGS
-	@for x in configs/$(1)/*$(2); do \
+	@for x in $(1)/*$(2); do \
 		dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x $(2)`"; \
 		if [ -f "$${dst}" ]; then \
 			if [ "$(OVERWRITE)" = "y" ]; then \
@@ -803,6 +803,14 @@
 	fi
 endef
 
+install-configs:
+	@if test -z "$(CONFIG_SRC)" -o ! -d "$(CONFIG_SRC)"; then \
+		>&2 echo "CONFIG_SRC must be set to a directory."; \
+		exit 1; \
+	fi
+	@echo "Installing config files from $(CONFIG_SRC)/*$(CONFIG_EXTEN)"
+	$(call INSTALL_CONFIGS,$(CONFIG_SRC),$(CONFIG_EXTEN))
+
 # XXX why *.adsi is installed first ?
 adsi:
 	@echo Installing adsi config files...
@@ -819,7 +827,7 @@
 
 samples: adsi
 	@echo Installing other config files...
-	$(call INSTALL_CONFIGS,samples,.sample)
+	$(call INSTALL_CONFIGS,configs/samples,.sample)
 	$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX"
 	build_tools/make_sample_voicemail "$(DESTDIR)/$(ASTDATADIR)" "$(DESTDIR)/$(ASTSPOOLDIR)"
 	@for x in phoneprov/*; do \
@@ -842,7 +850,7 @@
 
 basic-pbx:
 	@echo Installing basic-pbx config files...
-	$(call INSTALL_CONFIGS,basic-pbx)
+	$(call INSTALL_CONFIGS,configs/basic-pbx)
 
 webvmail:
 	@[ -d "$(DESTDIR)$(HTTP_DOCSDIR)/" ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@@ -1112,6 +1120,7 @@
 	@find contrib/ast-db-manage/ -name '*.pyc' -delete
 	@ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2
 
+.PHONY: install-configs
 .PHONY: menuselect
 .PHONY: main
 .PHONY: sounds

-- 
To view, visit https://gerrit.asterisk.org/9616
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab
Gerrit-Change-Number: 9616
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180727/548a6dbf/attachment.html>


More information about the asterisk-code-review mailing list