From 3ced6fc0e5298ac6f2f6dade4d564078ec586ebf Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 26 May 2011 14:04:26 +0000 Subject: [PATCH] utils: Install the sqlite scripts Fix the makefiles to actually install the sqlite scripts --- modules_k/db_sqlite/Makefile | 10 ++++++++++ utils/kamctl/Makefile | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/modules_k/db_sqlite/Makefile b/modules_k/db_sqlite/Makefile index 9a75593..1f1dd2d 100644 --- a/modules_k/db_sqlite/Makefile +++ b/modules_k/db_sqlite/Makefile @@ -13,3 +13,13 @@ DEFS+=-DOPENSER_MOD_INTERFACE SERLIBPATH=../../lib SER_LIBS+=$(SERLIBPATH)/srdb1/srdb1 include ../../Makefile.modules + +ifeq ($(INSTALL_FLAVOUR),kamailio) +# extra install for kamailio + +install-sqlite-scripts: $(bin_prefix)/$(bin_dir) + SQLITEON=yes make -C ../../utils/kamctl/ install-modules + +install-scripts: install-sqlite-scripts + +endif # INSTALL_FLAVOUR diff --git a/utils/kamctl/Makefile b/utils/kamctl/Makefile index 0f2643b..8b0f790 100644 --- a/utils/kamctl/Makefile +++ b/utils/kamctl/Makefile @@ -245,6 +245,29 @@ install-modules: $(bin_prefix)/$(bin_dir) fi ;\ done ;\ fi + # install sqlite stuff + if [ "$(SQLITEON)" = "yes" ]; then \ + mkdir -p $(modules_prefix)/$(lib_dir)/kamctl ; \ + sed -e "s#/usr/local/sbin#$(bin_target)#g" \ + < kamctl.pgsql > /tmp/kamctl.sqlite ; \ + $(INSTALL_CFG) /tmp/kamctl.sqlite \ + $(modules_prefix)/$(lib_dir)/kamctl/kamctl.sqlite ; \ + rm -fr /tmp/kamctl.sqlite ; \ + sed -e "s#/usr/local/share/kamailio#$(data_target)#g" \ + < kamdbctl.sqlite > /tmp/kamdbctl.sqlite ; \ + $(INSTALL_TOUCH) $(modules_prefix)/$(lib_dir)/kamctl/kamdbctl.sqlite ; \ + $(INSTALL_CFG) /tmp/kamdbctl.sqlite $(modules_prefix)/$(lib_dir)/kamctl/ ; \ + rm -fr /tmp/kamdbctl.sqlite ; \ + mkdir -p $(data_prefix)/$(data_dir)/sqlite ; \ + for FILE in $(wildcard sqlite/*) ; do \ + if [ -f $$FILE ] ; then \ + $(INSTALL_TOUCH) $$FILE \ + $(data_prefix)/$(data_dir)/sqlite/`basename "$$FILE"` ; \ + $(INSTALL_CFG) $$FILE \ + $(data_prefix)/$(data_dir)/sqlite/`basename "$$FILE"` ; \ + fi ;\ + done ; \ + fi $(cfg_prefix)/$(cfg_dir): -- 1.7.4.5