summaryrefslogtreecommitdiff
path: root/torrus/setup_tools
diff options
context:
space:
mode:
authorivan <ivan>2010-12-27 00:04:44 +0000
committerivan <ivan>2010-12-27 00:04:44 +0000
commit74e058c8a010ef6feb539248a550d0bb169c1e94 (patch)
tree6e8d3efb218dd0f41970b62c7f29758d1ae9a937 /torrus/setup_tools
parent35359a73152b3d7a9ad5e3d37faf81f6fedb76e8 (diff)
import torrus 1.0.9
Diffstat (limited to 'torrus/setup_tools')
-rw-r--r--torrus/setup_tools/Bundle/Torrus.pm85
-rw-r--r--torrus/setup_tools/check_perlthreading.pl37
-rwxr-xr-xtorrus/setup_tools/configure_fhs19
-rw-r--r--torrus/setup_tools/mkvardir.sh.in57
-rwxr-xr-xtorrus/setup_tools/replace_rrfw.sh8
-rw-r--r--torrus/setup_tools/substvars.sh.in98
6 files changed, 304 insertions, 0 deletions
diff --git a/torrus/setup_tools/Bundle/Torrus.pm b/torrus/setup_tools/Bundle/Torrus.pm
new file mode 100644
index 0000000..7fc37ef
--- /dev/null
+++ b/torrus/setup_tools/Bundle/Torrus.pm
@@ -0,0 +1,85 @@
+# Torrus Perl bundle
+# Copyright (C) 2002 Stanislav Sinyagin
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+
+# $Id: Torrus.pm,v 1.1 2010-12-27 00:04:39 ivan Exp $
+# Stanislav Sinyagin <ssinyagin@yahoo.com>
+#
+#
+
+
+package Bundle::Torrus;
+
+$VERSION = '1.00';
+
+__END__
+
+=head1 NAME
+
+Bundle::Torrus - A bundle to install Torrus prerequisite modules
+
+=head1 SYNOPSIS
+
+C<perl -I `pwd`/lib -MCPAN -e 'install Bundle::Torrus'>
+
+=head1 CONTENTS
+
+File::Temp - required by XML::SAX
+
+XML::NamespaceSupport 1.07 - required by XML::LibXML
+
+XML::SAX 0.11 - required by XML::LibXML
+
+XML::LibXML::Common - required by XML::LibXML
+
+AppConfig - required by Template
+
+File::Spec - required by Template
+
+Crypt::DES 2.03 - required by Net::SNMP
+
+Digest::MD5 2.11 - required by Net::SNMP
+
+Digest::SHA1 1.02 - required by Net::SNMP
+
+Digest::HMAC 1.00 - required by Net::SNMP
+
+MIME::Base64 - required by URI::Escape
+
+
+XML::LibXML 1.54 - older versions do not handle charsets properly
+
+BerkeleyDB 0.19 - older versions do not have trunc()
+
+Template - this is template-toolkit
+
+Proc::Daemon
+
+Net::SNMP 5.2.0 - older versions may not work
+
+URI::Escape
+
+Apache::Session
+
+Date::Parse
+
+JSON
+
+=head1 AUTHOR
+
+Stanislav Sinyagin E<lt>F<ssinyagin@yahoo.com>E<gt>
+
+=cut
diff --git a/torrus/setup_tools/check_perlthreading.pl b/torrus/setup_tools/check_perlthreading.pl
new file mode 100644
index 0000000..22666e3
--- /dev/null
+++ b/torrus/setup_tools/check_perlthreading.pl
@@ -0,0 +1,37 @@
+
+use threads;
+
+$| = 1;
+
+print "The child thread must keep ticking while the main thread sleeps\n";
+print "If it's not so, then we have a compatibility problem\n";
+
+
+
+my $thrChild = threads->create( \&child );
+$thrChild->detach();
+
+print "P> Launched the child thread. Now I sleep 20 seconds\n";
+sleep(20);
+print "P> Parent woke up. Was there ticking inbetween?\n";
+
+exit 0;
+
+
+
+sub child
+{
+ print "C> Child thread started. I will print 10 lines, one per second\n";
+
+ foreach my $i (1..10)
+ {
+ print("C> Child tick " . $i . "\n");
+ sleep(1);
+ }
+}
+
+
+
+
+
+
diff --git a/torrus/setup_tools/configure_fhs b/torrus/setup_tools/configure_fhs
new file mode 100755
index 0000000..69a07b1
--- /dev/null
+++ b/torrus/setup_tools/configure_fhs
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Configure script for FHC compliant setup (http://www.pathname.com/fhs/)
+# $Id: configure_fhs,v 1.1 2010-12-27 00:04:39 ivan Exp $
+# Stanislav Sinyagin <ssinyagin@yahoo.com>
+
+if test ! -x ./configure; then
+ echo "$0: cannot find ./configure" 2>&1
+ echo "Usage: ./setup_tools/configure_fhs [configure options]..." 2>&1
+ exit 1
+fi
+
+./configure \
+ --prefix=/opt \
+ --mandir=/opt/share/man \
+ pkghome=/opt/torrus \
+ sitedir=/etc/opt/torrus \
+ "$@"
+ \ No newline at end of file
diff --git a/torrus/setup_tools/mkvardir.sh.in b/torrus/setup_tools/mkvardir.sh.in
new file mode 100644
index 0000000..568ba13
--- /dev/null
+++ b/torrus/setup_tools/mkvardir.sh.in
@@ -0,0 +1,57 @@
+#!@SHELL@
+# Copyright (C) 2002 Stanislav Sinyagin
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+
+# $Id: mkvardir.sh.in,v 1.1 2010-12-27 00:04:39 ivan Exp $
+# Stanislav Sinyagin <ssinyagin@yahoo.com>
+#
+
+dir=$1
+user=@var_user@
+group=@var_group@
+mode=@var_mode@
+SHELL=@SHELL@
+
+if test ! -d $dir; then
+
+ @install_sh@ -d $dir || exit 1
+
+ if test "@enable_varperm@" = "yes"; then
+
+ if test "x@host_os@" != "xcygwin"; then
+ test -z "$user" && user=torrus
+ test -z "$group" && group=torrus
+ test -z "$mode" && mode=775
+ fi
+
+ test -z "$mode" || chmod $mode $dir || (rmdir $dir; exit 1)
+ test -z "$user" || chown $user $dir || (rmdir $dir; exit 1)
+ test -z "$group" || (chgrp $group $dir && chmod g+s $dir) || \
+ (rmdir $dir; exit 1)
+
+ fi
+
+fi
+
+exit 0
+
+
+
+# Local Variables:
+# mode: shell-script
+# indent-tabs-mode: nil
+# perl-indent-level: 4
+# End:
diff --git a/torrus/setup_tools/replace_rrfw.sh b/torrus/setup_tools/replace_rrfw.sh
new file mode 100755
index 0000000..87b7059
--- /dev/null
+++ b/torrus/setup_tools/replace_rrfw.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# replace all ocurrences of RRFW and rrfw to Torrus and torrus
+
+IN=$1
+sed -e 's/RRFW/Torrus/g' -e 's/rrfw/torrus/g' $IN >/tmp/$$
+mv /tmp/$$ $IN
+
diff --git a/torrus/setup_tools/substvars.sh.in b/torrus/setup_tools/substvars.sh.in
new file mode 100644
index 0000000..15273cb
--- /dev/null
+++ b/torrus/setup_tools/substvars.sh.in
@@ -0,0 +1,98 @@
+#!@SHELL@
+# Copyright (C) 2002 Stanislav Sinyagin
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+
+# $Id: substvars.sh.in,v 1.1 2010-12-27 00:04:39 ivan Exp $
+# Stanislav Sinyagin <ssinyagin@yahoo.com>
+#
+
+PACKAGE=@PACKAGE@
+prefix=@prefix@
+datarootdir=@datarootdir@
+pkghome=@pkghome@
+exec_prefix=@exec_prefix@
+perllibdir=@perllibdir@
+pluginsdir=@pluginsdir@
+sysconfdir=@sysconfdir@
+varprefix=@varprefix@
+sitedir=@sitedir@
+supdir=@supdir@
+styldir=@supdir@/styling
+
+devdiscover_config_pl=@cfgdefdir@/devdiscover-config.pl
+torrus_config_pl=@cfgdefdir@/torrus-config.pl
+
+torrus_siteconfig_pl=@siteconfdir@/torrus-siteconfig.pl
+snmptrap_siteconfig_pl=@siteconfdir@/snmptrap-siteconfig.pl
+email_siteconfig_pl=@siteconfdir@/email-siteconfig.pl
+devdiscover_siteconfig_pl=@siteconfdir@/devdiscover-siteconfig.pl
+notify_siteconfig_pl=@siteconfdir@/notify-siteconfig.pl
+
+@SED@ \
+ -e "s,\@FIND\@,@FIND@,g" \
+ -e "s,\@PERL\@,@PERL@,g" \
+ -e "s,\@RM\@,@RM@,g" \
+ -e "s,\@SHELL\@,@SHELL@,g" \
+ -e "s,\@VERSION\@,@VERSION@,g" \
+ -e "s,\@bindir\@,@bindir@,g" \
+ -e "s,\@cachedir\@,@cachedir@,g" \
+ -e "s,\@cfgdefdir\@,@cfgdefdir@,g" \
+ -e "s,\@dbhome\@,@dbhome@,g" \
+ -e "s,\@defrrddir\@,@defrrddir@,g" \
+ -e "s,\@devdiscover_config_pl\@,$devdiscover_config_pl,g" \
+ -e "s,\@devdiscover_siteconfig_pl\@,$devdiscover_siteconfig_pl,g" \
+ -e "s,\@distxmldir\@,@distxmldir@,g" \
+ -e "s,\@pkgdocdir\@,@pkgdocdir@,g" \
+ -e "s,\@email_siteconfig_pl\@,$email_siteconfig_pl,g" \
+ -e "s,\@exmpdir\@,@exmpdir@,g" \
+ -e "s,\@logdir\@,@logdir@,g" \
+ -e "s,\@mandir\@,@mandir@,g" \
+ -e "s,\@mansec_misc\@,@mansec_misc@,g" \
+ -e "s,\@mansec_usercmd\@,@mansec_usercmd@,g" \
+ -e "s,\@notify_siteconfig_pl\@,$notify_siteconfig_pl,g" \
+ -e "s,\@perlithreads\@,@perlithreads@,g" \
+ -e "s,\@perllibdir\@,@perllibdir@,g" \
+ -e "s,\@perllibdirs\@,@perllibdirs@,g" \
+ -e "s,\@piddir\@,@piddir@,g" \
+ -e "s,\@pkgbindir\@,@pkgbindir@,g" \
+ -e "s,\@pkghome\@,@pkghome@,g" \
+ -e "s,\@plugdevdisccfgdir\@,@plugdevdisccfgdir@,g" \
+ -e "s,\@pluginsdir\@,@pluginsdir@,g" \
+ -e "s,\@plugtorruscfgdir\@,@plugtorruscfgdir@,g" \
+ -e "s,\@plugwrapperdir\@,@plugwrapperdir@,g" \
+ -e "s,\@reportsdir\@,@reportsdir@,g" \
+ -e "s,\@scriptsdir\@,@scriptsdir@,g" \
+ -e "s,\@seslockdir\@,@seslockdir@,g" \
+ -e "s,\@sesstordir\@,@sesstordir@,g" \
+ -e "s,\@siteconfdir\@,@siteconfdir@,g" \
+ -e "s,\@sitedir\@,@sitedir@,g" \
+ -e "s,\@sitexmldir\@,@sitexmldir@,g" \
+ -e "s,\@snmptrap_siteconfig_pl\@,$snmptrap_siteconfig_pl,g" \
+ -e "s,\@styldir\@,$styldir,g" \
+ -e "s,\@supdir\@,@supdir@,g" \
+ -e "s,\@tmpldir\@,@tmpldir@,g" \
+ -e "s,\@tmpluserdir\@,@tmpluserdir@,g" \
+ -e "s,\@torrus_config_pl\@,$torrus_config_pl,g" \
+ -e "s,\@torrus_siteconfig_pl\@,$torrus_siteconfig_pl,g" \
+ -e "s,\@torrus_user\@,@torrus_user@,g" \
+ -e "s,\@webplaindir\@,@webplaindir@,g" \
+ $1
+
+# Local Variables:
+# mode: shell-script
+# indent-tabs-mode: nil
+# perl-indent-level: 4
+# End: