pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/comms/asterisk16 Add a webvmail option which installs ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/695f718334ea
branches:  trunk
changeset: 575248:695f718334ea
user:      jnemeth <jnemeth%pkgsrc.org@localhost>
date:      Thu May 06 20:10:17 2010 +0000

description:
Add a webvmail option which installs the vmail.cgi script accessing
voicemail using a browser.

diffstat:

 comms/asterisk16/Makefile         |    8 +-
 comms/asterisk16/PLIST            |    5 +-
 comms/asterisk16/distinfo         |    5 +-
 comms/asterisk16/options.mk       |   18 +++-
 comms/asterisk16/patches/patch-aa |   29 +++--
 comms/asterisk16/patches/patch-bc |  181 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 228 insertions(+), 18 deletions(-)

diffs (truncated from 402 to 300 lines):

diff -r 7eef2d9a3b58 -r 695f718334ea comms/asterisk16/Makefile
--- a/comms/asterisk16/Makefile Thu May 06 17:02:12 2010 +0000
+++ b/comms/asterisk16/Makefile Thu May 06 20:10:17 2010 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.13 2010/03/01 07:06:48 jnemeth Exp $
+# $NetBSD: Makefile,v 1.14 2010/05/06 20:10:17 jnemeth Exp $
 #
 
 DISTNAME=      asterisk-1.6.1.17
 DIST_SUBDIR=   ${PKGNAME_NOREV}
+PKGREVISION=   1
 EXTRACT_ONLY=  ${DISTNAME}.tar.gz
 CATEGORIES=    comms net audio
 MASTER_SITES=  http://downloads.asterisk.org/pub/telephony/asterisk/ \
@@ -22,6 +23,7 @@
 REPLACE_BASH=          build_tools/mkpkgconfig
 REPLACE_PERL+=         agi/DialAnMp3.agi agi/agi-test.agi
 REPLACE_PERL+=         agi/fastagi-test agi/jukebox.agi agi/numeralize
+REPLACE_PERL+=         contrib/scripts/vmail.cgi
 
 PKGCONFIG_OVERRIDE+=   menuselect/mxml/mxml.pc.in
 
@@ -31,7 +33,7 @@
 CONFIGURE_ARGS+=       --without-gtk2
 
 INSTALL_TARGET=                install samples
-INSTALLATION_DIRS=     lib/pkgconfig
+INSTALLATION_DIRS+=    lib/pkgconfig
 INSTALLATION_DIRS+=    share/examples/asterisk share/examples/rc.d
 
 BUILD_DEFS+=           VARBASE
@@ -80,6 +82,8 @@
 MAKE_FLAGS+=           ASTEXAMPLEDIR=${ASTEXAMPLEDIR}
 MAKE_FLAGS+=           WRKSRC=${WRKSRC}
 MAKE_FLAGS+=           LDOPTS=${LDFLAGS:M*:Q}
+MAKE_FLAGS+=           HTTP_DOCSDIR=${PREFIX}/share/httpd/htdocs
+MAKE_FLAGS+=           HTTP_CGIDIR=${PREFIX}/libexec/cgi-bin
 
 .include "options.mk"
 
diff -r 7eef2d9a3b58 -r 695f718334ea comms/asterisk16/PLIST
--- a/comms/asterisk16/PLIST    Thu May 06 17:02:12 2010 +0000
+++ b/comms/asterisk16/PLIST    Thu May 06 20:10:17 2010 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.9 2010/03/01 07:06:48 jnemeth Exp $
+@comment $NetBSD: PLIST,v 1.10 2010/05/06 20:10:17 jnemeth Exp $
 include/asterisk.h
 include/asterisk/_private.h
 include/asterisk/abstract_jb.h
@@ -1028,6 +1028,7 @@
 libexec/agi-bin/eagi-sphinx-test
 libexec/agi-bin/eagi-test
 libexec/agi-bin/jukebox.agi
+${PLIST.webvmail}libexec/cgi-bin/vmail
 man/man8/asterisk.8
 man/man8/astgenkey.8
 man/man8/autosupport.8
@@ -1123,6 +1124,8 @@
 share/examples/asterisk/voicemail.conf
 share/examples/asterisk/vpb.conf
 share/examples/rc.d/asterisk
