From f663f516f5626293c38f988dce4942fb3d599ff1 Mon Sep 17 00:00:00 2001 From: hfrenzel-guest Date: Sat, 21 Jul 2007 10:08:20 +0000 Subject: [PATCH 1/1] initial inject git-svn-id: svn://svn.debian.org/svn/pkg-nagios/nagvis/trunk@1199 98d490a6-b407-0410-aaaa-fdee166ba3f5 --- debian/README.Debian | 20 ++ debian/apache.conf | 4 + debian/changelog | 7 + debian/compat | 1 + debian/config | 17 + debian/control | 25 ++ debian/copyright | 37 +++ debian/dirs | 2 + debian/docs | 1 + debian/examples | 4 + debian/install | 4 + debian/links | 3 + debian/patches/00list | 1 + debian/patches/pathnames.dpatch | 568 ++++++++++++++++++++++++++++++++ debian/postinst | 80 +++++ debian/rules | 118 +++++++ debian/watch | 22 ++ 17 files changed, 914 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/apache.conf create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/config create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/examples create mode 100644 debian/install create mode 100644 debian/links create mode 100644 debian/patches/00list create mode 100755 debian/patches/pathnames.dpatch create mode 100644 debian/postinst create mode 100755 debian/rules create mode 100644 debian/watch diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..dd6fb47 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,20 @@ +nagvis for Debian +----------------- + +Thank you using the NagVis addon for Nagios Network Monitoring System. + +To get it work you have to be sure the ndoutils package is installed and works +fine. NagVis uses the database account of ndoutils to connect to the database. If +you change this account with reconfiguring ndoutils, don't forget to +dpkg-reconfigure nagvis too to get the new configuration. + +If you got still errors of not working NDOUtils, check your /etc/nagios2/nagios.cfg +if the broker module ndomod.o is enabled and check_external_commands=1 is set to +get the table _programstatus updated. +(See http://www.nagvis.org/docs/general/often_reported_errors#nagiosnotrunning) + +There are some examples in /usr/share/doc/nagvis/examples/demo to see NagVis +functionality. Just copy the files in demo/ to the appropriate location and change +its owner and group to be www-data:www-data. + + -- Hendrik Frenzel Sat, 14 Jul 2007 11:27:33 +0200 diff --git a/debian/apache.conf b/debian/apache.conf new file mode 100644 index 0000000..464b8fa --- /dev/null +++ b/debian/apache.conf @@ -0,0 +1,4 @@ + + DirectoryIndex index.php + + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..c443fdb --- /dev/null +++ b/debian/changelog @@ -0,0 +1,7 @@ +nagvis (1.1rc2-1) unstable; urgency=low + + * Initial release (Closes: #433048: ITP: nagvis -- Visualization addon for + Nagios) + + -- Hendrik Frenzel Sat, 14 Jul 2007 11:37:16 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/config b/debian/config new file mode 100644 index 0000000..7f21a9e --- /dev/null +++ b/debian/config @@ -0,0 +1,17 @@ +#!/bin/sh + +. /usr/share/debconf/confmodule + +tmp=`mktemp` +dbconfig-load-include -f sh \ + -udbc_dbuser -pdbc_dbpass -ddbc_dbname -sdbc_dbserver -Pdbc_dbport \ + /etc/dbconfig-common/ndoutils-mysql.conf > $tmp +. $tmp +rm -f $tmp + +if [ -f /usr/share/dbconfig-common/dpkg/frontend.config.mysql ]; then + . /usr/share/dbconfig-common/dpkg/frontend.config.mysql + dbc_go nagvis $@ +fi +db_stop + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f84658e --- /dev/null +++ b/debian/control @@ -0,0 +1,25 @@ +Source: nagvis +Section: misc +Priority: extra +Maintainer: Hendrik Frenzel +Build-Depends: debhelper (>= 5), dpatch +Standards-Version: 3.7.2 + +Package: nagvis +Architecture: all +Depends: nagios2, ndoutils-mysql, ucf, dbconfig-common, php5-mysql, php5-gd +Description: Visualization addon for Nagios + NagVis can be used to visualize Nagios Data, e.g. to display IT processes like + a mail system or a network infrastructure. + . + Key features are: + . + * Display of single Hosts or Services + * Display the state of a Host dependent on the state of its services + ("recognize services") + * Visualize a complete Host- oder Servicegroup with one icon + * Define Sub-Map icons wich represent a complete NagVis Map of + Hosts/Services/Groups in one icon (drill down) + * Visualization of complete IT Processes using self drawn graphics + . + Homepage: http://www.nagvis.org diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..c41614d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by Hendrik Frenzel on +Wed, 11 Jul 2007 21:50:31 +0200. + +It was downloaded from http://www.nagvis.org + +Upstream Authors: + + Lars Michelsen + Michael Luebben + +Copyright: + + Copyright (C) 2007 Lars Michelsen + Copyright (C) 2007 Michael Luebben + +License: + + This package 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 package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2007, Hendrik Frenzel and +is licensed under the GPL, see above. + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..32548f9 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +etc/nagvis/maps +usr/share/nagvis/htdocs/nagvis/images/maps diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e845566 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/examples b/debian/examples new file mode 100644 index 0000000..f7d4e5e --- /dev/null +++ b/debian/examples @@ -0,0 +1,4 @@ +dist/class.GlobalBackend-html.php +dist/class.GlobalBackend-html.readme +debian/tmp/demo +debian/apache.conf diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..96ca6a9 --- /dev/null +++ b/debian/install @@ -0,0 +1,4 @@ +debian/tmp/etc/nagvis +debian/tmp/etc/nagvis/maps +debian/tmp/usr/share/nagvis +debian/tmp/usr/share/nagvis/htdocs/nagvis/images/maps diff --git a/debian/links b/debian/links new file mode 100644 index 0000000..ca706d4 --- /dev/null +++ b/debian/links @@ -0,0 +1,3 @@ +etc/nagvis/maps usr/share/nagvis/htdocs/nagvis/etc/maps +etc/nagvis/templates usr/share/nagvis/htdocs/nagvis/etc/templates +usr/share/nagvis/htdocs usr/share/nagios2/htdocs/nagvis diff --git a/debian/patches/00list b/debian/patches/00list new file mode 100644 index 0000000..a35e952 --- /dev/null +++ b/debian/patches/00list @@ -0,0 +1 @@ +pathnames diff --git a/debian/patches/pathnames.dpatch b/debian/patches/pathnames.dpatch new file mode 100755 index 0000000..204d5d9 --- /dev/null +++ b/debian/patches/pathnames.dpatch @@ -0,0 +1,568 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## pathnames.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad nagvis-1.1rc2~/nagvis/draw.php nagvis-1.1rc2/nagvis/draw.php +--- nagvis-1.1rc2~/nagvis/draw.php 2007-07-12 16:36:49.000000000 +0200 ++++ nagvis-1.1rc2/nagvis/draw.php 2007-07-13 23:29:59.000000000 +0200 +@@ -12,20 +12,20 @@ + ## For developer guidlines have a look at http://www.nagvis.org ## + ########################################################################## + +-require("./includes/classes/class.GlobalDebug.php"); +-require("./includes/classes/class.GlobalGraphic.php"); +-require("./includes/classes/class.GlobalMainCfg.php"); +-require("./includes/classes/class.GlobalMapCfg.php"); +-require("./includes/classes/class.GlobalMap.php"); +-require("./includes/classes/class.GlobalPage.php"); +-require("./includes/classes/class.GlobalLanguage.php"); +-require("./includes/classes/class.GlobalBackendMgmt.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalDebug.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalGraphic.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMainCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMapCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMap.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalPage.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalLanguage.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalBackendMgmt.php"); + +-require("./includes/classes/class.NagVisMap.php"); +-require("./includes/classes/class.NagVisBackground.php"); +-require("./includes/classes/class.NagVisMapCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.NagVisMap.php"); ++require("/usr/share/nagvis/includes/classes/class.NagVisBackground.php"); ++require("/usr/share/nagvis/includes/classes/class.NagVisMapCfg.php"); + +-$MAINCFG = new GlobalMainCfg('./etc/config.ini.php'); ++$MAINCFG = new GlobalMainCfg('/etc/nagvis/config.ini.php'); + + $MAPCFG = new NagVisMapCfg($MAINCFG,$_GET['map']); + $MAPCFG->readMapConfig(); +@@ -37,4 +37,4 @@ + $BACKGROUND = new NagVisBackground($MAINCFG,$MAPCFG,$LANG,$BACKEND); + $BACKGROUND->parseObjects(); + $BACKGROUND->parseMap(); +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/nagvis/etc/config.ini.php.dist nagvis-1.1rc2/nagvis/etc/config.ini.php.dist +--- nagvis-1.1rc2~/nagvis/etc/config.ini.php.dist 2007-07-12 16:36:18.000000000 +0200 ++++ nagvis-1.1rc2/nagvis/etc/config.ini.php.dist 2007-07-13 23:29:59.000000000 +0200 +@@ -57,11 +57,11 @@ + ; path options + [paths] + ; absolute physical NagVis path +-;base="/usr/local/nagios/share/nagvis/" ++;base="/usr/share/nagvis/htdocs" + ; absolute html NagVis path +-;htmlbase="/nagios/nagvis" ++;htmlbase="/nagios2/nagvis" + ; absolute html NagVis cgi path +-;htmlcgi="/nagios/cgi-bin" ++;htmlcgi="/nagios2/cgi-bin" + + ; options for the NDO-Backend + ; in this example the ID of the Backend is "ndomy_1" you can define another ID. +diff -urNad nagvis-1.1rc2~/nagvis/includes/classes/class.GlobalMainCfg.php nagvis-1.1rc2/nagvis/includes/classes/class.GlobalMainCfg.php +--- nagvis-1.1rc2~/nagvis/includes/classes/class.GlobalMainCfg.php 2007-07-12 16:36:43.000000000 +0200 ++++ nagvis-1.1rc2/nagvis/includes/classes/class.GlobalMainCfg.php 2007-07-14 00:06:09.000000000 +0200 +@@ -123,43 +123,43 @@ + 'type' => 'string'), + 'htmlbase' => Array('must' => 1, + 'editable' => 1, +- 'default' => '/nagios/nagvis', ++ 'default' => '/nagios2/nagvis', + 'type' => 'string'), + 'htmlcgi' => Array('must' => 1, + 'editable' => 1, +- 'default' => '/nagios/cgi-bin', ++ 'default' => '/nagios2/cgi-bin', + 'type' => 'string'), + 'htmlimages' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/images/', ++ 'default' => '/nagios2/nagvis/nagvis/images/', + 'type' => 'string'), + 'htmlhovertemplates' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/etc/templates/hover/', ++ 'default' => '/nagios2/nagvis/nagvis/etc/templates/hover/', + 'type' => 'string'), + 'htmlheadertemplates' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/etc/templates/header/', ++ 'default' => '/nagios2/nagvis/nagvis/etc/templates/header/', + 'type' => 'string'), + 'htmlhovertemplateimages' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/images/templates/hover/', ++ 'default' => '/nagios2/nagvis/nagvis/images/templates/hover/', + 'type' => 'string'), + 'htmlheadertemplateimages' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/images/templates/header/', ++ 'default' => '/nagios2/nagvis/nagvis/images/templates/header/', + 'type' => 'string'), + 'htmlicon' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/images/iconsets/', ++ 'default' => '/nagios2/nagvis/nagvis/images/iconsets/', + 'type' => 'string'), + 'htmlshape' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/images/shape/', ++ 'default' => '/nagvis/nagvis/images/shape/', + 'type' => 'string'), + 'htmlmap' => Array('must' => 0, + 'editable' => 0, +- 'default' => '/nagios/nagvis/nagvis/images/maps/', ++ 'default' => '/nagios2/nagvis/nagvis/images/maps/', + 'type' => 'string'), + 'htmldoku' => Array('must' => 1, + 'editable' => 0, +@@ -216,7 +216,7 @@ + 'type' => 'string'), + 'cgi' => Array('must' => 1, + 'editable' => 1, +- 'default' => '/usr/local/nagios/sbin/', ++ 'default' => '/usr/lib/cgi-bin/nagios2/', + 'type' => 'string')))), + 'internal' => Array('version' => Array('must' => 1, + 'editable' => 0, +@@ -251,11 +251,11 @@ + * @author Lars Michelsen + */ + function setPathsByBase($base,$htmlBase) { +- $this->validConfig['paths']['cfg']['default'] = $base.'nagvis/etc/'; ++ $this->validConfig['paths']['cfg']['default'] = '/etc/nagvis/'; + $this->validConfig['paths']['icon']['default'] = $base.'nagvis/images/iconsets/'; + $this->validConfig['paths']['shape']['default'] = $base.'nagvis/images/shapes/'; +- $this->validConfig['paths']['language']['default'] = $base.'nagvis/includes/languages/'; +- $this->validConfig['paths']['class']['default'] = $base.'nagvis/includes/classes/'; ++ $this->validConfig['paths']['language']['default'] = $base.'nagvis/languages/'; ++ $this->validConfig['paths']['class']['default'] = '/usr/share/nagvis/includes/classes/'; + $this->validConfig['paths']['map']['default'] = $base.'nagvis/images/maps/'; + $this->validConfig['paths']['hovertemplate']['default'] = $base.'nagvis/etc/templates/hover/'; + $this->validConfig['paths']['headertemplate']['default'] = $base.'nagvis/etc/templates/header/'; +diff -urNad nagvis-1.1rc2~/nagvis/includes/classes/class.NagVisFrontend.php nagvis-1.1rc2/nagvis/includes/classes/class.NagVisFrontend.php +--- nagvis-1.1rc2~/nagvis/includes/classes/class.NagVisFrontend.php 2007-07-12 16:36:44.000000000 +0200 ++++ nagvis-1.1rc2/nagvis/includes/classes/class.NagVisFrontend.php 2007-07-13 23:29:59.000000000 +0200 +@@ -25,8 +25,8 @@ + $this->BACKEND = &$BACKEND; + $this->LANG = new GlobalLanguage($MAINCFG,'nagvis:global'); + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('./includes/css/style.css'), +- 'jsIncludes'=>Array('./includes/js/nagvis.js','./includes/js/overlib.js','./includes/js/overlib_shadow.js'), ++ 'cssIncludes'=>Array('css/style.css'), ++ 'jsIncludes'=>Array('js/nagvis.js','js/overlib.js','js/overlib_shadow.js'), + 'extHeader'=>Array('', + ''), + 'allowedUsers'=> $this->MAPCFG->getValue('global',0, 'allowed_user'), +diff -urNad nagvis-1.1rc2~/nagvis/index.php nagvis-1.1rc2/nagvis/index.php +--- nagvis-1.1rc2~/nagvis/index.php 2007-07-12 16:36:49.000000000 +0200 ++++ nagvis-1.1rc2/nagvis/index.php 2007-07-13 23:29:59.000000000 +0200 +@@ -12,20 +12,20 @@ + ## For developer guidlines have a look at http://www.nagvis.org ## + ########################################################################## + +-require("./includes/classes/class.GlobalDebug.php"); +-require("./includes/classes/class.GlobalMainCfg.php"); +-require("./includes/classes/class.GlobalMapCfg.php"); +-require("./includes/classes/class.GlobalLanguage.php"); +-require("./includes/classes/class.GlobalPage.php"); +-require("./includes/classes/class.GlobalMap.php"); +-require("./includes/classes/class.GlobalGraphic.php"); +-require("./includes/classes/class.GlobalBackendMgmt.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalDebug.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMainCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMapCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalLanguage.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalPage.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMap.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalGraphic.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalBackendMgmt.php"); + +-require("./includes/classes/class.NagVisMapCfg.php"); +-require("./includes/classes/class.NagVisMap.php"); +-require("./includes/classes/class.NagVisFrontend.php"); ++require("/usr/share/nagvis/includes/classes/class.NagVisMapCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.NagVisMap.php"); ++require("/usr/share/nagvis/includes/classes/class.NagVisFrontend.php"); + +-$MAINCFG = new GlobalMainCfg('./etc/config.ini.php'); ++$MAINCFG = new GlobalMainCfg('/etc/nagvis/config.ini.php'); + + if(!isset($_GET['map'])) { + $_GET['map'] = ''; +@@ -59,4 +59,4 @@ + + $FRONTEND->printPage(); + } +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/ajax_handler.php nagvis-1.1rc2/wui/ajax_handler.php +--- nagvis-1.1rc2~/wui/ajax_handler.php 2007-07-12 16:37:16.000000000 +0200 ++++ nagvis-1.1rc2/wui/ajax_handler.php 2007-07-13 23:29:59.000000000 +0200 +@@ -1,16 +1,16 @@ + LANG = new GlobalLanguage($MAINCFG,'wui:addModify'); + + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('./includes/css/wui.css'), +- 'jsIncludes'=>Array('./includes/js/addmodify.js', +- './includes/js/ajax.js', +- './includes/js/wui.js'), ++ 'cssIncludes'=>Array('css/wui.css'), ++ 'jsIncludes'=>Array('js/addmodify.js', ++ 'js/ajax.js', ++ 'js/wui.js'), + 'extHeader'=>Array(''), + 'allowedUsers' => Array('EVERYONE')); + parent::GlobalPage($MAINCFG,$prop,'wui:addModify'); +@@ -471,4 +471,4 @@ + return $ret; + } + } +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/includes/classes/class.WuiBackendManagement.php nagvis-1.1rc2/wui/includes/classes/class.WuiBackendManagement.php +--- nagvis-1.1rc2~/wui/includes/classes/class.WuiBackendManagement.php 2007-07-12 16:37:53.000000000 +0200 ++++ nagvis-1.1rc2/wui/includes/classes/class.WuiBackendManagement.php 2007-07-13 23:29:59.000000000 +0200 +@@ -26,10 +26,10 @@ + $this->LANG = new GlobalLanguage($MAINCFG,'wui:backendManagement'); + + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('./includes/css/wui.css'), +- 'jsIncludes'=>Array('./includes/js/wui.js', +- './includes/js/BackendManagement.js', +- './includes/js/ajax.js'), ++ 'cssIncludes'=>Array('css/wui.css'), ++ 'jsIncludes'=>Array('js/wui.js', ++ 'js/BackendManagement.js', ++ 'js/ajax.js'), + 'extHeader'=>Array(''), + 'allowedUsers' => Array('EVERYONE'), + 'languageRoot' => 'wui:backendManagement'); +@@ -277,4 +277,4 @@ + return $ret; + } + } +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/includes/classes/class.WuiBackgroundManagement.php nagvis-1.1rc2/wui/includes/classes/class.WuiBackgroundManagement.php +--- nagvis-1.1rc2~/wui/includes/classes/class.WuiBackgroundManagement.php 2007-07-12 16:37:51.000000000 +0200 ++++ nagvis-1.1rc2/wui/includes/classes/class.WuiBackgroundManagement.php 2007-07-13 23:29:59.000000000 +0200 +@@ -26,10 +26,10 @@ + $this->LANG = new GlobalLanguage($MAINCFG,'wui:backgroundManagement'); + + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('./includes/css/wui.css'), +- 'jsIncludes'=>Array('./includes/js/BackgroundManagement.js', +- './includes/js/ajax.js', +- './includes/js/wui.js'), ++ 'cssIncludes'=>Array('css/wui.css'), ++ 'jsIncludes'=>Array('js/BackgroundManagement.js', ++ 'js/ajax.js', ++ 'js/wui.js'), + 'extHeader'=>Array(''), + 'allowedUsers' => Array('EVERYONE'), + 'languageRoot' => 'wui:backgroundManagement'); +@@ -198,4 +198,4 @@ + return $ret; + } + } +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/includes/classes/class.WuiEditMainCfg.php nagvis-1.1rc2/wui/includes/classes/class.WuiEditMainCfg.php +--- nagvis-1.1rc2~/wui/includes/classes/class.WuiEditMainCfg.php 2007-07-12 16:37:50.000000000 +0200 ++++ nagvis-1.1rc2/wui/includes/classes/class.WuiEditMainCfg.php 2007-07-13 23:29:59.000000000 +0200 +@@ -23,8 +23,8 @@ + $this->LANG = new GlobalLanguage($MAINCFG,'wui:editMainCfg'); + + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('./includes/css/wui.css'), +- 'jsIncludes'=>Array('./includes/js/wui.js'), ++ 'cssIncludes'=>Array('css/wui.css'), ++ 'jsIncludes'=>Array('js/wui.js'), + 'extHeader'=>Array(''), + 'allowedUsers' => Array('EVERYONE'), + 'languageRoot' => 'wui:editMainCfg'); +@@ -289,4 +289,4 @@ + return $ret; + } + } +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/includes/classes/class.WuiFrontend.php nagvis-1.1rc2/wui/includes/classes/class.WuiFrontend.php +--- nagvis-1.1rc2~/wui/includes/classes/class.WuiFrontend.php 2007-07-12 16:37:51.000000000 +0200 ++++ nagvis-1.1rc2/wui/includes/classes/class.WuiFrontend.php 2007-07-13 23:29:59.000000000 +0200 +@@ -24,13 +24,13 @@ + $this->LANG = new GlobalLanguage($this->MAINCFG,'wui:global'); + + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('../nagvis/includes/css/style.css','./includes/css/wui.css','./includes/css/office_xp/office_xp.css'), +- 'jsIncludes'=>Array('./includes/js/wui.js', +- './includes/js/ajax.js', +- './includes/js/jsdomenu.js', +- './includes/js/jsdomenu.inc.js', +- './includes/js/wz_jsgraphics.js', +- './includes/js/wz_dragdrop.js'), ++ 'cssIncludes'=>Array('../nagviscss/style.css','css/wui.css','css/office_xp/office_xp.css'), ++ 'jsIncludes'=>Array('js/wui.js', ++ 'js/ajax.js', ++ 'js/jsdomenu.js', ++ 'js/jsdomenu.inc.js', ++ 'js/wz_jsgraphics.js', ++ 'js/wz_dragdrop.js'), + 'extHeader'=>Array(""), + 'allowedUsers' => $this->MAPCFG->getValue('global', 0,'allowed_for_config'), + 'languageRoot' => 'wui:global'); +@@ -63,4 +63,4 @@ + if (DEBUG&&DEBUGLEVEL&1) debug('End method WuiFrontend::getMessages()'); + } + } +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/includes/classes/class.WuiMap.php nagvis-1.1rc2/wui/includes/classes/class.WuiMap.php +--- nagvis-1.1rc2~/wui/includes/classes/class.WuiMap.php 2007-07-12 16:37:56.000000000 +0200 ++++ nagvis-1.1rc2/wui/includes/classes/class.WuiMap.php 2007-07-13 23:29:59.000000000 +0200 +@@ -114,7 +114,7 @@ + $ret = array_merge($ret,$this->parseObjects()); + $ret = array_merge($ret,$this->parseInvisible()); + $ret = array_merge($ret,$this->makeObjectsMoveable()); +- $ret = array_merge($ret,Array("")); ++ $ret = array_merge($ret,Array("")); + + if (DEBUG&&DEBUGLEVEL&1) debug('End method WuiMap::parseMap(): Array(HTML)'); + return $ret; +@@ -531,4 +531,4 @@ + if (DEBUG&&DEBUGLEVEL&1) debug('Start method WuiMap::parseInvisible(): Array(HTML)'); + return $arr; + } +-} +\ No newline at end of file ++} +diff -urNad nagvis-1.1rc2~/wui/includes/classes/class.WuiMapManagement.php nagvis-1.1rc2/wui/includes/classes/class.WuiMapManagement.php +--- nagvis-1.1rc2~/wui/includes/classes/class.WuiMapManagement.php 2007-07-12 16:37:53.000000000 +0200 ++++ nagvis-1.1rc2/wui/includes/classes/class.WuiMapManagement.php 2007-07-13 23:29:59.000000000 +0200 +@@ -29,10 +29,10 @@ + $this->LANG = new GlobalLanguage($MAINCFG,'wui:mapManagement'); + + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('./includes/css/wui.css'), +- 'jsIncludes'=>Array('./includes/js/map_management.js', +- './includes/js/ajax.js', +- './includes/js/wui.js'), ++ 'cssIncludes'=>Array('css/wui.css'), ++ 'jsIncludes'=>Array('js/map_management.js', ++ 'js/ajax.js', ++ 'js/wui.js'), + 'extHeader'=>Array(''), + 'allowedUsers' => Array('EVERYONE'), + 'languageRoot' => 'wui:mapManagement'); +@@ -340,4 +340,4 @@ + return array_merge($FORM->getSubmitLine($label),$FORM->closeForm()); + } + } +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/includes/classes/class.WuiShapeManagement.php nagvis-1.1rc2/wui/includes/classes/class.WuiShapeManagement.php +--- nagvis-1.1rc2~/wui/includes/classes/class.WuiShapeManagement.php 2007-07-12 16:37:55.000000000 +0200 ++++ nagvis-1.1rc2/wui/includes/classes/class.WuiShapeManagement.php 2007-07-13 23:29:59.000000000 +0200 +@@ -21,10 +21,10 @@ + $this->LANG = new GlobalLanguage($MAINCFG,'wui:shapeManagement'); + + $prop = Array('title'=>$MAINCFG->getValue('internal', 'title'), +- 'cssIncludes'=>Array('./includes/css/wui.css'), +- 'jsIncludes'=>Array('./includes/js/ShapeManagement.js', +- './includes/js/ajax.js', +- './includes/js/wui.js'), ++ 'cssIncludes'=>Array('css/wui.css'), ++ 'jsIncludes'=>Array('js/ShapeManagement.js', ++ 'js/ajax.js', ++ 'js/wui.js'), + 'extHeader'=>Array(''), + 'allowedUsers' => Array('EVERYONE'), + 'languageRoot' => 'wui:shapeManagement'); +@@ -155,4 +155,4 @@ + if (DEBUG&&DEBUGLEVEL&1) debug('End method WuiShapeManagement::getJsLang(): Array(JS)'); + return $ret; + } +-} +\ No newline at end of file ++} +diff -urNad nagvis-1.1rc2~/wui/index.php nagvis-1.1rc2/wui/index.php +--- nagvis-1.1rc2~/wui/index.php 2007-07-12 16:37:57.000000000 +0200 ++++ nagvis-1.1rc2/wui/index.php 2007-07-13 23:29:59.000000000 +0200 +@@ -12,18 +12,18 @@ + ## For developer guidlines have a look at http://www.nagvis.org ## + ########################################################################## + +-require("../nagvis/includes/classes/class.GlobalDebug.php"); +-require("../nagvis/includes/classes/class.GlobalMainCfg.php"); +-require("../nagvis/includes/classes/class.GlobalMapCfg.php"); +-require("../nagvis/includes/classes/class.GlobalLanguage.php"); +-require("../nagvis/includes/classes/class.GlobalPage.php"); +-require("../nagvis/includes/classes/class.GlobalMap.php"); +-require("../nagvis/includes/classes/class.GlobalGraphic.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalDebug.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMainCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMapCfg.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalLanguage.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalPage.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalMap.php"); ++require("/usr/share/nagvis/includes/classes/class.GlobalGraphic.php"); + +-require("./includes/classes/class.WuiMainCfg.php"); +-require("./includes/classes/class.WuiMapCfg.php"); ++require("/usr/share/nagvis/wui/includes/classes/class.WuiMainCfg.php"); ++require("/usr/share/nagvis/wui/includes/classes/class.WuiMapCfg.php"); + +-$MAINCFG = new WuiMainCfg('../nagvis/etc/config.ini.php'); ++$MAINCFG = new WuiMainCfg('/etc/nagvis/config.ini.php'); + + // If not set, initialize $_GET['page'] + if(!isset($_GET['page'])) { +@@ -33,40 +33,40 @@ + // Display the wanted page, if nothing is set, display the map + switch($_GET['page']) { + case 'edit_config': +- require("../nagvis/includes/classes/class.GlobalForm.php"); +- require("./includes/classes/class.WuiEditMainCfg.php"); ++ require("/usr/share/nagvis/includes/classes/class.GlobalForm.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiEditMainCfg.php"); + + $FRONTEND = new WuiEditMainCfg($MAINCFG); + $FRONTEND->getForm(); + $FRONTEND->printPage(); + break; + case 'shape_management': +- require("../nagvis/includes/classes/class.GlobalForm.php"); +- require("./includes/classes/class.WuiShapeManagement.php"); ++ require("/usr/share/nagvis/includes/classes/class.GlobalForm.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiShapeManagement.php"); + $FRONTEND = new WuiShapeManagement($MAINCFG); + $FRONTEND->getForm(); + break; + case 'background_management': +- require("../nagvis/includes/classes/class.GlobalForm.php"); +- require("./includes/classes/class.WuiBackgroundManagement.php"); ++ require("/usr/share/nagvis/includes/classes/class.GlobalForm.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiBackgroundManagement.php"); + $FRONTEND = new WuiBackgroundManagement($MAINCFG); + $FRONTEND->getForm(); + break; + case 'map_management': +- require("../nagvis/includes/classes/class.GlobalForm.php"); +- require("./includes/classes/class.WuiMapManagement.php"); ++ require("/usr/share/nagvis/includes/classes/class.GlobalForm.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiMapManagement.php"); + $FRONTEND = new WuiMapManagement($MAINCFG); + $FRONTEND->getForm(); + break; + case 'backend_management': +- require("../nagvis/includes/classes/class.GlobalForm.php"); +- require("./includes/classes/class.WuiBackendManagement.php"); ++ require("/usr/share/nagvis/includes/classes/class.GlobalForm.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiBackendManagement.php"); + $FRONTEND = new WuiBackendManagement($MAINCFG); + $FRONTEND->getForm(); + break; + case 'addmodify': +- require("../nagvis/includes/classes/class.GlobalForm.php"); +- require("./includes/classes/class.WuiAddModify.php"); ++ require("/usr/share/nagvis/includes/classes/class.GlobalForm.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiAddModify.php"); + + $MAPCFG = new WuiMapCfg($MAINCFG,$_GET['map']); + $MAPCFG->readMapConfig(); +@@ -85,8 +85,8 @@ + $FRONTEND->getForm(); + break; + default: +- require("./includes/classes/class.WuiFrontend.php"); +- require("./includes/classes/class.WuiMap.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiFrontend.php"); ++ require("/usr/share/nagvis/wui/includes/classes/class.WuiMap.php"); + + if(!isset($_GET['map'])) { + $_GET['map'] = ''; +@@ -118,4 +118,4 @@ + + // print the HTML page + $FRONTEND->printPage(); +-?> +\ No newline at end of file ++?> +diff -urNad nagvis-1.1rc2~/wui/wui.function.inc.php nagvis-1.1rc2/wui/wui.function.inc.php +--- nagvis-1.1rc2~/wui/wui.function.inc.php 2007-07-12 16:37:20.000000000 +0200 ++++ nagvis-1.1rc2/wui/wui.function.inc.php 2007-07-13 23:29:59.000000000 +0200 +@@ -9,15 +9,15 @@ + # http://www.walterzorn.com # + ################################################################################# + +-require('../nagvis/includes/classes/class.GlobalDebug.php'); +-require('../nagvis/includes/classes/class.GlobalLanguage.php'); +-require('../nagvis/includes/classes/class.GlobalMainCfg.php'); +-require('../nagvis/includes/classes/class.GlobalPage.php'); +-require('../nagvis/includes/classes/class.GlobalMapCfg.php'); +-require('./includes/classes/class.WuiMainCfg.php'); +-require('./includes/classes/class.WuiMapCfg.php'); ++require('/usr/share/nagvis/includes/classes/class.GlobalDebug.php'); ++require('/usr/share/nagvis/includes/classes/class.GlobalLanguage.php'); ++require('/usr/share/nagvis/includes/classes/class.GlobalMainCfg.php'); ++require('/usr/share/nagvis/includes/classes/class.GlobalPage.php'); ++require('/usr/share/nagvis/includes/classes/class.GlobalMapCfg.php'); ++require('/usr/share/nagvis/wui/includes/classes/class.WuiMainCfg.php'); ++require('/usr/share/nagvis/wui/includes/classes/class.WuiMapCfg.php'); + +-$MAINCFG = new WuiMainCfg('../nagvis/etc/config.ini.php'); ++$MAINCFG = new WuiMainCfg('/etc/nagvis/config.ini.php'); + + ############################################ + function getArrayFromProperties($properties) { +@@ -542,4 +542,4 @@ + print "\n"; + break; + } +-?> +\ No newline at end of file ++?> diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..85a0af2 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,80 @@ +#!/bin/sh +# postinst script for nagvis +# +# see: dh_installdeb(1) + +set -e + +. /usr/share/debconf/confmodule +if [ -f /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql ]; then + . /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql + dbc_generate_include='template:/etc/nagvis/config.ini.php' + dbc_generate_include_owner='www-data:www-data' + dbc_generate_include_args='--ucf -o template_infile=/usr/share/nagvis/debian/config.ini.php.dist' + dbc_go nagvis $@ +fi +db_stop + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +setperm() { # thx 2 nagios2/debian/nagios2-common.postinst + local user="$1" + local group="$2" + local mode="$3" + local file="$4" + shift 4 + # only do something when no setting exists + if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then + chown "$user":"$group" "$file" + chmod "$mode" "$file" + fi +} + +case "$1" in + configure) + for f in `find /usr/share/nagvis/htdocs -type f -o -type d 2>/dev/null`; do + test -f $f && setperm www-data www-data 0644 $f + test -d $f && setperm www-data www-data 0755 $f + done + setperm www-data www-data 0775 /usr/share/nagvis/htdocs/nagvis/images/maps + setperm www-data www-data 0775 /usr/share/nagvis/htdocs/nagvis/etc/maps + + #if [ -f /etc/dbconfig-common/ndoutils-mysql.conf ]; then + # dbconfig-load-include -f sh /etc/dbconfig-common/ndoutils-mysql.conf + # dbconfig-generate-include -f template \ + # --options 'template_infile=/usr/share/nagvis/debian/config.ini.php.dist' \ + # --dbname --dbpass --dbserver --dbport --dbuser \ + # --owner www-data:www-data --mode 0600 --ucf \ + # /usr/share/nagvis/debian/config.ini.php.dist /etc/nagvis/config.ini.php + #else if [ ! -f /etc/nagvis/config.ini.php ]; then + # ucf /usr/share/nagvis/debian/config.ini.php.dist /etc/nagvis/config.ini.php + #fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..1096688 --- /dev/null +++ b/debian/rules @@ -0,0 +1,118 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/dpatch/dpatch.make +DEST = debian/tmp + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp + +build: build-stamp patch-stamp +build-stamp: configure-stamp + dh_testdir + #$(MAKE) + #docbook-to-man debian/nagvis.sgml > nagvis.1 + touch $@ + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + # Add here commands to clean up after the build process. + #-$(MAKE) clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + + mkdir -p $(DEST)/{etc,usr/share/nagvis/{debian/,htdocs/{nagvis/,wui/},{,wui/}includes}} + + cp -a nagvis/etc $(DEST)/etc/nagvis + mv $(DEST)/etc/nagvis/config.ini.php.dist \ + $(DEST)/usr/share/nagvis/debian/ + sed -e 's/^[; ]*\(\ $(DEST)/usr/share/nagvis/debian/config.ini.php.dist.new && \ + mv $(DEST)/usr/share/nagvis/debian/config.ini.php.dist.new \ + $(DEST)/usr/share/nagvis/debian/config.ini.php.dist + + cp -a nagvis/images $(DEST)/usr/share/nagvis/htdocs/nagvis/ + cp -a nagvis/includes/classes $(DEST)/usr/share/nagvis/includes/ + cp -a nagvis/includes/{css,js,languages} $(DEST)/usr/share/nagvis/htdocs/nagvis/ + cp -a nagvis/*.php $(DEST)/usr/share/nagvis/htdocs/nagvis/ + + cp -a wui/images $(DEST)/usr/share/nagvis/htdocs/wui/ + cp -a wui/includes/classes $(DEST)/usr/share/nagvis/wui/includes/ + cp -a wui/includes/{css,js} $(DEST)/usr/share/nagvis/htdocs/wui/ + cp -a wui/*.php $(DEST)/usr/share/nagvis/htdocs/wui/ + cp -a *.php $(DEST)/usr/share/nagvis/htdocs/ + + # demo site + mkdir -p $(DEST)/demo/{nagvis/images/,etc/nagvis/}maps + mv $(DEST)/etc/nagvis/maps/demo*.cfg $(DEST)/demo/etc/nagvis/maps/ + mv $(DEST)/usr/share/nagvis/htdocs/nagvis/images/maps/nagvis-demo.png \ + $(DEST)/demo/nagvis/images/maps/ + + dh_installdirs + dh_install + dh_link + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_installmenu + dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo +# dh_installman +# dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..6fb89cc --- /dev/null +++ b/debian/watch @@ -0,0 +1,22 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# See uscan(1) for format + +# Compulsory line, this is a version 3 file +version=3 + +# Uncomment to examine a Webpage +# +#http://www.example.com/downloads.php nagvis-(.*)\.tar\.gz + +# Uncomment to examine a Webserver directory +#http://www.example.com/pub/nagvis-(.*)\.tar\.gz + +# Uncommment to examine a FTP server +#ftp://ftp.example.com/pub/nagvis-(.*)\.tar\.gz debian uupdate + +# Uncomment to find new files on sourceforge, for debscripts >= 2.9 +http://sf.net/nagvis/nagvis-([\w\.]*)\.tar\.gz + + -- 2.30.2