aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEygene Ryabinkin <rea@FreeBSD.org>2010-12-30 17:25:47 +0000
committerEygene Ryabinkin <rea@FreeBSD.org>2010-12-30 17:25:47 +0000
commit58d37320f9043c54aaba7ff4fac86bba71a271ab (patch)
tree7cf28dae90bed7efb29281edd27d96840cf0082f
parent0d10f6f0a75b5dc955464704b976502d6b360b58 (diff)
downloadports-58d37320f9043c54aaba7ff4fac86bba71a271ab.tar.gz
ports-58d37320f9043c54aaba7ff4fac86bba71a271ab.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)
Notes
Notes: svn path=/head/; revision=267168
-rw-r--r--UPDATING11
-rw-r--r--net-mgmt/pnp/Makefile3
-rw-r--r--net-mgmt/pnp/files/extra-patch-disable-pdf24
-rw-r--r--net-mgmt/pnp/files/patch-0010-dont-overwrite-configs35
-rw-r--r--net-mgmt/pnp/files/patch-0020-directory-creation34
-rw-r--r--net-mgmt/pnp/files/patch-0030-nuke-libraries-directory4
-rw-r--r--net-mgmt/pnp/files/pkg-install.in33
-rw-r--r--net-mgmt/pnp/pkg-plist2
8 files changed, 86 insertions, 60 deletions
diff --git a/UPDATING b/UPDATING
index 49752cb8a3b7..44ef8a7d3c3f 100644
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,17 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
+20101230:
+ AFFECTS: users of net-mgmt/pnp
+ AUTHOR: rea@FreeBSD.org
+
+ Starting from 0.6.10_1 config.php is no longer preserved across
+ upgrades; PNP way is to put all modifications into config_local.php.
+
+ Existing config.php will be saved as config.php.orig and you should
+ review your deviations from defaults and place them into
+ config_local.php.
+
20101227:
AFFECTS: users of databases/mysql55-server
AUTHOR: ale@FreeBSD.org
diff --git a/net-mgmt/pnp/Makefile b/net-mgmt/pnp/Makefile
index 630278ab0a10..62da7f3073c7 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 9c4fc3cb4b2a..9a35d8c00c6e 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 f48cd2bd1666..8925b1929e77 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 46c941015bd0..cdb161e3891b 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 4697140cc23a..25c3b85d6eb0 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 5b8343de9719..5e1def932e80 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 42735f3abc7d..b12fdcba0536 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