aboutsummaryrefslogtreecommitdiffstats
path: root/main/kamailio/0001-utils-Install-the-sqlite-scripts.patch
blob: 0c72f6451197c94d0335b26e166833cc78d06bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From 3ced6fc0e5298ac6f2f6dade4d564078ec586ebf Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
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.sqlite > /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