asterisk11-gui: add package asterisk11-gui
authorJiri Slachta <slachta@cesnet.cz>
Tue, 27 Aug 2013 13:17:02 +0000 (15:17 +0200)
committerJiri Slachta <slachta@cesnet.cz>
Tue, 27 Aug 2013 13:17:02 +0000 (15:17 +0200)
Signed-off-by: Jiri Slachta <slachta@cesnet.cz>
admin/asterisk11-gui/Makefile [new file with mode: 0644]
admin/asterisk11-gui/files/agui-postinst [new file with mode: 0755]
admin/asterisk11-gui/files/gui_http.conf [new file with mode: 0644]
admin/asterisk11-gui/files/gui_manager.conf [new file with mode: 0644]
admin/asterisk11-gui/files/gui_users.conf [new file with mode: 0644]

diff --git a/admin/asterisk11-gui/Makefile b/admin/asterisk11-gui/Makefile
new file mode 100644 (file)
index 0000000..8ed4955
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2013 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-gui
+PKG_VERSION:=2.1.0-rc1
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk-gui/releases/
+PKG_SOURCE:=asterisk-gui-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=055bf2aaba365e696198925d039ac3cb
+PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-gui-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/asterisk11-gui
+  SECTION:=admin
+  CATEGORY:=Administration
+  TITLE:=Asterisk GUI
+  DEPENDS:=+@PACKAGE_asterisk11 +asterisk11-app-exec +asterisk11-app-system
+  VERSION:=$(PKG_VERSION)
+endef
+
+define Package/asterisk11-gui/description
+ Asterisk11 GUI is a framework for the creation of graphical interfaces 
+ for configuring Asterisk-11.x package.
+endef
+
+EXTRA_CFLAGS:=$(TARGET_CPPFLAGS)
+EXTRA_LDFLAGS:=$(TARGET_LDFLAGS)
+
+define Build/Configure
+       ( cd $(PKG_BUILD_DIR); ./bootstrap.sh )
+       $(call Build/Configure/Default, \
+                       --build=$(GNU_HOST_NAME) \
+                       --host=$(GNU_TARGET_NAME) \
+                       --target=$(GNU_TARGET_NAME) \
+                       --prefix=/usr \
+                       --disable-nls \
+                       --disable-static \
+                       --localstatedir="/usr" \
+                       --sysconfdir="/etc" \
+               )
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)"
+       $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
+endef
+
+define Package/asterisk11-gui/install
+       $(INSTALL_DIR) $(1)/etc/asterisk/
+       $(CP) ./files/gui_* $(1)/etc/asterisk/
+       $(INSTALL_DIR) $(1)/usr/lib/asterisk/static-http
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/static-http/* $(1)/usr/lib/asterisk/static-http
+       $(INSTALL_DIR) $(1)/usr/lib/asterisk/scripts
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/scripts/* $(1)/usr/lib/asterisk/scripts
+       $(INSTALL_DIR) $(1)/usr/lib/asterisk/gui_backups
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(CP)   ./files/agui-postinst $(1)/etc/uci-defaults/
+endef
+
+define Package/asterisk11-gui/postinst
+       #!/bin/sh
+       [ -n "$${IPKG_INSTROOT}" ] && exit
+       . /lib/functions.sh
+       uci_apply_defaults
+endef
+
+$(eval $(call BuildPackage,asterisk11-gui))
diff --git a/admin/asterisk11-gui/files/agui-postinst b/admin/asterisk11-gui/files/agui-postinst
new file mode 100755 (executable)
index 0000000..d9addb3
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+CFG_PATH="/etc/asterisk/"
+GUI_CFG_PREFIX="gui_"
+CFG_FILES="http.conf manager.conf users.conf"
+
+for i in $CFG_FILES; do
+       if [ -f $CFG_PATH$i ]; then
+               mv $CFG_PATH$i $CFG_PATH$i".backup"
+       fi
+       cp $CFG_PATH$GUI_CFG_PREFIX$i $CFG_PATH$i
+done
diff --git a/admin/asterisk11-gui/files/gui_http.conf b/admin/asterisk11-gui/files/gui_http.conf
new file mode 100644 (file)
index 0000000..8679e36
--- /dev/null
@@ -0,0 +1,41 @@
+;
+; Asterisk Builtin mini-HTTP server
+;
+;
+[general]
+;
+; Whether HTTP interface is enabled or not.  Default is no.
+;
+enabled=yes
+;
+; Whether Asterisk should serve static content from http-static
+; Default is no.
+;
+enablestatic=yes
+;
+; Address to bind to.  Default is 0.0.0.0
+;
+bindaddr=0.0.0.0
+;
+; Port to bind to (default is 8088)
+;
+bindport=8088
+;
+; Prefix allows you to specify a prefix for all requests
+; to the server.  The default is "asterisk" so that all
+; requests must begin with /asterisk
+;
+;prefix=asterisk
+
+; The post_mappings section maps URLs to real paths on the filesystem.  If a
+; POST is done from within an authenticated manager session to one of the
+; configured POST mappings, then any files in the POST will be placed in the
+; configured directory.
+;
+;[post_mappings]
+;
+; In this example, if the prefix option is set to "asterisk", then using the
+; POST URL: /asterisk/uploads will put files in /var/lib/asterisk/uploads/.
+;uploads = /var/lib/asterisk/uploads/
+;
+
diff --git a/admin/asterisk11-gui/files/gui_manager.conf b/admin/asterisk11-gui/files/gui_manager.conf
new file mode 100644 (file)
index 0000000..9408b62
--- /dev/null
@@ -0,0 +1,21 @@
+;
+; Asterisk Call Management support
+;
+
+; By default asterisk will listen on localhost only.
+[general]
+enabled = yes
+webenabled=yes
+port = 5038
+bindaddr = 0.0.0.0
+
+; No access is allowed by default.
+; To set a password, create a file in /etc/asterisk/manager.d
+; use creative permission games to allow other serivces to create their own
+; files
+
+[admin]
+    secret = admin
+    read = system,call,log,verbose,command,agent,config
+    write = system,call,log,verbose,command,agent,config
+
diff --git a/admin/asterisk11-gui/files/gui_users.conf b/admin/asterisk11-gui/files/gui_users.conf
new file mode 100644 (file)
index 0000000..e69de29