diff options
author | rea <rea@FreeBSD.org> | 2010-12-31 01:25:47 +0800 |
---|---|---|
committer | rea <rea@FreeBSD.org> | 2010-12-31 01:25:47 +0800 |
commit | 3dce35edbd0d8c5688e2b40192a6a759d9ba55be (patch) | |
tree | 850ec817c7e1e5e77ec99afe412f1a6364ea6b81 /net-mgmt | |
parent | 4bf9b14c7b31a4f8e01336bbc7156e0fe74bfe19 (diff) | |
download | freebsd-ports-graphics-3dce35edbd0d8c5688e2b40192a6a759d9ba55be.tar.gz freebsd-ports-graphics-3dce35edbd0d8c5688e2b40192a6a759d9ba55be.tar.zst freebsd-ports-graphics-3dce35edbd0d8c5688e2b40192a6a759d9ba55be.zip |
net-mgmt/pnp: fix issues brought by PNP developers
* php5-sockets is needed and php5-filter -- not needed;
* local modifications to config.php should go into config_local.php
and config.php must be replaced at every installation.
Feature safe: yes
Approved by: garga (mentor)
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/pnp/Makefile | 3 | ||||
-rw-r--r-- | net-mgmt/pnp/files/extra-patch-disable-pdf | 24 | ||||
-rw-r--r-- | net-mgmt/pnp/files/patch-0010-dont-overwrite-configs | 35 | ||||
-rw-r--r-- | net-mgmt/pnp/files/patch-0020-directory-creation | 34 | ||||
-rw-r--r-- | net-mgmt/pnp/files/patch-0030-nuke-libraries-directory | 4 | ||||
-rw-r--r-- | net-mgmt/pnp/files/pkg-install.in | 33 | ||||
-rw-r--r-- | net-mgmt/pnp/pkg-plist | 2 |
7 files changed, 75 insertions, 60 deletions
diff --git a/net-mgmt/pnp/Makefile b/net-mgmt/pnp/Makefile index 630278ab0a1..62da7f3073c 100644 --- a/net-mgmt/pnp/Makefile +++ b/net-mgmt/pnp/Makefile @@ -7,6 +7,7 @@ PORTNAME= pnp PORTVERSION= 0.6.10 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= SF MASTER_SITE_SUBDIR=pnp4nagios/PNP-0.6 @@ -28,7 +29,7 @@ OPTIONS= PDF "Use built-in fpdf library to produce PDF views" ON LICENSE= GPLv2 PATCH_STRIP= -p1 USE_PERL5= yes -USE_PHP= filter gd iconv json pcre simplexml xml zlib +USE_PHP= gd iconv json pcre simplexml sockets xml zlib WANT_PHP_WEB= yes USE_RC_SUBR= npcd.sh diff --git a/net-mgmt/pnp/files/extra-patch-disable-pdf b/net-mgmt/pnp/files/extra-patch-disable-pdf index 9c4fc3cb4b2..9a35d8c00c6 100644 --- a/net-mgmt/pnp/files/extra-patch-disable-pdf +++ b/net-mgmt/pnp/files/extra-patch-disable-pdf @@ -1,7 +1,7 @@ -From 9c588aefedcdcd15a4bc61bf6a33c10818107390 Mon Sep 17 00:00:00 2001 +From 689736f288253fdbaff816910317f5c532a583fe Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> Date: Thu, 18 Nov 2010 15:47:59 +0300 -Subject: [PATCH 3/3] Disable PDF generation +Subject: [PATCH 3/4] Disable PDF generation This patch allows to completely disable generation of PDF files via any means. It used to support WITHOUT_PDF knob of FreeBSD port. @@ -14,10 +14,10 @@ Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/share/pnp/application/controllers/pdf.php b/share/pnp/application/controllers/pdf.php -index 36ef2a7..aa48d1f 100644 +index 330e341..6ff172c 100644 --- a/share/pnp/application/controllers/pdf.php +++ b/share/pnp/application/controllers/pdf.php -@@ -13,6 +13,7 @@ class Pdf_Controller extends System_Controller { +@@ -10,6 +10,7 @@ class Pdf_Controller extends System_Controller { public function __construct(){ parent::__construct(); @@ -25,15 +25,15 @@ index 36ef2a7..aa48d1f 100644 $this->use_bg = 0; $this->bg = $this->config->conf['background_pdf']; -@@ -33,6 +34,7 @@ class Pdf_Controller extends System_Controller { +@@ -30,6 +31,7 @@ class Pdf_Controller extends System_Controller { } public function index(){ + exit; - $this->host = $this->input->get('host'); - $this->service = $this->input->get('srv'); -@@ -144,6 +146,7 @@ class Pdf_Controller extends System_Controller { + $this->tpl = $this->input->get('tpl'); + $this->view = ""; +@@ -137,6 +139,7 @@ class Pdf_Controller extends System_Controller { } public function page($page){ @@ -41,7 +41,7 @@ index 36ef2a7..aa48d1f 100644 $this->start = $this->input->get('start'); $this->end = $this->input->get('end'); $this->view = ""; -@@ -206,6 +209,7 @@ class Pdf_Controller extends System_Controller { +@@ -199,6 +202,7 @@ class Pdf_Controller extends System_Controller { } public function basket(){ @@ -50,10 +50,10 @@ index 36ef2a7..aa48d1f 100644 $this->end = $this->input->get('end'); $this->view = ""; diff --git a/share/pnp/application/models/rrdtool.php b/share/pnp/application/models/rrdtool.php -index 2c18b4e..2a24996 100644 +index 308ab77..344478c 100644 --- a/share/pnp/application/models/rrdtool.php +++ b/share/pnp/application/models/rrdtool.php -@@ -79,6 +79,7 @@ class Rrdtool_Model extends Model +@@ -79,6 +79,7 @@ class Rrdtool_Model extends System_Model $width = 0; $height = 0; if ($out == 'PDF'){ @@ -82,5 +82,5 @@ index 7ce5301..838b474 100644 $qsa = pnp::addToUri(array(), False); echo "<a title=\"".Kohana::lang('common.title-xml-link')."\" href=\"".url::base(TRUE)."xml".$qsa."\"><img class=\"icon\" src=\"".url::base()."media/images/xml.png\"></a>\n"; -- -1.7.2.1 +1.7.3.2 diff --git a/net-mgmt/pnp/files/patch-0010-dont-overwrite-configs b/net-mgmt/pnp/files/patch-0010-dont-overwrite-configs index f48cd2bd166..8925b1929e7 100644 --- a/net-mgmt/pnp/files/patch-0010-dont-overwrite-configs +++ b/net-mgmt/pnp/files/patch-0010-dont-overwrite-configs @@ -1,45 +1,28 @@ -From cccbb033458f205ac74e11babe5021bc7a3ade3c Mon Sep 17 00:00:00 2001 +From 8276a8353ecafdf7041919f859940e2b6fc89c43 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> Date: Wed, 17 Nov 2010 19:47:16 +0300 -Subject: [PATCH 1/3] Do not overwrite configuration files +Subject: [PATCH 1/4] Do not overwrite PDF background -Install all configuration files as *-sample. +Install background.pdf as background.pdf-sample. Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> --- - sample-config/Makefile.in | 8 +++----- - 1 files changed, 3 insertions(+), 5 deletions(-) + sample-config/Makefile.in | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sample-config/Makefile.in b/sample-config/Makefile.in -index 883345c..1eac2c1 100644 +index 883345c..62d0cf6 100644 --- a/sample-config/Makefile.in +++ b/sample-config/Makefile.in -@@ -31,14 +31,12 @@ distclean: clean - devclean: distclean - - install: -- -rm -f $(DESTDIR)$(HTMLDIR)/conf/config.php -- - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands +@@ -38,7 +38,7 @@ install: $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/pnp4nagios_release $(DESTDIR)$(SYSCONFDIR) -- $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR) + $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/background.pdf $(DESTDIR)$(SYSCONFDIR) -+ $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR)/config.php-sample + $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/background.pdf $(DESTDIR)$(SYSCONFDIR)/background.pdf-sample install-config: -@@ -46,7 +44,7 @@ install-config: - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages - -- $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR) -+ $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR)/config.php-sample - $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/process_perfdata.cfg-sample $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/rra.cfg-sample $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 644 $(INSTALL_OPTS) misccommands.cfg-sample $(DESTDIR)$(SYSCONFDIR) -- -1.7.2.1 +1.7.3.2 diff --git a/net-mgmt/pnp/files/patch-0020-directory-creation b/net-mgmt/pnp/files/patch-0020-directory-creation index 46c941015bd..cdb161e3891 100644 --- a/net-mgmt/pnp/files/patch-0020-directory-creation +++ b/net-mgmt/pnp/files/patch-0020-directory-creation @@ -1,7 +1,7 @@ -From 0f6181db74e4a2f53837c5e9b5639cdfb63ee2e1 Mon Sep 17 00:00:00 2001 +From 1aa1833afb0c9b4e65d44d0cd595536f23433b4b Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> Date: Thu, 18 Nov 2010 15:22:03 +0300 -Subject: [PATCH 2/3] Rework directory creation during install phase +Subject: [PATCH 2/4] Rework directory creation during install phase Don't create existing system and log-like directories to avoid changing their permissions. @@ -9,11 +9,11 @@ changing their permissions. Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> --- lib/Makefile.in | 2 +- - sample-config/Makefile.in | 14 +++++++------- + sample-config/Makefile.in | 12 ++++++------ scripts/Makefile.in | 8 ++++---- share/Makefile.in | 2 +- src/Makefile.in | 10 +++++----- - 5 files changed, 18 insertions(+), 18 deletions(-) + 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index b103bc8..0e0f8d8 100644 @@ -29,13 +29,13 @@ index b103bc8..0e0f8d8 100644 $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/controllers diff --git a/sample-config/Makefile.in b/sample-config/Makefile.in -index 1eac2c1..a841fbb 100644 +index 62d0cf6..1bf667d 100644 --- a/sample-config/Makefile.in +++ b/sample-config/Makefile.in -@@ -31,19 +31,19 @@ distclean: clean - devclean: distclean - +@@ -33,18 +33,18 @@ devclean: distclean install: + -rm -f $(DESTDIR)$(HTMLDIR)/conf/config.php + - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages @@ -43,22 +43,20 @@ index 1eac2c1..a841fbb 100644 + [ -d "$(DESTDIR)$(SYSCONFDIR)"/check_commands ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands + [ -d "$(DESTDIR)$(SYSCONFDIR)"/pages ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/pnp4nagios_release $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR)/config.php-sample + $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR) $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/background.pdf $(DESTDIR)$(SYSCONFDIR)/background.pdf-sample install-config: ++ [ -d "$(DESTDIR)$(SYSCONFDIR)" ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR) ++ [ -d "$(DESTDIR)$(SYSCONFDIR)"/check_commands ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands ++ [ -d "$(DESTDIR)$(SYSCONFDIR)"/pages ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands - $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages -- -+ [ -d "$(DESTDIR)$(SYSCONFDIR)" ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR) -+ [ -d "$(DESTDIR)$(SYSCONFDIR)"/check_commands ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/check_commands -+ [ -d "$(DESTDIR)$(SYSCONFDIR)"/pages ] || $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(SYSCONFDIR)/pages -+ - $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR)/config.php-sample + + $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/config.php $(DESTDIR)$(SYSCONFDIR) $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/process_perfdata.cfg-sample $(DESTDIR)$(SYSCONFDIR) - $(INSTALL) -m 644 $(INSTALL_OPTS) pnp/rra.cfg-sample $(DESTDIR)$(SYSCONFDIR) diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 44f0506..8addf27 100644 --- a/scripts/Makefile.in @@ -86,7 +84,7 @@ index 44f0506..8addf27 100644 $(MAKE) install-plugins $(MAKE) install-verifyconfig diff --git a/share/Makefile.in b/share/Makefile.in -index 2c4c55d..fd6713d 100644 +index 4b163bc..709ade7 100644 --- a/share/Makefile.in +++ b/share/Makefile.in @@ -22,7 +22,7 @@ distclean: clean @@ -120,5 +118,5 @@ index b4323b4..9439f25 100644 $(INSTALL) -m 754 $(INSTALL_OPTS) npcdmod.o $(DESTDIR)$(LIBDIR) -- -1.7.2.1 +1.7.3.2 diff --git a/net-mgmt/pnp/files/patch-0030-nuke-libraries-directory b/net-mgmt/pnp/files/patch-0030-nuke-libraries-directory index 4697140cc23..25c3b85d6eb 100644 --- a/net-mgmt/pnp/files/patch-0030-nuke-libraries-directory +++ b/net-mgmt/pnp/files/patch-0030-nuke-libraries-directory @@ -1,7 +1,7 @@ -From ef870c19bfafbac8139c676bde7cafb2420ebdba Mon Sep 17 00:00:00 2001 +From a3bc33c9134d25f8bdcc5fa696606bafbaac8c2c Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> Date: Tue, 28 Dec 2010 18:32:10 +0300 -Subject: [PATCH] PNP: remove creation of an empty directory +Subject: [PATCH 4/4] PNP: remove creation of an empty directory $SHARE/application/libraries contains nothing after the installtion, so it looks like a remains of some old directory layout. diff --git a/net-mgmt/pnp/files/pkg-install.in b/net-mgmt/pnp/files/pkg-install.in index 5b8343de971..5e1def932e8 100644 --- a/net-mgmt/pnp/files/pkg-install.in +++ b/net-mgmt/pnp/files/pkg-install.in @@ -34,7 +34,40 @@ check_sanity () { fi } +# I messed the proper way to create the configuration for PNP: +# config_local.php should be used for overrides and config.php +# will come modified at each upgrade. +# +# I was installing config.php as config.php-sample and hoping +# that people will use it as the base for original config.php. +# +# So, if we now have config.php at the installtion phase, then +# it means that config.php may be customized. We save it as +# config.php.orig and informing the user about it. +fixup_config_local () { + if [ -e "%%ETCDIR%%"/config.php ]; then + cp "%%ETCDIR%%"/config.php "%%ETCDIR%%"/config.php.orig + cat << "EOF" +====================================================================== +WARNING: + +You have config.php for PNP; this means that you are probably +upgrading from an old port version, where config.php-sample was +installed instead of config.php and it was meant that you will +cope with config.php yourself. + +PNP's way to do the things is to let config.php be overwritten at each +upgrade and local overrides to it should go to config_local.php. + +Your existing config.php was saved as config.php.orig, please, review +your modifications and put them to config_local.php. +====================================================================== +EOF + fi +} + if [ "x$2" = "xPRE-INSTALL" ]; then check_sanity dirs + fixup_config_local fi diff --git a/net-mgmt/pnp/pkg-plist b/net-mgmt/pnp/pkg-plist index 42735f3abc7..b12fdcba053 100644 --- a/net-mgmt/pnp/pkg-plist +++ b/net-mgmt/pnp/pkg-plist @@ -2,7 +2,7 @@ %%ETCDIR%%/check_commands/check_all_local_disks.cfg-sample %%ETCDIR%%/check_commands/check_nrpe.cfg-sample %%ETCDIR%%/check_commands/check_nwstat.cfg-sample -%%ETCDIR%%/config.php-sample +%%ETCDIR%%/config.php %%ETCDIR%%/misccommands.cfg-sample %%ETCDIR%%/nagios.cfg-sample %%ETCDIR%%/npcd.cfg-sample |