asterisk-13.x: update source and fix build with musl
authorDaniel Golle <daniel@makrotopia.org>
Fri, 19 Jun 2015 06:01:44 +0000 (08:01 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 19 Jun 2015 06:04:51 +0000 (08:04 +0200)
 * update to version 13.4.0
 * don't use GNU GLOB extensions in ael parser on musl

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
net/asterisk-13.x/Makefile
net/asterisk-13.x/patches/004-ifdef-missing-execinfo.patch
net/asterisk-13.x/patches/030-GNU-GLOB-exts-only-on-glibc.patch [new file with mode: 0644]
net/asterisk-13.x/patches/100-AST-2015-003-13.diff [deleted file]

index 199bc18b7af15e21779e722742f9be14e6d01a54..880e17ab764f47f5f9e15bdd551508162d4a65bd 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk13
-PKG_VERSION:=13.2.0
-PKG_RELEASE:=4
+PKG_VERSION:=13.4.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
-PKG_MD5SUM:=36033a5faa2f0f9ac3bc34b799e823a2
+PKG_MD5SUM:=8cd729d481f0b3d9aadcf5a607c25803
 
 PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=libxml2/host
index 2cec5c02db13a49b54b068decb42e01f285ff844..20e5c669b57df6e5923030b2adfc8f69901429cb 100644 (file)
@@ -1,5 +1,7 @@
---- a/include/asterisk/lock.h
-+++ b/include/asterisk/lock.h
+Index: asterisk-13.4.0/include/asterisk/lock.h
+===================================================================
+--- asterisk-13.4.0.orig/include/asterisk/lock.h
++++ asterisk-13.4.0/include/asterisk/lock.h
 @@ -51,9 +51,11 @@
  #include <pthread.h>
  #include <time.h>
  #define ast_suspend_lock_info(ignore);
  #define ast_restore_lock_info(ignore);
  #endif /* !defined(LOW_MEMORY) */
---- a/include/asterisk/utils.h
-+++ b/include/asterisk/utils.h
-@@ -25,7 +25,9 @@
- #include "asterisk/network.h"
-+#ifndef __UCLIBC__
- #include <execinfo.h>
-+#endif
- #include <time.h>     /* we want to override localtime_r */
- #include <unistd.h>
- #include <string.h>
-@@ -514,13 +516,17 @@ extern void *_ast_mem_backtrace_buffer[_
-  * Ok, this sucks. But if we're already out of mem, we don't
-  * want the logger to create infinite recursion (and a crash).
-  */
-+#ifndef __UCLIBC__
- #define MALLOC_FAILURE_MSG \
-       do { \
-               if (backtrace(_ast_mem_backtrace_buffer, _AST_MEM_BACKTRACE_BUFLEN) < _AST_MEM_BACKTRACE_BUFLEN) { \
-                       ast_log(LOG_ERROR, "Memory Allocation Failure in function %s at line %d of %s\n", func, lineno, file); \
-               } \
-       } while (0)
--
-+#else
-+#define MALLOC_FAILURE_MSG \
-+      ast_log(LOG_ERROR, "Memory Allocation Failure (compiled without backtrace support)");
-+#endif
- /*!
-  * \brief A wrapper for malloc()
-  *
diff --git a/net/asterisk-13.x/patches/030-GNU-GLOB-exts-only-on-glibc.patch b/net/asterisk-13.x/patches/030-GNU-GLOB-exts-only-on-glibc.patch
new file mode 100644 (file)
index 0000000..bf1ffdf
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/res/ael/ael.flex
++++ b/res/ael/ael.flex
+@@ -595,7 +595,7 @@ includes   { STORE_POS; return KW_INCLUDES
+                  snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
+                  ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
+               }
+-#ifdef SOLARIS
++#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU)
+                       glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
+ #else
+                       glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
+--- a/res/ael/ael_lex.c
++++ b/res/ael/ael_lex.c
+@@ -1976,7 +1967,7 @@ YY_RULE_SETUP
+                  snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
+                  ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
+               }
+-#ifdef SOLARIS
++#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU)
+                       glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
+ #else
+                       glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
diff --git a/net/asterisk-13.x/patches/100-AST-2015-003-13.diff b/net/asterisk-13.x/patches/100-AST-2015-003-13.diff
deleted file mode 100644 (file)
index c10a186..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/main/tcptls.c
-+++ b/main/tcptls.c
-@@ -640,9 +640,15 @@
-                                                       break;
-                                               }
-                                               str = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, pos));
--                                              ASN1_STRING_to_UTF8(&str2, str);
-+                                              ret = ASN1_STRING_to_UTF8(&str2, str);
-+                                              if (ret < 0) {
-+                                                      continue;
-+                                              }
-+
-                                               if (str2) {
--                                                      if (!strcasecmp(tcptls_session->parent->hostname, (char *) str2)) {
-+                                                      if (strlen((char *) str2) != ret) {
-+                                                              ast_log(LOG_WARNING, "Invalid certificate common name length (contains NULL bytes?)\n");
-+                                                      } else if (!strcasecmp(tcptls_session->parent->hostname, (char *) str2)) {
-                                                               found = 1;
-                                                       }
-                                                       ast_debug(3, "SSL Common Name compare s1='%s' s2='%s'\n", tcptls_session->parent->hostname, str2);