--- pbnj-2.04.orig/debian/changelog +++ pbnj-2.04/debian/changelog @@ -0,0 +1,41 @@ +pbnj (2.04-4.1) unstable; urgency=medium + + * Non-maintainer upload. + * Fix "FTBFS with perl 5.22 in experimental (MakeMaker changes)": + use DESTDIR in debian/rules. + (Closes: #795637) + + -- gregor herrmann Wed, 26 Aug 2015 18:37:26 +0200 + +pbnj (2.04-4) unstable; urgency=low + + * Fix bug which caused MySQL to not work when inserting a machine + after the table was created. (Closes: #416337) + + -- Joshua D. Abraham Thu, 05 Apr 2007 22:53:19 -0400 + +pbnj (2.04-3) unstable; urgency=low + + * Fixed warning when trying to disconnect from SQLite. + * Add Recommends: sqlite3, and Suggests: libdbd-mysql-perl | libdbd-pg-perl + + -- Joshua D. Abraham Sun, 18 Mar 2007 16:22:00 -0400 + +pbnj (2.04-2) unstable; urgency=low + + * Add missing dependency on libyaml-perl + + -- Joshua D. Abraham Sun, 14 Mar 2007 16:08:00 -0400 + +pbnj (2.04-1) unstable; urgency=low + + * Upstream update + + -- Joshua D. Abraham Sun, 19 Nov 2006 23:30:41 -0400 + +pbnj (2.02-1) unstable; urgency=low + + * Initial release (Closes: #379880) + + -- Joshua D. Abraham Thu, 20 Jul 2006 22:51:41 -0400 + --- pbnj-2.04.orig/debian/compat +++ pbnj-2.04/debian/compat @@ -0,0 +1 @@ +5 --- pbnj-2.04.orig/debian/control +++ pbnj-2.04/debian/control @@ -0,0 +1,25 @@ +Source: pbnj +Section: net +Priority: optional +Maintainer: Joshua D. Abraham +Build-Depends: debhelper (>= 5) +Build-Depends-Indep: perl (>= 5.8.0-7), libxml-twig-perl (>= 3.22), + libnmap-parser-perl (>= 1.01), libdbd-sqlite3-perl (>= 1.11), + libfile-which-perl (>= 0.05), libtext-csv-perl (>= 0.23), + libfile-homedir-perl (>= 0.06), libyaml-perl (>= 0.39) +Standards-Version: 3.7.2 + +Package: pbnj +Architecture: all +Depends: ${perl:Depends}, nmap, libxml-twig-perl (>= 3.22), + libnmap-parser-perl (>= 1.01), libdbd-sqlite3-perl (>= 1.11), + libfile-which-perl (>= 0.05), libtext-csv-perl (>= 0.23), + libfile-homedir-perl (>= 0.06), libyaml-perl (>= 0.39) +Recommends: sqlite3 +Suggests: libdbd-mysql-perl | libdbd-pg-perl +Description: a suite of tools to monitor changes on a network + PBNJ is a network suite to monitor changes that occur on a network + over time. It does this by checking for changes on the target + machine(s), which includes the details about the services running on + them as well as the service state. PBNJ parses the data from a scan + and stores it in a database. PBNJ uses Nmap to perform scans. --- pbnj-2.04.orig/debian/copyright +++ pbnj-2.04/debian/copyright @@ -0,0 +1,23 @@ +This package was debianized by Joshua D. Abraham on August 12, 2006. + +It was downloaded from: http://pbnj.sourceforge.net + +Upstream Authors: Joshua D. Abraham + +Copyright: 2005 - 2006 Joshua D. Abraham + +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; + +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., 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. --- pbnj-2.04.orig/debian/rules +++ pbnj-2.04/debian/rules @@ -0,0 +1,60 @@ +#!/usr/bin/make -f +# This debian/rules file is provided as a template for normal perl +# packages. It was created by Marc Brockschmidt for +# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may +# be used freely wherever it is useful. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-stamp +build-stamp: + dh_testdir + + # Add commands to compile the package here + perl Makefile.PL INSTALLDIRS=vendor + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + + # Add commands to clean up after the build process here + if [ -e Makefile ]; then \ + $(MAKE) distclean;\ + rm -f Makefile;\ + fi + dh_clean build-stamp install-stamp + +install: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add commands to install the package into debian/$PACKAGE_NAME here + $(MAKE) install DESTDIR=$(CURDIR)/debian/pbnj + + +binary-arch: build install +# We have nothing to do by default. + +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs README NOTES-ON-NMAP-VERSION EXAMPLES BUGS + dh_installexamples databases/csv.yaml databases/mysql.yaml databases/pg.yaml databases/sqlite3.yaml + dh_installman + dh_installchangelogs ChangeLog + dh_compress + dh_fixperms + dh_installdeb + dh_perl + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- pbnj-2.04.orig/outputpbnj +++ pbnj-2.04/outputpbnj @@ -949,7 +949,9 @@ print "output not defined\n"; } -$dbh->disconnect; +if ( $db ne 'SQLite' ) { + $dbh->disconnect; +} __DATA__ # Config.yaml --- pbnj-2.04.orig/scanpbnj +++ pbnj-2.04/scanpbnj @@ -328,41 +328,26 @@ my $os = $href->{os}; my $created = $href->{created}; my $machine_created = $href->{machine_created}; - - if ( $db eq "CSV" ) { - my $sth = $dbh->selectrow_hashref("select max('mid') from machines"); - my $mid = $sth->{mid}; - if ( !defined($mid) ) { - $mid = 1; - } - else { - $mid++; - } - my $insert = $dbh->prepare( - 'INSERT INTO machines VALUES (?,?,?,?,?,?,?,?,?)'); - - my $success = 1; - $success &&= $insert->execute( $mid, $ip, $host, $localh, $os, - $machine_created, $created ); - - return $mid; + + my $sth = $dbh->selectrow_hashref("select max(mid) from machines"); + + my $mid; + if ($db eq 'Pg') { + $mid = $sth->{'max'} ; } else { - $dbh->do( - "INSERT INTO machines (ip, host, localh, os, - machine_created, created_on) VALUES ( - '$ip', '$host', '$localh', '$os', - '$machine_created', '$created' ) " - ); + $mid = $sth->{'max(mid)'}; } - my $sth = $dbh->selectrow_hashref( - "SELECT mid from machines - WHERE ip='$ip' AND host='$host' - AND localh='$localh' AND os='$os' AND - machine_created='$machine_created' AND created_on='$created'" - ); - - return $sth->{'mid'}; + # new mid needs to be 1 more than the max + $mid++; + + my $insert = $dbh->prepare( + 'INSERT INTO machines VALUES (?,?,?,?,?,?,?)'); + my $success = 1; + $success &&= $insert->execute( $mid, $ip, $host, $localh, $os, + $machine_created, $created ); + + return $mid; } ##############################################################################