asterisk-g72x: remove old multiple makefiles for g729, add universal one
authorJiri Slachta <slachta@cesnet.cz>
Mon, 16 Mar 2015 14:18:08 +0000 (15:18 +0100)
committerJiri Slachta <slachta@cesnet.cz>
Mon, 16 Mar 2015 14:18:08 +0000 (15:18 +0100)
Signed-off-by: Jiri Slachta <slachta@cesnet.cz>
net/asterisk-1.8.x-codec-g729/Makefile [deleted file]
net/asterisk-11.x-codec-g729/Makefile [deleted file]
net/asterisk-g72x/Makefile [new file with mode: 0644]

diff --git a/net/asterisk-1.8.x-codec-g729/Makefile b/net/asterisk-1.8.x-codec-g729/Makefile
deleted file mode 100644 (file)
index 9d6fc77..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=asterisk18-codec-g729
-PKG_VERSION:=1.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=asterisk-g72x-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://asterisk.hosting.lv/src/
-PKG_MD5SUM:=05825dfbe4959dc5c90b2f7b91e3d4e3
-
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILES:=README.md
-PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/asterisk18-codec-g729
-  SUBMENU:=Telephony
-  SECTION:=net
-  CATEGORY:=Network
-  URL:=http://asterisk.hosting.lv
-  DEPENDS:= asterisk18 +bcg729
-  TITLE:=G.729 codec for Asterisk open source PBX
-endef
-
-define Package/asterisk18-codec-g729/description
- Asterisk G.729 codec based on bcg729 implementation.
-endef
-
-MAKE_ARGS:= \
-       CC="$(TARGET_CC)" \
-       LD="$(TARGET_LD)" \
-       CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-1.8/include -DHAVE_CONFIG_H -I. -fPIC" \
-       LDFLAGS="$(TARGET_LDFLAGS)" \
-       DESTDIR="$(PKG_INSTALL_DIR)"
-
-CONFIGURE_ARGS+=\
-       --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-1.8/include \
-       --with-asterisk18 \
-       --with-bcg729 \
-       --enable-shared \
-       $(MAKE_ARGS)
-
-define Build/Prepare
-       rm -rf $(PKG_BUILD_DIR)/
-       mkdir -p $(PKG_BUILD_DIR)/
-       $(TAR) -xvjf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
-       $(Build/Patch)
-endef
-
-define Package/asterisk18-codec-g729/install
-       $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_g729.so $(1)/usr/lib/asterisk/modules/
-endef
-
-$(eval $(call BuildPackage,asterisk18-codec-g729))
diff --git a/net/asterisk-11.x-codec-g729/Makefile b/net/asterisk-11.x-codec-g729/Makefile
deleted file mode 100644 (file)
index 31c8841..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=asterisk11-codec-g729
-PKG_VERSION:=1.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=asterisk-g72x-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://asterisk.hosting.lv/src/
-PKG_MD5SUM:=05825dfbe4959dc5c90b2f7b91e3d4e3
-
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILES:=README.md
-PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/asterisk11-codec-g729
-  SUBMENU:=Telephony
-  SECTION:=net
-  CATEGORY:=Network
-  URL:=http://asterisk.hosting.lv
-  DEPENDS:= asterisk11 +bcg729
-  TITLE:=G.729 codec for Asterisk open source PBX
-endef
-
-define Package/asterisk11-codec-g729/description
- Asterisk G.729 codec based on bcg729 implementation.
-endef
-
-MAKE_ARGS:= \
-       CC="$(TARGET_CC)" \
-       LD="$(TARGET_LD)" \
-       CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-11/include -DHAVE_CONFIG_H -I. -fPIC" \
-       LDFLAGS="$(TARGET_LDFLAGS)" \
-       DESTDIR="$(PKG_INSTALL_DIR)"
-
-CONFIGURE_ARGS+=\
-       --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-11/include \
-       --with-asterisk100 \
-       --with-bcg729 \
-       --enable-shared \
-       $(MAKE_ARGS)
-
-define Build/Prepare
-       rm -rf $(PKG_BUILD_DIR)/
-       mkdir -p $(PKG_BUILD_DIR)/
-       $(TAR) -xvjf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
-       $(Build/Patch)
-endef
-
-define Package/asterisk11-codec-g729/install
-       $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_g729.so $(1)/usr/lib/asterisk/modules/
-endef
-
-$(eval $(call BuildPackage,asterisk11-codec-g729))
diff --git a/net/asterisk-g72x/Makefile b/net/asterisk-g72x/Makefile
new file mode 100644 (file)
index 0000000..1422719
--- /dev/null
@@ -0,0 +1,122 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=asterisk-g72x
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=asterisk-g72x-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://asterisk.hosting.lv/src/
+PKG_MD5SUM:=05825dfbe4959dc5c90b2f7b91e3d4e3
+
+PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-g72x-$(PKG_VERSION)
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=README.md
+PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/asterisk-g72x/Default
+  SUBMENU:=Telephony
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=G.729 codec for Asterisk open source PBX
+  URL:=http://asterisk.hosting.lv
+  DEPENDS:= +bcg729
+endef
+
+define Package/asterisk18-codec-g729
+$(call Package/asterisk-g72x/Default)
+  DEPENDS+= asterisk18
+  VARIANT:=asterisk18
+endef
+
+define Package/asterisk11-codec-g729
+$(call Package/asterisk-g72x/Default)
+  DEPENDS+= asterisk11 
+  VARIANT:=asterisk11
+endef
+
+define Package/asterisk13-codec-g729
+$(call Package/asterisk-g72x/Default)
+  DEPENDS+= asterisk13
+  VARIANT:=asterisk13
+endef
+
+define Package/description/Default
+ Asterisk G.729 codec based on bcg729 implementation.
+endef
+
+Package/asterisk18-codec-g729/description = $(Package/description/Default)
+Package/asterisk11-codec-g729/description = $(Package/description/Default)
+Package/asterisk13-codec-g729/description = $(Package/description/Default)
+
+ifeq ($(BUILD_VARIANT),asterisk18)
+  MAKE_ARGS:= \
+       CC="$(TARGET_CC)" \
+       LD="$(TARGET_LD)" \
+       CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-1.8/include -DHAVE_CONFIG_H -I. -fPIC" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+       DESTDIR="$(PKG_INSTALL_DIR)"
+
+  CONFIGURE_ARGS+=\
+       --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-1.8/include \
+       --with-asterisk18 \
+       --with-bcg729 \
+       --enable-shared \
+       $(MAKE_ARGS)
+endif
+
+ifeq ($(BUILD_VARIANT),asterisk11)
+  MAKE_ARGS:= \
+       CC="$(TARGET_CC)" \
+       LD="$(TARGET_LD)" \
+       CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-11/include -DHAVE_CONFIG_H -I. -fPIC" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+       DESTDIR="$(PKG_INSTALL_DIR)"
+
+  CONFIGURE_ARGS+=\
+       --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-11/include \
+       --with-asterisk100 \
+       --with-bcg729 \
+       --enable-shared \
+       $(MAKE_ARGS)
+endif
+
+ifeq ($(BUILD_VARIANT),asterisk13)
+  MAKE_ARGS:= \
+       CC="$(TARGET_CC)" \
+       LD="$(TARGET_LD)" \
+       CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=130000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-13/include -DHAVE_CONFIG_H -I. -fPIC" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+       DESTDIR="$(PKG_INSTALL_DIR)"
+
+  CONFIGURE_ARGS+=\
+       --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-13/include \
+       --with-asterisk130 \
+       --with-bcg729 \
+       --enable-shared \
+       $(MAKE_ARGS)
+endif
+
+define Package/Install/Default
+       $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/codec_g729.so $(1)/usr/lib/asterisk/modules/
+endef
+
+Package/asterisk18-codec-g729/install = $(Package/Install/Default)
+Package/asterisk11-codec-g729/install = $(Package/Install/Default)
+Package/asterisk13-codec-g729/install = $(Package/Install/Default)
+
+$(eval $(call BuildPackage,asterisk18-codec-g729))
+$(eval $(call BuildPackage,asterisk11-codec-g729))
+$(eval $(call BuildPackage,asterisk13-codec-g729))