+${PLIST.webvmail}share/httpd/htdocs/_asterisk/animlogo.gif
+${PLIST.webvmail}share/httpd/htdocs/_asterisk/play.gif
 @pkgdir libdata/asterisk/sounds/fr
 @pkgdir libdata/asterisk/sounds/es
 @pkgdir libdata/asterisk/firmware/iax
diff -r 7eef2d9a3b58 -r 695f718334ea comms/asterisk16/distinfo
--- a/comms/asterisk16/distinfo Thu May 06 17:02:12 2010 +0000
+++ b/comms/asterisk16/distinfo Thu May 06 20:10:17 2010 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.10 2010/03/01 07:06:48 jnemeth Exp $
+$NetBSD: distinfo,v 1.11 2010/05/06 20:10:17 jnemeth Exp $
 
 SHA1 (asterisk-1.6.1.17/asterisk-1.6.1.17.tar.gz) = 7af18a384f7832d8818e0548263681b3e839447f
 RMD160 (asterisk-1.6.1.17/asterisk-1.6.1.17.tar.gz) = 86c54a56b9d5c7565c9d3d54c0d6cd043e9decd3
@@ -9,7 +9,7 @@
 SHA1 (asterisk-1.6.1.17/rfc3951.txt) = 1a6c769be750fb02456d60db2470909254496017
 RMD160 (asterisk-1.6.1.17/rfc3951.txt) = 15f7ec61653ec9953172f8f2150e7d8f6f620926
 Size (asterisk-1.6.1.17/rfc3951.txt) = 373442 bytes
-SHA1 (patch-aa) = 71e819ec12324c6f4bb7de7142bdaac33958ab84
+SHA1 (patch-aa) = a9925349ba9b08c350d86d9d88e02185083c133b
 SHA1 (patch-af) = 09860d714281cb4c65d1a087cf5b16647a16e2fa
 SHA1 (patch-ag) = c71c61350cefbbe53eefa99245ca7712753f22d5
 SHA1 (patch-ai) = e92edab5c1ff323478f41d0b0783102ed527fe39
@@ -31,3 +31,4 @@
 SHA1 (patch-az) = 917cc8868708ce9c022a0268debd90f51f88bdad
 SHA1 (patch-ba) = 2ea96529e0187a23d0b640c7cae69904d587c269
 SHA1 (patch-bb) = 3b78ed3c8233e2db38d09ca81f1768d018ffd2e2
+SHA1 (patch-bc) = 0efc99595d1ef82a879361e8bf3b2ef7fd84af62
diff -r 7eef2d9a3b58 -r 695f718334ea comms/asterisk16/options.mk
--- a/comms/asterisk16/options.mk       Thu May 06 17:02:12 2010 +0000
+++ b/comms/asterisk16/options.mk       Thu May 06 20:10:17 2010 +0000
@@ -1,12 +1,12 @@
-# $NetBSD: options.mk,v 1.4 2010/03/01 07:06:48 jnemeth Exp $
+# $NetBSD: options.mk,v 1.5 2010/05/06 20:10:17 jnemeth Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.asterisk
-PKG_SUPPORTED_OPTIONS=         zaptel x11 unixodbc ilbc
+PKG_SUPPORTED_OPTIONS=         zaptel x11 unixodbc ilbc webvmail
 PKG_OPTIONS_LEGACY_OPTS+=      gtk:x11
 
 .include "../../mk/bsd.options.mk"
 
-PLIST_VARS+=           zaptel x11 unixodbc ilbc
+PLIST_VARS+=           zaptel x11 unixodbc ilbc webvmail
 
 # Asterisk now uses DAHDI, not zaptel; not implemented yet...
 #.if !empty(PKG_OPTIONS:Mzaptel)
@@ -75,3 +75,15 @@
        cp ${DISTDIR}/${DIST_SUBDIR}/extract-cfile.awk ${WRKSRC}/codecs/ilbc
        cd ${WRKSRC}/codecs/ilbc && ${AWK} -f extract-cfile.awk < rfc3951.txt
 .endif
