summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Pickford2016-02-18 02:12:16 -0800
committerPeter Pickford2016-02-18 02:12:16 -0800
commitf5792e485ef96b8ad8b6d561899294ea1a099148 (patch)
treecc162ba253b9d0379d79a5f1c3e0b24439fa8987
downloadaur-f5792e485ef96b8ad8b6d561899294ea1a099148.tar.gz
initial commit
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD43
-rwxr-xr-xconvert_sound.pl74
-rwxr-xr-xinstall_vocp.pl272
-rw-r--r--vocp.install8
5 files changed, 428 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..d9f23860c6d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+# Generated by makepkg 5.0.0
+# Thu Feb 18 10:10:38 UTC 2016
+pkgbase = vocp
+ pkgdesc = VOCP is a complete messaging solution for voice modems, with voicemail, fax, email pager, DTMF command shell and Text-to-Speech support, 3 GUIs and a web interface. Send and receive faxes and voicemail, listen to emails and execute programs on the host.
+ pkgver = 0.9.3
+ pkgrel = 1
+ url = http://vocp.psychogenic.net/index.php?mode=function
+ install = vocp.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = make
+ makedepends = perl
+ depends = mgetty-vgetty
+ depends = perl-audio-dsp
+ depends = perl-crypt-blowfish
+ depends = perl-crypt-cbc
+ depends = perl-mime-tools
+ depends = perl-tk
+ depends = perl-xml-mini
+ depends = perl-modem-vgetty
+ conflicts = mgetty
+ source = http://prdownloads.sourceforge.net/vocp/VOCP-0.9.3.tar.bz2
+ source = convert_sound.pl
+ source = install_vocp.pl
+ md5sums = 1a570a1f5af11786b39f6aed4304b5c3
+ md5sums = b6d69da8f3221d7d51e3be4d2c067c00
+ md5sums = 3abd17fdd551aee139b8f40efd7a93a0
+
+pkgname = vocp
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c7c632979d0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer:
+# Contributor: Peter Pickford <arch@netremedies.ca>
+
+pkgname=vocp
+pkgver=0.9.3
+pkgrel=1
+pkgdesc="VOCP is a complete messaging solution for voice modems, with voicemail, fax, email pager, DTMF command shell and Text-to-Speech support, 3 GUIs and a web interface. Send and receive faxes and voicemail, listen to emails and execute programs on the host."
+url="http://vocp.psychogenic.net/index.php?mode=function"
+license=('GPL')
+arch=('i686' 'x86_64')
+depends=('mgetty-vgetty' 'perl-audio-dsp' 'perl-crypt-blowfish' 'perl-crypt-cbc' 'perl-mime-tools' 'perl-tk' 'perl-xml-mini' 'perl-modem-vgetty' )
+conflicts=('mgetty')
+makedepends=('make' 'perl')
+install='vocp.install'
+source=('http://prdownloads.sourceforge.net/vocp/VOCP-0.9.3.tar.bz2'
+'convert_sound.pl'
+'install_vocp.pl'
+ )
+md5sums=('1a570a1f5af11786b39f6aed4304b5c3'
+ 'b6d69da8f3221d7d51e3be4d2c067c00'
+ '3abd17fdd551aee139b8f40efd7a93a0')
+
+build(){
+ cd "$srcdir/$pkgname-$pkgver/prog/VOCP"
+
+ # Install module in vendor directories.
+ PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
+ make
+}
+check(){
+ cd "$srcdir/$pkgname-$pkgver/prog/VOCP"
+ #make test
+}
+package(){
+ cd "$srcdir/$pkgname-$pkgver/"
+ $srcdir/install_vocp.pl "$pkgdir/"
+ cd "$srcdir/$pkgname-$pkgver/prog/VOCP"
+
+ make install DESTDIR="$pkgdir/"
+ # remove perllocal.pod and .packlist
+ find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
+ install -D -m555 $srcdir/convert_sound.pl $pkgdir/usr/local/vocp/bin/convert_sound.pl
+}
diff --git a/convert_sound.pl b/convert_sound.pl
new file mode 100755
index 00000000000..6bf7e3eac8c
--- /dev/null
+++ b/convert_sound.pl
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+
+use strict;
+
+
+
+use vars qw {
+ $Cp
+ @Message_dirs
+ $VOCP_conf_dir
+ $Spool_dir
+ %Spool_subdirs
+ %LocalProgram_files
+ %Other_Local_exes
+ %Config_files
+ @Doc_files
+ @Com_shell_examples
+ $Version
+ $VOCP_group
+ $Groupadd
+ $LocalDir
+ %PerlModule_dirs
+ $Pwd
+ %RequiredModules
+ @LogFiles
+ $pvftormdopt
+ $LogDir
+ };
+
+if (defined $ARGV[0] ) {
+$pvftormdopt = $ARGV[0];
+} else {
+$pvftormdopt = 'Lucent 5';
+}
+$LogDir='/var/log/';
+
+$Cp='/usr/bin/cp';
+
+$LocalDir = "/usr/local/vocp";
+
+$VOCP_conf_dir = "/etc/vocp";
+
+$Spool_dir = "/var/spool/voice";
+
+@Message_dirs = (
+ 'messages/num',
+ 'messages/day',
+ 'messages/system',
+ 'messages/menu',
+ 'messages',
+ );
+
+
+sub convert_sound {
+
+ #Do conversion of sound files
+ my $pvftormd = '/usr/bin/pvftormd';
+
+ print "\nConverting sound files, this can take a while...\n";
+
+ chdir $LocalDir;
+
+ foreach my $dir (@Message_dirs) {
+
+ system("ls $dir/*.pvf | sed 's/\.pvf//' | xargs -i $pvftormd $pvftormdopt {}.pvf $Spool_dir/{}.rmd");
+
+ }
+ print "Done: sound files converted to rmd format. "
+ ."Test them with:\n"
+ ."vm play -s -v ./sounds/path/to/file.rmd\n\n";
+
+ return 1;
+}
+&convert_sound;
diff --git a/install_vocp.pl b/install_vocp.pl
new file mode 100755
index 00000000000..0c893c0c587
--- /dev/null
+++ b/install_vocp.pl
@@ -0,0 +1,272 @@
+#!/usr/bin/perl
+
+use strict;
+
+
+
+use vars qw {
+ $Cp
+ @Message_dirs
+ $VOCP_conf_dir
+ $Spool_dir
+ %Spool_subdirs
+ %LocalProgram_files
+ %Other_Local_exes
+ %Config_files
+ @Doc_files
+ @Com_shell_examples
+ $Version
+ $VOCP_group
+ $Groupadd
+ $LocalDir
+ %PerlModule_dirs
+ $Pwd
+ %RequiredModules
+ @LogFiles
+ $basedir
+ $LogDir
+ };
+
+$basedir=$ARGV[0];
+
+$LogDir='/var/log/';
+
+$Cp='/usr/bin/cp';
+
+$LocalDir = "$basedir/usr/local/vocp";
+
+$VOCP_conf_dir = "$basedir/etc/vocp";
+
+$Spool_dir = "$basedir/var/spool/voice";
+
+@Message_dirs = (
+ 'messages/num',
+ 'messages/day',
+ 'messages/system',
+ 'messages/menu',
+ 'messages',
+ );
+
+%Spool_subdirs = (
+ 'incoming' => 'incoming',
+ 'cache' => 'incoming/cache',
+ 'messages' => 'messages',
+ 'commands' => 'commands',
+ 'num' => 'messages/num',
+ 'day' => 'messages/day',
+ 'system' => 'messages/system',
+ 'menu' => 'messages/menu',
+ );
+
+
+%PerlModule_dirs = (
+ 'VOCP' => 'prog/VOCP',
+);
+
+%LocalProgram_files = (
+ 'installer' => 'install_vocp.pl',
+ 'sampleconv' => 'modify_sample_rate.pl',
+ 'vocpweb' => 'vocpweb',
+ 'progbin' => 'prog/bin',
+ 'progrun' => 'prog/run',
+ 'proglib' => 'prog/lib',
+ 'images' => 'images',
+ 'sounds' => 'sounds',
+ 'testfax' => 'images/faxtest.g3',
+);
+
+
+%Other_Local_exes = (
+
+ 'vocp' => 'prog/vocp.pl',
+);
+
+
+%Config_files = (
+ 'genconf' => 'prog/vocp.conf',
+ 'boxconf' => 'prog/boxes.conf',
+ 'boxshadow' => 'prog/boxes.conf.shadow',
+ 'cidconf' => 'prog/cid-filter.conf',
+ 'boxsample' => 'prog/boxes.conf.sample',
+);
+
+@LogFiles = ("$basedir/var/log/vocp.log", "$basedir/var/log/vocp-calls.log");
+
+
+@Doc_files = (
+ 'doc/*',
+ );
+
+@Com_shell_examples = ('commands/seleclisting.pl', 'commands/ip.pl', 'commands/date.pl', 'commands/echo.pl', 'commands/motd.pl');
+
+$VOCP_group = 'vocp';
+
+
+
+# Installs are the relevant files, sets permissions and
+# converts the sound files.
+#
+# Uses a bunch of system() calls - not pretty, but not
+# too important, used only once...
+#
+# To be done: Check return values of all system() calls...
+
+#main
+{
+
+ $Pwd = `pwd`;
+ chomp($Pwd);
+
+
+ system("touch " . join(" ", @LogFiles));
+
+ ########################### Directories ################################
+
+ print "\nCreating directories...\n";
+ print "\t$VOCP_conf_dir\n";
+ system("mkdir -p $VOCP_conf_dir");
+ system("mkdir -p $LogDir");
+
+
+ # Documentation dir
+ my $docdir = "$LocalDir/doc";
+
+ print "\t$docdir\n";
+ # We call system to use the -p option
+ system("mkdir -p $docdir");
+
+ print "\t$Spool_dir\n";
+ system("mkdir -p $Spool_dir");
+
+ foreach my $dir (values %Spool_subdirs) {
+ print "\t$Spool_dir/$dir\n";
+ system("mkdir -p $Spool_dir/$dir");
+ }
+
+ print "\nDone.\n";
+
+ ########################### VOCP modules ################################
+ #Copy program files
+ chdir($Pwd);
+ print "Installing VOCP Perl modules...\n";
+ chdir($PerlModule_dirs{'VOCP'});
+ system("perl Makefile.PL; make; make install");
+ print "\nDone\n\n\n";
+ chdir($Pwd);
+
+
+
+ ########################### Utility programs and files ################################
+
+ print "Copying files...\n";
+
+ print "\nConfiguration files\n";
+ foreach my $file (values %Config_files) {
+ print "\t$file to $VOCP_conf_dir\n";
+ my $filename;
+ if ($file =~ m|([^/]+$)|) { #usually will
+ $filename = $1;
+ }
+ if ($filename && (-e "$VOCP_conf_dir/$filename") ) {
+ print "$filename exists. Saving new file as $filename.new - do a diff to see what has changed\n";
+ system("$Cp $file $VOCP_conf_dir/$filename.new");
+ } else {
+ system("$Cp $file $VOCP_conf_dir");
+ }
+ }
+
+ print "\nDocs\n";
+ foreach my $file (@Doc_files) {
+ print "\t$file to $docdir\n";
+ system("$Cp $file $docdir");
+ }
+
+
+
+ chdir($LocalProgram_files{'progbin'});
+
+ my $compiler = $ENV{'CC'} || 'gcc';
+ print "Creating pwcheck setgid wrapper\n";
+ system("$compiler -o pwcheck pwcheck.c");
+ print "Creating xfer_to_vocp setuid wrapper\n";
+ system("$compiler -o xfer_to_vocp xfer_to_vocp.c");
+ my $festDir='/usr';
+ $festDir =~ s|/$||;
+ system("perl -pi -e \"s|txt2wavProg = '/path/to/bin/text2wave'|txt2wavProg = '$festDir/bin/text2wave'|g\" txttopvf")
+ if ($festDir);
+
+
+
+ chdir ($Pwd);
+
+ foreach my $file (values %LocalProgram_files) {
+ print "Installing $file to $LocalDir\n";
+ system("$Cp -R $file $LocalDir");
+ }
+
+ foreach my $file (values %Other_Local_exes) {
+ print "Installing $file to $LocalDir/bin\n";
+ system("$Cp -R $file $LocalDir/bin");
+ }
+
+
+
+ print "\nPVF files to $LocalDir\n";
+ foreach my $dir (@Message_dirs) {
+ #print "\t$dir/*.pvf to $Spool_dir/$dir\n";
+ system("mkdir -p $LocalDir/$dir");
+ system("$Cp $dir/*.pvf $LocalDir/$dir");
+ }
+
+ print "\nCommand shell examples and stock programs\n";
+ my $cmdspooldir = "$Spool_dir/$Spool_subdirs{'commands'}";
+ foreach my $command (@Com_shell_examples)
+ {
+ my $filename;
+ if ($command =~ m|.+/([^/]+)$|)
+ {
+ $filename = $1;
+ } else {
+ $filename = $command;
+ }
+ next if (-e "$cmdspooldir/$filename");
+
+
+ print "\t$filename to $cmdspooldir\n";
+ system("$Cp $command $cmdspooldir");
+ chmod oct('0755'), "$cmdspooldir/$filename";
+ }
+
+
+
+
+ print "\nWhat should the name of the new group be?\n[$VOCP_group]: ";
+ # The incoming dir - so the the messages script can delete messages belonging to the owner
+ chmod oct('1777'), "$Spool_dir/$Spool_subdirs{'incoming'}";
+
+
+ my $uid=0;
+ my $gid=498;
+ system("groupadd -g $gid vocp");
+
+
+ chown $uid, $gid, $LocalDir . '/bin/messages.pl', $VOCP_conf_dir . '/boxes.conf', $VOCP_conf_dir . '/boxes.conf.shadow',
+ "$Spool_dir/$Spool_subdirs{'cache'}", "$LocalDir/bin/pwcheck.pl", "$LocalDir/bin/pwcheck";
+
+ chmod oct('0644'), $VOCP_conf_dir . '/boxes.conf';
+ chmod oct('0640'), $VOCP_conf_dir . '/boxes.conf.shadow';
+ chmod oct('2755'), $LocalDir . '/bin/messages.pl';
+
+ if (-e $LocalDir . '/bin/pwcheck')
+ {
+ chmod oct('2755'), $LocalDir . '/bin/pwcheck';
+ } else {
+ chmod oct('2755'), $LocalDir . '/bin/pwcheck.pl';
+ }
+ chmod oct('0755'), $LocalDir . '/bin/xvocp.pl';
+ chmod oct('0755'), $LocalDir . '/bin/boxconf.pl';
+
+ chmod oct('0775'), "$Spool_dir/$Spool_subdirs{'cache'}";
+
+
+}
diff --git a/vocp.install b/vocp.install
new file mode 100644
index 00000000000..749433abe18
--- /dev/null
+++ b/vocp.install
@@ -0,0 +1,8 @@
+#convert sound files and remove them
+post_install(){
+ /usr/local/vocp/bin/convert_sound.pl
+}
+post_remove(){
+ rm -rf /var/spool/voice/messages
+}
+