From 78d4dc4ff0f67f803fb221f91a1ee10780658cf3 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 20:46:54 +0100 Subject: [PATCH 1/8] asterisk-13.x: fix CONFIGURE_ARGS The way CONFIGURE_ARGS are done for srtp and pjproect does not take into account that more than one package depends on them. This can result in build failures. So add ifeqs to test properly if --with or --without is required. This commit also adds CONFIGURE_ARGS checks for: alsa (asound) portaudio speex speexdsp Signed-off-by: Sebastian Kemper --- net/asterisk-13.x/Makefile | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 20477f8..511d1e7 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -242,6 +242,7 @@ endif TARGET_CFLAGS+=$(TARGET_CPPFLAGS) CONFIGURE_ARGS+= \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-chan-alsa),--with-asound="$(STAGING_DIR)/usr",--without-asound) \ --without-execinfo \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-chan-mobile),--with-bluetooth="$(STAGING_DIR)/usr",--without-bluetooth) \ --with-cap="$(STAGING_DIR)/usr" \ @@ -262,15 +263,14 @@ CONFIGURE_ARGS+= \ --without-osptk \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pbx-lua),--with-lua="$(STAGING_DIR)/usr",--without-lua) \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgres="$(STAGING_DIR)/usr",--without-postgres) \ - $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pjsip),--with-pjproject="$(STAGING_DIR)/usr",--without-pjproject) \ --with-popt="$(STAGING_DIR)/usr" \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-chan-console),--with-portaudio="$(STAGING_DIR)/usr",--without-portaudio) \ --without-pwlib \ --without-radius \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-res-fax-spandsp),--with-spandsp="$(STAGING_DIR)/usr",--without-spandsp) \ --without-sdl \ --without-sqlite \ --with-sqlite3="$(STAGING_DIR)/usr" \ - $(if $(CONFIG_PACKAGE_$(PKG_NAME)-res-srtp),--with-srtp="$(STAGING_DIR)/usr",--without-srtp) \ --without-suppserv \ --without-tds \ --without-termcap \ @@ -281,6 +281,38 @@ CONFIGURE_ARGS+= \ --with-sounds-cache="$(DL_DIR)" \ --enable-xmldoc +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-codec-speex)$(CONFIG_PACKAGE_$(PKG_NAME)-func-speex),) +CONFIGURE_ARGS+= \ + --without-speex +else +CONFIGURE_ARGS+= \ + --with-speex="$(STAGING_DIR)/usr" +endif + +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-codec-speex)$(CONFIG_PACKAGE_$(PKG_NAME)-func-speex),) +CONFIGURE_ARGS+= \ + --without-speexdsp +else +CONFIGURE_ARGS+= \ + --with-speexdsp="$(STAGING_DIR)/usr" +endif + +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-res-pjproject)$(CONFIG_PACKAGE_$(PKG_NAME)-res-srtp),) +CONFIGURE_ARGS+= \ + --without-srtp +else +CONFIGURE_ARGS+= \ + --with-srtp="$(STAGING_DIR)/usr" +endif + +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-pjsip)$(CONFIG_PACKAGE_$(PKG_NAME)-res-pjproject)$(CONFIG_PACKAGE_$(PKG_NAME)-res-rtp-asterisk),) +CONFIGURE_ARGS+= \ + --without-pjproject +else +CONFIGURE_ARGS+= \ + --with-pjproject="$(STAGING_DIR)/usr" +endif + # res-calendar-ews requires both neon and neon29 detection ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-caldav)$(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-ews)$(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-exchange)$(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-icalendar),) CONFIGURE_ARGS+= \ From fb84fe64e3f93b4a9ccf2bdfba31a85e48c4caaa Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 20:53:47 +0100 Subject: [PATCH 2/8] asterisk-15.x: fix CONFIGURE_ARGS The way CONFIGURE_ARGS are done for srtp and pjproect does not take into account that more than one package depends on them. This can result in build failures. So add ifeqs to test properly if --with or --without is required. This commit also adds CONFIGURE_ARGS checks for: alsa (asound) portaudio speex speexdsp Signed-off-by: Sebastian Kemper --- net/asterisk-15.x/Makefile | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/net/asterisk-15.x/Makefile b/net/asterisk-15.x/Makefile index 1bc92a1..c4783a3 100644 --- a/net/asterisk-15.x/Makefile +++ b/net/asterisk-15.x/Makefile @@ -240,6 +240,7 @@ endif TARGET_CFLAGS+=$(TARGET_CPPFLAGS) CONFIGURE_ARGS+= \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-chan-alsa),--with-asound="$(STAGING_DIR)/usr",--without-asound) \ --without-execinfo \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-chan-mobile),--with-bluetooth="$(STAGING_DIR)/usr",--without-bluetooth) \ --with-cap="$(STAGING_DIR)/usr" \ @@ -251,7 +252,6 @@ CONFIGURE_ARGS+= \ --without-isdnnet \ --without-misdn \ --without-nbs \ - --with-pjproject="$(STAGING_DIR)/usr" \ --without-pjproject-bundled \ --with-libedit="$(STAGING_DIR)/usr" \ --with-libxml2 \ @@ -261,15 +261,14 @@ CONFIGURE_ARGS+= \ --without-osptk \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pbx-lua),--with-lua="$(STAGING_DIR)/usr",--without-lua) \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgres="$(STAGING_DIR)/usr",--without-postgres) \ - $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pjsip),--with-pjproject="$(STAGING_DIR)/usr",--without-pjproject) \ --with-popt="$(STAGING_DIR)/usr" \ + $(if $(CONFIG_PACKAGE_$(PKG_NAME)-chan-console),--with-portaudio="$(STAGING_DIR)/usr",--without-portaudio) \ --without-pwlib \ --without-radius \ $(if $(CONFIG_PACKAGE_$(PKG_NAME)-res-fax-spandsp),--with-spandsp="$(STAGING_DIR)/usr",--without-spandsp) \ --without-sdl \ --without-sqlite \ --with-sqlite3="$(STAGING_DIR)/usr" \ - $(if $(CONFIG_PACKAGE_$(PKG_NAME)-res-srtp),--with-srtp="$(STAGING_DIR)/usr",--without-srtp) \ --without-suppserv \ --without-tds \ --without-termcap \ @@ -281,6 +280,22 @@ CONFIGURE_ARGS+= \ --with-sounds-cache="$(DL_DIR)" \ --enable-xmldoc +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-codec-speex)$(CONFIG_PACKAGE_$(PKG_NAME)-format-ogg-speex)$(CONFIG_PACKAGE_$(PKG_NAME)-func-speex),) +CONFIGURE_ARGS+= \ + --without-speex +else +CONFIGURE_ARGS+= \ + --with-speex="$(STAGING_DIR)/usr" +endif + +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-codec-speex)$(CONFIG_PACKAGE_$(PKG_NAME)-func-speex),) +CONFIGURE_ARGS+= \ + --without-speexdsp +else +CONFIGURE_ARGS+= \ + --with-speexdsp="$(STAGING_DIR)/usr" +endif + ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-format-ogg-speex)$(CONFIG_PACKAGE_$(PKG_NAME)-format-ogg-vorbis),) CONFIGURE_ARGS+= \ --without-ogg @@ -289,6 +304,22 @@ CONFIGURE_ARGS+= \ --with-ogg="$(STAGING_DIR)/usr" endif +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-res-pjproject)$(CONFIG_PACKAGE_$(PKG_NAME)-res-srtp),) +CONFIGURE_ARGS+= \ + --without-srtp +else +CONFIGURE_ARGS+= \ + --with-srtp="$(STAGING_DIR)/usr" +endif + +ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-pjsip)$(CONFIG_PACKAGE_$(PKG_NAME)-res-pjproject)$(CONFIG_PACKAGE_$(PKG_NAME)-res-rtp-asterisk)$(CONFIG_PACKAGE_$(PKG_NAME)-res-sdp-translator-pjmedia),) +CONFIGURE_ARGS+= \ + --without-pjproject +else +CONFIGURE_ARGS+= \ + --with-pjproject="$(STAGING_DIR)/usr" +endif + # res-calendar-ews requires both neon and neon29 detection ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-caldav)$(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-ews)$(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-exchange)$(CONFIG_PACKAGE_$(PKG_NAME)-res-calendar-icalendar),) CONFIGURE_ARGS+= \ From 90121c4959ea3e71f9dff7d05212ffaee8ac3f8d Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 20:58:01 +0100 Subject: [PATCH 3/8] asterisk-13.x: speed up menuselect calls Currently the menuselect calls, for each category or item, step into a directory and call menuselect once. So if all packages are build menuselect will be called hundreds of times and as many directory changes will be done. Instead step into the directory only once, then generate the argument string by iteratively adding to it and then call menuselect once. The speedup is big. Signed-off-by: Sebastian Kemper --- net/asterisk-13.x/Makefile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 511d1e7..a8376f8 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -394,18 +394,20 @@ define Build/Compile LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree - for cat in $(MENUSELECT_CATEGORIES); do \ - cd "$(PKG_BUILD_DIR)" && \ + cd "$(PKG_BUILD_DIR)" && MENUSELECT_ARGS= && \ + for cat in $(MENUSELECT_CATEGORIES); do \ + MENUSELECT_ARGS="$$$$MENUSELECT_ARGS --disable-category $$$$cat"; \ + done; \ ./menuselect/menuselect \ - --disable-category $$$$cat \ - menuselect.makeopts; \ - done - for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \ - cd "$(PKG_BUILD_DIR)" && \ + $$$$MENUSELECT_ARGS \ + menuselect.makeopts + cd "$(PKG_BUILD_DIR)" && MENUSELECT_ARGS= && \ + for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \ + MENUSELECT_ARGS="$$$$MENUSELECT_ARGS --enable $$$$item"; \ + done; \ ./menuselect/menuselect \ - --enable $$$$item \ - menuselect.makeopts; \ - done + $$$$MENUSELECT_ARGS \ + menuselect.makeopts cd "$(PKG_BUILD_DIR)" && \ ./menuselect/menuselect \ --disable BUILD_NATIVE \ From 6c8eaf8f01f8fa819d83ba638819eb0bd9225362 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 21:03:50 +0100 Subject: [PATCH 4/8] asterisk-15.x: speed up menuselect calls Currently the menuselect calls, for each category or item, step into a directory and call menuselect once. So if all packages are build menuselect will be called hundreds of times and as many directory changes will be done. Instead step into the directory only once, then generate the argument string by iteratively adding to it and then call menuselect once. The speedup is big. Signed-off-by: Sebastian Kemper --- net/asterisk-15.x/Makefile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/net/asterisk-15.x/Makefile b/net/asterisk-15.x/Makefile index c4783a3..c191231 100644 --- a/net/asterisk-15.x/Makefile +++ b/net/asterisk-15.x/Makefile @@ -401,18 +401,20 @@ define Build/Compile LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree - for cat in $(MENUSELECT_CATEGORIES); do \ - cd "$(PKG_BUILD_DIR)" && \ + cd "$(PKG_BUILD_DIR)" && MENUSELECT_ARGS= && \ + for cat in $(MENUSELECT_CATEGORIES); do \ + MENUSELECT_ARGS="$$$$MENUSELECT_ARGS --disable-category $$$$cat"; \ + done; \ ./menuselect/menuselect \ - --disable-category $$$$cat \ - menuselect.makeopts; \ - done - for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \ - cd "$(PKG_BUILD_DIR)" && \ + $$$$MENUSELECT_ARGS \ + menuselect.makeopts + cd "$(PKG_BUILD_DIR)" && MENUSELECT_ARGS= && \ + for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \ + MENUSELECT_ARGS="$$$$MENUSELECT_ARGS --enable $$$$item"; \ + done; \ ./menuselect/menuselect \ - --enable $$$$item \ - menuselect.makeopts; \ - done + $$$$MENUSELECT_ARGS \ + menuselect.makeopts cd "$(PKG_BUILD_DIR)" && \ ./menuselect/menuselect \ --disable BUILD_NATIVE \ From 22ac754cc39d692a163d299ce8d8f21abcb11c29 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 21:05:53 +0100 Subject: [PATCH 5/8] asterisk-13.x: workaround for build failure On the buildbots (and locally, too) the x86 builds currently fail. It's visible that the Asterisk build system attempts to build menuselect a second time, which fails because it follows the standard recipes in its Makefiles. The first build of menuselect on the other hand only works because the OpenWrt package sets up the build properly. The second build attempt happens because the menuselect CFLAGS category is setup to delete a stamp file when anything in it changes. On x86 -march=native is available, so the OpenWrt package disables that via menuselect, hence this item in the category is changed and the stamp file automatically removed. The missing stamp file triggers a rebuild of menuselect (which is not required for OpenWrt's intents and purposes). Another item in the CFLAGS category with which the package can have the same issue is LOW_MEMORY, but that is not enabled (changed) by default. Work around this problem by recreating the stamp file after the menuselect calls. Signed-off-by: Sebastian Kemper --- net/asterisk-13.x/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index a8376f8..78a9194 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -413,6 +413,13 @@ define Build/Compile --disable BUILD_NATIVE \ $(if $(CONFIG_ASTERISK13_LOW_MEMORY),--enable LOW_MEMORY) \ menuselect.makeopts + # Hack: + # When changing anything in MENUSELECT_CFLAGS the file ".lastclean" + # gets deleted. E.g. when compiling on x86 for x86 "--disable + # BUILD_NATIVE" changes MENUSELECT_CFLAGS and the file gets removed. + # But that will result in a rebuild attempt of menuselect which will + # likely fail. Prevent that by recreating ".lastclean". + $(CP) "$(PKG_BUILD_DIR)/.cleancount" "$(PKG_BUILD_DIR)/.lastclean" $(call Build/Compile/Default,all install samples) endef From b67a6d4fade5c2357fa0a94d2396f802a92e159e Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 21:17:50 +0100 Subject: [PATCH 6/8] asterisk-15.x: workaround for build failure On the buildbots (and locally, too) the x86 builds currently fail. It's visible that the Asterisk build system attempts to build menuselect a second time, which fails because it follows the standard recipes in its Makefiles. The first build of menuselect on the other hand only works because the OpenWrt package sets up the build properly. The second build attempt happens because the menuselect CFLAGS category is setup to delete a stamp file when anything in it changes. On x86 -march=native is available, so the OpenWrt package disables that via menuselect, hence this item in the category is changed and the stamp file automatically removed. The missing stamp file triggers a rebuild of menuselect (which is not required for OpenWrt's intents and purposes). Another item in the CFLAGS category with which the package can have the same issue is LOW_MEMORY, but that is not enabled (changed) by default. Work around this problem by recreating the stamp file after the menuselect calls. Signed-off-by: Sebastian Kemper --- net/asterisk-15.x/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/asterisk-15.x/Makefile b/net/asterisk-15.x/Makefile index c191231..770e34b 100644 --- a/net/asterisk-15.x/Makefile +++ b/net/asterisk-15.x/Makefile @@ -420,6 +420,13 @@ define Build/Compile --disable BUILD_NATIVE \ $(if $(CONFIG_ASTERISK15_LOW_MEMORY),--enable LOW_MEMORY) \ menuselect.makeopts + # Hack: + # When changing anything in MENUSELECT_CFLAGS the file ".lastclean" + # gets deleted. E.g. when compiling on x86 for x86 "--disable + # BUILD_NATIVE" changes MENUSELECT_CFLAGS and the file gets removed. + # But that will result in a rebuild attempt of menuselect which will + # likely fail. Prevent that by recreating ".lastclean". + $(CP) "$(PKG_BUILD_DIR)/.cleancount" "$(PKG_BUILD_DIR)/.lastclean" $(call Build/Compile/Default,all install samples) endef From 52e720ba7e8f83067fbfbef3990733aa5c91a386 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 21:19:51 +0100 Subject: [PATCH 7/8] asterisk-13.x: security bump to 13.18.3 AST-2017-013: chan_skinny: Call pthread_detach when sess threads end ASTERISK-27452 Signed-off-by: Sebastian Kemper --- net/asterisk-13.x/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 78a9194..9e4f45d 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=asterisk13 -PKG_VERSION:=13.18.2 +PKG_VERSION:=13.18.3 PKG_RELEASE:=1 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases -PKG_HASH:=28cf9b147d3d57f54374f5aa5b815c945d78390f6650ba116fdb9455df5a047b +PKG_HASH:=728db9e4ef34e3f0382c77e5eaa8780b52655377a0db395274667b73cf3a6a1d PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-$(PKG_VERSION) PKG_BUILD_DEPENDS:=libxml2/host From c60d93ad7b0be6089212d10f40a049f6bb382077 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 5 Dec 2017 21:21:57 +0100 Subject: [PATCH 8/8] asterisk-15.x: security bump to 15.1.3 AST-2017-013: chan_skinny: Call pthread_detach when sess threads end ASTERISK-27452 Signed-off-by: Sebastian Kemper --- net/asterisk-15.x/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/asterisk-15.x/Makefile b/net/asterisk-15.x/Makefile index 770e34b..83afba0 100644 --- a/net/asterisk-15.x/Makefile +++ b/net/asterisk-15.x/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=asterisk15 -PKG_VERSION:=15.1.2 -PKG_RELEASE:=2 +PKG_VERSION:=15.1.3 +PKG_RELEASE:=1 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases -PKG_HASH:=1fc7a55a56093d0eb3b12501b1ae60f3df148a926f5fc1c3f805b7fe1537a4ad +PKG_HASH:=cfd7c49e42878b4f7de5af7baa9f43d39476f70d1848e5f158409400c31a0c3a PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-$(PKG_VERSION) PKG_BUILD_DEPENDS:=libxml2/host