+
+.if !empty(PKG_OPTIONS:Mwebvmail)
+SUBST_CLASSES+=                webvmail
+SUBST_STAGE.webvmail=  post-patch
+SUBST_FILES.webvmail=  contrib/scripts/vmail.cgi
+SUBST_SED.webvmail+=   -e 's|@ASTETCDIR@|${ASTETCDIR}|'
+SUBST_SED.webvmail+=   -e "s|@ASTSPOOLDIR@|${ASTSPOOLDIR}|"
+INSTALLATION_DIRS+=    ${PREFIX}/libexec/cgi-bin ${PREFIX}/share/httpd/htdocs
+SPECIAL_PERMS+=                ${PREFIX}/libexec/cgi-bin/vmail ${ASTERISK_USER} ${ASTERISK_GROUP} 04555
+INSTALL_TARGET+=       webvmail
+PLIST.webvmail=                yes
+.endif
diff -r 7eef2d9a3b58 -r 695f718334ea comms/asterisk16/patches/patch-aa
--- a/comms/asterisk16/patches/patch-aa Thu May 06 17:02:12 2010 +0000
+++ b/comms/asterisk16/patches/patch-aa Thu May 06 20:10:17 2010 +0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-aa,v 1.4 2009/12/30 04:11:02 jnemeth Exp $
+$NetBSD: patch-aa,v 1.5 2010/05/06 20:10:17 jnemeth Exp $
 
---- Makefile.orig      2009-11-03 20:01:04.000000000 +0000
+--- Makefile.orig      2009-12-10 21:03:40.000000000 +0000
 +++ Makefile
 @@ -123,20 +123,6 @@ DEBUG=-g3
  
@@ -55,7 +55,7 @@
  ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
    ifneq ($(PROC),ultrasparc)
      _ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
-@@ -463,9 +438,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
+@@ -464,9 +439,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
        rm -f build_tools/menuselect-deps
  
  datafiles: _all
@@ -66,7 +66,7 @@
  # Should static HTTP be installed during make samples or even with its own target ala
  # webvoicemail?  There are portions here that *could* be customized but might also be
  # improved a lot.  I'll put it here for now.
