Package: asterisk / 1:13.14.1~dfsg-2+deb9u4

hack-multiple-app-voicemail Patch series | download
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
Description: build multiple versions of app_voicemail.so
 This is a very ugly hack on upstream's Makefiles to allow building
 multiple variants of app_voicemail. Three variants are created:
  * app_voicemail.so: plain old filesystem storage that doesn't break
    existing setups
  * app_voicemail_imapstorage.so: IMAP storage
  * app_voicemail_odbcstorage.so: ODBC storage
 All these conflict with each other and Asterisk will refuse to load
 them concurrently. They are thus included in three separate and
 complicting packages.
 .
 Patch suggested to upstream but rejected for being "hackish". Though
 upstream RPM packages include packages that are only somewhat cleaner.
Author: Faidon Liambotis <paravoid@debian.org>
Bug: http://issues.asterisk.org/view.php?id=13822
Last-Update: 2016-03-19

--- a/apps/Makefile
+++ b/apps/Makefile
@@ -15,6 +15,8 @@
 MENUSELECT_CATEGORY=APPS
 MENUSELECT_DESCRIPTION=Applications
 
+MODS_C_ADDITIONAL=app_voicemail_imapstorage app_voicemail_odbcstorage
+
 MENUSELECT_OPTS_app_directory:=$(MENUSELECT_OPTS_app_voicemail)
 ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
   MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
@@ -25,6 +27,25 @@
 
 all: _all
 
+add_depends_cmd = sed -i -e '/^\/\*\*\* MODULEINFO/a\\t<depend>$(1)<\/depend>'
+app_voicemail_imapstorage.c: app_voicemail.c
+	cp $< $@
+	$(call add_depends_cmd,imap_tk) $@
+	$(call add_depends_cmd,openssl) $@
+	cp app_voicemail.exports.in app_voicemail_imapstorage.exports.in
+app_voicemail_odbcstorage.c: app_voicemail.c
+	cp $< $@
+	$(call add_depends_cmd,unixodbc) $@
+	$(call add_depends_cmd,ltdl) $@
+	cp app_voicemail.exports.in app_voicemail_odbcstorage.exports.in
+
+dist-clean::
+	rm -f app_voicemail_*.c
+	rm -f app_voicemail_*.exports.in
+
+app_voicemail_imapstorage.o: _ASTCFLAGS+=-DIMAP_STORAGE
+app_voicemail_odbcstorage.o: _ASTCFLAGS+=-DODBC_STORAGE
+
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
 clean::
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -37,7 +37,7 @@
 # Use MODULE_EXCLUDE to specify additional modules to exclude.
 
 ifneq ($(MODULE_PREFIX),)
-    ALL_C_MODS:=
+    ALL_C_MODS:=$(MODS_C_ADDITIONAL)
     ALL_CC_MODS:=
     ALL_C_MODS+=$(foreach p,$(MODULE_PREFIX),$(patsubst %.c,%,$(wildcard $(p)_*.c)))
     ALL_CC_MODS+=$(foreach p,$(MODULE_PREFIX),$(patsubst %.cc,%,$(wildcard $(p)_*.cc)))