-@@ -507,9 +480,10 @@ NEWHEADERS=$(notdir $(wildcard include/a
+@@ -508,9 +481,10 @@ NEWHEADERS=$(notdir $(wildcard include/a
  OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
  
  installdirs:
@@ -78,7 +78,7 @@
        mkdir -p $(DESTDIR)$(ASTBINDIR)
        mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
-@@ -518,6 +492,7 @@ installdirs:
+@@ -519,6 +493,7 @@ installdirs:
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
        mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
@@ -86,7 +86,7 @@
  
  bininstall: _all installdirs $(SUBDIRS_INSTALL)
        $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
-@@ -613,22 +588,22 @@ upgrade: bininstall
+@@ -614,22 +589,22 @@ upgrade: bininstall
  # XXX why *.adsi is installed first ?
  adsi:
        @echo Installing adsi config files...
@@ -114,7 +114,7 @@
                if [ -f $${dst} ]; then \
                        if [ "$(OVERWRITE)" = "y" ]; then \
                                if cmp -s $${dst} $$x ; then \
-@@ -644,10 +619,10 @@ samples: adsi
+@@ -645,10 +620,10 @@ samples: adsi
                echo "Installing file $$x"; \
                $(INSTALL) -m 644 $$x $${dst} ;\
        done
@@ -127,7 +127,7 @@
                echo "astetcdir => $(ASTETCDIR)" ; \
                echo "astmoddir => $(MODULES_DIR)" ; \
                echo "astvarlibdir => $(ASTVARLIBDIR)" ; \
-@@ -700,7 +675,7 @@ samples: adsi
+@@ -701,7 +676,7 @@ samples: adsi
                echo "pbx_realtime=1.6" ; \
                echo "res_agi=1.6" ; \
                echo "app_set=1.6" ; \
@@ -136,7 +136,16 @@
        else \
                echo "Skipping asterisk.conf creation"; \
        fi
-@@ -834,7 +809,7 @@ uninstall-all: _uninstall
+@@ -729,7 +704,7 @@ samples: adsi
+ webvmail:
+       @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+       @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+-      $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
++      $(INSTALL) contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail
+       mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
+       for x in images/*.gif; do \
+               $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
+@@ -835,7 +810,7 @@ uninstall-all: _uninstall
        rm -rf $(DESTDIR)$(ASTVARLIBDIR)
        rm -rf $(DESTDIR)$(ASTDATADIR)
        rm -rf $(DESTDIR)$(ASTSPOOLDIR)
@@ -145,7 +154,7 @@
        rm -rf $(DESTDIR)$(ASTLOGDIR)
  
  menuconfig: menuselect
-@@ -905,6 +880,7 @@ asterisk.pdf:
+@@ -906,6 +881,7 @@ asterisk.pdf:
        $(MAKE) -C doc/tex asterisk.pdf
  
  .PHONY: menuselect
diff -r 7eef2d9a3b58 -r 695f718334ea comms/asterisk16/patches/patch-bc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/asterisk16/patches/patch-bc Thu May 06 20:10:17 2010 +0000
@@ -0,0 +1,181 @@
+$NetBSD: patch-bc,v 1.1 2010/05/06 20:10:17 jnemeth Exp $
+
+--- contrib/scripts/vmail.cgi.orig     2008-09-20 00:55:01.000000000 +0000
++++ contrib/scripts/vmail.cgi
+@@ -145,7 +145,7 @@ sub check_login($$)
+               $context = "default";
+       }
+       if (!$filename) {
+-              $filename = "/etc/asterisk/voicemail.conf";
++              $filename = "@ASTETCDIR@/voicemail.conf";
+       }
+ #     print header;
+ #     print "Including <h2>$filename</h2> while in <h2>$category</h2>...\n";
+@@ -153,7 +153,7 @@ sub check_login($$)
+       while(<VMAIL>) {
+               chomp;
+               if (/include\s\"([^\"]+)\"$/) {
+-                      ($tmp, $category) = &check_login("/etc/asterisk/$1", $category);
++                      ($tmp, $category) = &check_login("@ASTETCDIR@/$1", $category);
+                       if (length($tmp)) {
+ #                             print "Got '$tmp'\n";
+                               return ($tmp, $category);
+@@ -200,7 +200,7 @@ sub check_login_users {
+       my ($mbox, $context) = split(/\@/, param('mailbox'));
+       my $pass = param('password');
+       my ($found, $fullname) = (0, "");
+-      open VMAIL, "</etc/asterisk/users.conf";
++      open VMAIL, "<@ASTETCDIR@/users.conf";
+       while (<VMAIL>) {
+               chomp;
+               if (m/\[(.*)\]/) {
+@@ -242,7 +242,7 @@ sub validmailbox($$$$)
+               $context = "default";
+       }
+       if (!$filename) {
+-              $filename = "/etc/asterisk/voicemail.conf";
++              $filename = "@ASTETCDIR@/voicemail.conf";
+       }
+       if (!$category) {
+               $category = "general";
+@@ -251,7 +251,7 @@ sub validmailbox($$$$)
+       while (<VMAIL>) {
+               chomp;
+               if (/include\s\"([^\"]+)\"$/) {
+-                      ($tmp, $category) = &validmailbox($mbox, $context, "/etc/asterisk/$1");
++                      ($tmp, $category) = &validmailbox($mbox, $context, "@ASTETCDIR@/$1");
+                       if ($tmp) {
+                               return ($tmp, $category);
+                       }
+@@ -298,7 +298,7 @@ sub mailbox_options()
+       local $tmp2;
+       local $tmp;
+       if (!$filename) {
+-              $filename = "/etc/asterisk/voicemail.conf";
++              $filename = "@ASTETCDIR@/voicemail.conf";
+       }
+       if (!$category) {
+               $category = "general";
+@@ -386,7 +386,7 @@ sub mailbox_list()
+ sub msgcount() 
+ {
+       my ($context, $mailbox, $folder) = @_;
+-      my $path = "/var/spool/asterisk/voicemail/$context/$mailbox/$folder";
++      my $path = "@ASTSPOOLDIR@/voicemail/$context/$mailbox/$folder";
+       if (opendir(DIR, $path)) {
+               my @msgs = grep(/^msg....\.txt$/, readdir(DIR));
+               closedir(DIR);
+@@ -410,7 +410,7 @@ sub msgcountstr()
+ sub messages()
+ {
+       my ($context, $mailbox, $folder) = @_;
+-      my $path = "/var/spool/asterisk/voicemail/$context/$mailbox/$folder";
++      my $path = "@ASTSPOOLDIR@/voicemail/$context/$mailbox/$folder";
+       if (opendir(DIR, $path)) {
+               my @msgs = sort grep(/^msg....\.txt$/, readdir(DIR));
+               closedir(DIR);
+@@ -435,7 +435,7 @@ sub getfields()
+ {
+       my ($context, $mailbox, $folder, $msg) = @_;



Home | Main Index | Thread Index | Old Index