diff options
author | bouyer <bouyer@pkgsrc.org> | 2009-08-16 18:25:53 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2009-08-16 18:25:53 +0000 |
commit | d5700bc2c1bb13ef446004c0a291545e58ed80e8 (patch) | |
tree | 34f9ae646bc97e463c657387ce61682cee2c4dbf /net | |
parent | 700edae2fe122b11668358a9b075d2aaf7597f2a (diff) | |
download | pkgsrc-d5700bc2c1bb13ef446004c0a291545e58ed80e8.tar.gz |
Import ocsinventory-agent 1.1.2 to pkgsrc.
Open Computer and Software Inventory Next Generation is an application
designed to help a network or system administrator keep track of the
computers configuration and software that are installed on the network.
Information about Hardware and Operating System are collected.
Diffstat (limited to 'net')
21 files changed, 509 insertions, 0 deletions
diff --git a/net/ocsinventory-agent/DESCR b/net/ocsinventory-agent/DESCR new file mode 100644 index 00000000000..646c6d741a8 --- /dev/null +++ b/net/ocsinventory-agent/DESCR @@ -0,0 +1,3 @@ +pen Computer and Software Inventory Next Generation is an application designed +to help a network or system administrator keep track of the computers +configuration and software that are installed on the network diff --git a/net/ocsinventory-agent/Makefile b/net/ocsinventory-agent/Makefile new file mode 100644 index 00000000000..692a87e06d3 --- /dev/null +++ b/net/ocsinventory-agent/Makefile @@ -0,0 +1,76 @@ +# $NetBSD: Makefile,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ +# + +DISTNAME= OCSNG_UNIX_AGENT-1.02 +PKGNAME= ocsinventory-agent-1.0.2 +CATEGORIES= net +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ocsinventory/} + +MAINTAINER= bouyer@NetBSD.org +HOMEPAGE= http://www.ocsinventory-ng.org/ +COMMENT= Keep track of the computers configuration and software + +PKG_SYSCONFSUBDIR= ocsinventory + +DEPENDS+= p5-libwww-[0-9]*:../../www/p5-libwww +DEPENDS+= p5-XML-Simple-[0-9]*:../../textproc/p5-XML-Simple +DEPENDS+= p5-Net-IP-[0-9]*:../../net/p5-Net-IP +DEPENDS+= p5-Proc-Daemon-[0-9]*:../../devel/p5-Proc-Daemon +.if (${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64") +DEPENDS+= dmidecode-[0-9]*:../../sysutils/dmidecode +.endif + +WRKSRC= ${WRKDIR}/Ocsinventory-Agent-1.0.1 + +BUILD_DEFS+= VARBASE +AUTO_MKDIRS=yes + +PKG_DESTDIR_SUPPORT= user-destdir + +.include "../../mk/bsd.prefs.mk" + +EGDIR= ${PREFIX}/share/examples/ocsinventory-agent +MAKE_DIRS_PERMS+= ${VARBASE}/db/ocsinventory ${ROOT_USER} ${ROOT_GROUP} 0700 +CONF_FILES+= ${EGDIR}/ocsinventory-agent.cfg ${PKG_SYSCONFDIR}/ocsinventory-agent.cfg +CONF_FILES+= ${EGDIR}/modules.conf ${PKG_SYSCONFDIR}/modules.conf + +USE_TOOLS+= perl:run +REPLACE_PERL+= tools/macosx/ocsng_app-xcode/main.pl +REPLACE_PERL+= tools/macosx/scripts/create-darwin-perl-lib_fromCPAN.pl +REPLACE_PERL+= ocsinventory-agent +REPLACE_PERL+= postinst.pl + +SUBST_CLASSES+= sysconfdir path varbase apachevers +SUBST_STAGE.sysconfdir= post-patch +SUBST_FILES.sysconfdir= lib/Ocsinventory/Agent/Config.pm +SUBST_FILES.sysconfdir+= postinst.pl +SUBST_SED.sysconfdir= -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g' +SUBST_MESSAGE.sysconfdir= Fixing hardcoded install directory path. + +SUBST_STAGE.path= post-patch +SUBST_FILES.path= lib/Ocsinventory/Agent/Common.pm +SUBST_SED.path= -e "s|/usr/local/bin|${PREFIX}/bin|g" +SUBST_SED.path= -e "s|/usr/local/sbin|${PREFIX}/sbin|g" +SUBST_MESSAGE.path= Fixing hardcoded path. + +PERL5_PACKLIST= auto/Ocsinventory/Agent/.packlist + +pre-patch: + ${MKDIR} ${WRKSRC}/lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl + +post-build: + for file in ocsinventory-agent.cfg modules.conf; do \ + ${SED} -e 's,@VARBASE@,${VARBASE},g' \ + < ${FILESDIR}/$$file > ${WRKDIR}/$$file; \ + done + +post-install: + ${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR} + for file in ocsinventory-agent.cfg modules.conf; do \ + ${INSTALL_DATA} ${WRKDIR}/$$file ${DESTDIR}${EGDIR}; \ + done + cd ${DESTDIR}${PREFIX}/bin && \ + ${LN} -f -s ${PERL5_INSTALLVENDORBIN}/ocsinventory-agent . + +.include "../../lang/perl5/module.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/net/ocsinventory-agent/PLIST b/net/ocsinventory-agent/PLIST new file mode 100644 index 00000000000..f13a185cb88 --- /dev/null +++ b/net/ocsinventory-agent/PLIST @@ -0,0 +1,4 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ +bin/ocsinventory-agent +share/examples/ocsinventory-agent/ocsinventory-agent.cfg +share/examples/ocsinventory-agent/modules.conf diff --git a/net/ocsinventory-agent/distinfo b/net/ocsinventory-agent/distinfo new file mode 100644 index 00000000000..d93ad4a73ab --- /dev/null +++ b/net/ocsinventory-agent/distinfo @@ -0,0 +1,20 @@ +$NetBSD: distinfo,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +SHA1 (OCSNG_UNIX_AGENT-1.02.tar.gz) = 92660745140d1526568a3c02b0b4d8c7286f5e3f +RMD160 (OCSNG_UNIX_AGENT-1.02.tar.gz) = db3ee9df9d94114b7b6ce5dcd2f0e862729d6056 +Size (OCSNG_UNIX_AGENT-1.02.tar.gz) = 1392033 bytes +SHA1 (patch-aa) = 5022b8b1f5e98c43f7da562412bd752956320f05 +SHA1 (patch-ab) = 04e70296c005a710f1b2470451c9872c7716ea26 +SHA1 (patch-ac) = 9be5237057924628cc4d24d7620270aa9a8fd459 +SHA1 (patch-ad) = 5160c3ac8ae48eee578be50350c7c4ccfe74b045 +SHA1 (patch-ae) = b801ad35b3bf13323e27fe6ebf638e295aa7771d +SHA1 (patch-af) = 8d156a6266ca6c2a7f0d8831585c9ce4e0944394 +SHA1 (patch-ag) = 3c624216445c9df1437d29c2077a39bcde3d6653 +SHA1 (patch-ah) = 17316f3404d0022914c7847d160d9083ba504a22 +SHA1 (patch-ai) = c97f568da9a4df6f241b0dff0b60f2f552b3c88e +SHA1 (patch-aj) = 24366023199877bb93816d88c4ebf89a4ea2a6f2 +SHA1 (patch-ak) = ac2be46bfdf29ddd2cf4deb051eed201cd5ebbdf +SHA1 (patch-al) = dd2ffdd4e9470677c5f0c622ae8e3c5a925843ac +SHA1 (patch-am) = 376f95a684729ce32ded34a1a62d8ef300e52529 +SHA1 (patch-an) = 4b1e91e7f1719c84782f541cb3abc6e39f6b94e6 +SHA1 (patch-ao) = 87c6edc945e90d990d3db28687113189a723852b diff --git a/net/ocsinventory-agent/files/modules.conf b/net/ocsinventory-agent/files/modules.conf new file mode 100644 index 00000000000..c535131f893 --- /dev/null +++ b/net/ocsinventory-agent/files/modules.conf @@ -0,0 +1,15 @@ +# $NetBSD: modules.conf,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ +# this list of module will be load by the at run time +# to check its syntax do: +# #perl modules.conf +# You must have NO error. Else the content will be ignored +# This mechanism goal it to keep compatibility with 'plugin' +# created for the previous linux_agent. +# The new unified_agent have its own extension system that allow +# user to add new information easily. + +# This enables OCS-Inventory software deployment feature +#use Ocsinventory::Agent::Option::Download; + +# DO NOT REMOVE THE 1; +1; diff --git a/net/ocsinventory-agent/files/ocsinventory-agent.cfg b/net/ocsinventory-agent/files/ocsinventory-agent.cfg new file mode 100644 index 00000000000..41c538649d4 --- /dev/null +++ b/net/ocsinventory-agent/files/ocsinventory-agent.cfg @@ -0,0 +1,3 @@ +basevardir=/var/lib/ocsinventory-agent +server=http://my.ocs.server/ocsinventory + diff --git a/net/ocsinventory-agent/patches/patch-aa b/net/ocsinventory-agent/patches/patch-aa new file mode 100644 index 00000000000..bd9513bd66f --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-aa @@ -0,0 +1,22 @@ +$NetBSD: patch-aa,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- postinst.pl.orig 2009-06-25 15:14:19.000000000 +0200 ++++ postinst.pl 2009-06-25 15:15:00.000000000 +0200 +@@ -163,7 +163,7 @@ + } + + +-my $configdir = pickConfigdir ("/etc/ocsinventory", "/usr/local/etc/ocsinventory", "/etc/ocsinventory-agent"); ++my $configdir = pickConfigdir ("@PKG_SYSCONFDIR@"); + + if (-f $old_linux_agent_dir.'/ocsinv.conf' && ask_yn("Should the old linux_agent settings be imported?", 'y')) { + my $ocsinv = XMLin($old_linux_agent_dir.'/ocsinv.conf'); +@@ -220,7 +220,7 @@ + close CONFIG; + } + +-print "[info] The config file will be written in /etc/ocsinventory/ocsinventory-agent.cfg,\n"; ++print "[info] The config file will be written in @PKG_SYSCONFDIR@/ocsinventory-agent.cfg,\n"; + + my $tmp = promptUser('What is the address of your ocs server', exists ($config->{server})?$config->{server}:'ocsinventory-ng'); + $config->{server} = mkFullServerUrl($tmp); diff --git a/net/ocsinventory-agent/patches/patch-ab b/net/ocsinventory-agent/patches/patch-ab new file mode 100644 index 00000000000..64bdc502577 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ab @@ -0,0 +1,15 @@ +$NetBSD: patch-ab,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- lib/Ocsinventory/Agent/Config.pm.orig 2009-03-22 20:11:09.000000000 +0100 ++++ lib/Ocsinventory/Agent/Config.pm 2009-06-25 15:14:11.000000000 +0200 +@@ -8,9 +8,7 @@ + + @{$config->{etcdir}} = (); + +- push (@{$config->{etcdir}}, '/etc/ocsinventory'); +- push (@{$config->{etcdir}}, '/usr/local/etc/ocsinventory'); +- push (@{$config->{etcdir}}, '/etc/ocsinventory-agent'); ++ push (@{$config->{etcdir}}, '@PKG_SYSCONFDIR@'); + push (@{$config->{etcdir}}, $ENV{HOME}.'/.ocsinventory'); + + if (!$file || !-f $file) { diff --git a/net/ocsinventory-agent/patches/patch-ac b/net/ocsinventory-agent/patches/patch-ac new file mode 100644 index 00000000000..c152cc3434c --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ac @@ -0,0 +1,59 @@ +$NetBSD: patch-ac,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- Makefile.PL.orig 2009-03-22 20:18:44.000000000 +0100 ++++ Makefile.PL 2009-08-16 17:56:58.000000000 +0200 +@@ -1,21 +1,6 @@ + + use inc::Module::Install; + +-# Hack to be able to run a post install script +-sub MY::postamble +-{ +- +- my $re; +- +- $re = ' +-install :: all pure_install doc_install +- $(NOECHO) $(NOOP)'; +- +- $re .= "\n\t[ ! -f run-postinst ] || $^X postinst.pl\n"; +- +- return $re; +-} +- + use Config; + + name 'Ocsinventory-Agent'; +@@ -34,7 +19,7 @@ + recommends 'Proc::PID::File' => undef; + + install_script 'ocsinventory-agent'; +- ++installdirs 'vendor'; + + # We want a release bundled with the needed dependency to be able to + # prepare a standealone binay with PAR::Packer +@@ -47,14 +32,6 @@ + + + +-if (defined ($ENV{PERL_AUTOINSTALL}) || defined ($ENV{PERL_AUTOINSTALL})) { +- unlink 'run-postinst'; +-} else { +- open POSTINST, '>run-postinst' or die $!; +- close POSTINST; +-} +- +- + if (!can_use('Compress::Zlib')) { + print "Please install Compress::Zlib if you use an OCS server prior 1.02.\n"; + } +@@ -77,7 +54,7 @@ + $archname = $t[0]; + }; + if ($^O =~ /(linux|bsd)/i && (!$archname ||$archname =~ /(i[3456x]86|x86_64|amd64)/i)) { +- foreach (qw/dmidecode lspci/) { ++ foreach (qw/dmidecode pcictl/) { + if (!can_run($_)) { + print "\n"; + print "[WARNING] $_ is needed if you want a complet inventory on x86 and AMD64/x86_64.\n"; diff --git a/net/ocsinventory-agent/patches/patch-ad b/net/ocsinventory-agent/patches/patch-ad new file mode 100644 index 00000000000..6e050bbe78d --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ad @@ -0,0 +1,31 @@ +$NetBSD: patch-ad,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- /dev/null 2009-06-25 18:52:46.000000000 +0200 ++++ ./lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl/Controllers.pm 2009-06-25 18:50:23.000000000 +0200 +@@ -0,0 +1,26 @@ ++package Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Controllers; ++use strict; ++use Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Pcictl; ++ ++sub run { ++ my $params = shift; ++ my $inventory = $params->{inventory}; ++ ++ foreach (runpcictl()) { ++ if ($_ =~ m/^\S+:\s(.+)\s\(([^,]+)(,.+)?\)$/i) { ++ my $name = $1; ++ my $manufacturer = ""; ++ my $type = $2; ++ $manufacturer =~ s/\ *$//; # clean up the end of the string ++ ++ $inventory->addController({ ++ 'NAME' => $name, ++ 'MANUFACTURER' => $manufacturer, ++ 'TYPE' => $type, ++ }); ++ } ++ } ++ ++} ++ ++1 diff --git a/net/ocsinventory-agent/patches/patch-ae b/net/ocsinventory-agent/patches/patch-ae new file mode 100644 index 00000000000..d808b245a20 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ae @@ -0,0 +1,27 @@ +$NetBSD: patch-ae,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- /dev/null 2009-06-25 18:52:46.000000000 +0200 ++++ ./lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl/Sounds.pm 2009-06-25 18:50:29.000000000 +0200 +@@ -0,0 +1,22 @@ ++package Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Sounds; ++use strict; ++use Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Pcictl; ++ ++sub run { ++ my $params = shift; ++ my $inventory = $params->{inventory}; ++ ++ foreach (runpcictl()) { ++ ++ if(/audio/i && /^\S+:\s(.+)\s\(([^,]+)(,.+)?\)$/i) { ++ ++ $inventory->addSounds({ ++ 'DESCRIPTION' => $2, ++ 'MANUFACTURER' => "", ++ 'NAME' => $1, ++ }); ++ ++ } ++ } ++} ++1 diff --git a/net/ocsinventory-agent/patches/patch-af b/net/ocsinventory-agent/patches/patch-af new file mode 100644 index 00000000000..666e9ce9409 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-af @@ -0,0 +1,29 @@ +$NetBSD: patch-af,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- /dev/null 2009-06-25 18:52:46.000000000 +0200 ++++ ./lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl/Modems.pm 2009-06-25 18:50:26.000000000 +0200 +@@ -0,0 +1,24 @@ ++package Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Modems; ++use strict; ++use Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Pcictl; ++ ++sub run { ++ my $params = shift; ++ my $inventory = $params->{inventory}; ++ ++ foreach (runpcictl()) { ++ ++ if(/modem/i && /^\S+:\s(.+)\s\(([^,]+)(,.+)?\)$/i) { ++ my $name = $1; ++ my $description = $2; ++ ++ ++ $inventory->addModems({ ++ 'DESCRIPTION' => $description, ++ 'NAME' => $name, ++ }); ++ } ++ } ++} ++ ++1 diff --git a/net/ocsinventory-agent/patches/patch-ag b/net/ocsinventory-agent/patches/patch-ag new file mode 100644 index 00000000000..1abc0f91f4d --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ag @@ -0,0 +1,26 @@ +$NetBSD: patch-ag,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- /dev/null 2009-06-25 18:52:46.000000000 +0200 ++++ ./lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl/Videos.pm 2009-06-25 18:50:37.000000000 +0200 +@@ -0,0 +1,21 @@ ++package Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Videos; ++use strict; ++use Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Pcictl; ++ ++sub run { ++ my $params = shift; ++ my $inventory = $params->{inventory}; ++ ++ foreach (runpcictl()) { ++ ++ if(/graphics|vga|video|display/i && /^\S+:\s(.+)\s\(([^,]+)(,.+)?\)$/i) { ++ ++ $inventory->addVideos({ ++ 'CHIPSET' => $1, ++ 'NAME' => $2, ++ }); ++ ++ } ++ } ++} ++1 diff --git a/net/ocsinventory-agent/patches/patch-ah b/net/ocsinventory-agent/patches/patch-ah new file mode 100644 index 00000000000..8c55397ffd6 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ah @@ -0,0 +1,27 @@ +$NetBSD: patch-ah,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- /dev/null 2009-06-25 18:52:46.000000000 +0200 ++++ ./lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl.pm 2009-06-25 18:43:12.000000000 +0200 +@@ -0,0 +1,22 @@ ++package Ocsinventory::Agent::Backend::OS::BSD::Pcictl; ++use strict; ++ ++sub check {can_run("pcictl")} ++ ++sub run {} ++ ++sub runpcictl { ++ my @devices; ++ opendir DEV, "/dev" or die "can't open /dev"; ++ while (my $file = readdir DEV) { ++ if ($file =~ m/^pci[0-9]+$/) { ++ foreach (`pcictl $file list`) { ++ chop $_; ++ push @devices, $_; ++ } ++ } ++ } ++ return @devices; ++} ++ ++1; diff --git a/net/ocsinventory-agent/patches/patch-ai b/net/ocsinventory-agent/patches/patch-ai new file mode 100644 index 00000000000..98bd1dd7efc --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ai @@ -0,0 +1,26 @@ +$NetBSD: patch-ai,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- /dev/null 2009-06-25 18:59:27.000000000 +0200 ++++ ./lib/Ocsinventory/Agent/Backend/OS/BSD/Pcictl/Pcictl.pm 2009-06-25 18:59:02.000000000 +0200 +@@ -0,0 +1,21 @@ ++package Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Pcictl; ++require Exporter; ++@ISA = qw(Exporter); ++@EXPORT = qw(runpcictl); ++use strict; ++ ++sub runpcictl { ++ my @devices; ++ opendir DEV, "/dev" or die "can't open /dev"; ++ while (my $file = readdir DEV) { ++ if ($file =~ m/^pci[0-9]+$/) { ++ foreach (`pcictl $file list 2>/dev/null`) { ++ chop $_; ++ push @devices, $_; ++ } ++ } ++ } ++ return @devices; ++} ++ ++1; diff --git a/net/ocsinventory-agent/patches/patch-aj b/net/ocsinventory-agent/patches/patch-aj new file mode 100644 index 00000000000..157a0364bb2 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-aj @@ -0,0 +1,19 @@ +$NetBSD: patch-aj,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Alpha.pm.orig 2009-07-30 15:47:09.000000000 +0200 ++++ lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Alpha.pm 2009-07-30 15:52:08.000000000 +0200 +@@ -33,9 +33,11 @@ + # FreeBSD: AlphaStation 255 4/232, 232MHz + # CPU: EV45 (21064A) major=6 minor=2 + +- for (`dmesg`) { +- if (/^cpu[^:]*:\s*(.*)$/i) { $processort = $1; } +- if (/$SystemModel,\s*(\S+)\s*MHz.*$/) { $processors = $1; } ++ if ( -r "/var/run/dmesg.boot") { ++ for (`cat /var/run/dmesg.boot`) { ++ if (/^cpu[^:]*:\s*(.*)$/i) { $processort = $1; } ++ if (/$SystemModel,\s*(\S+)\s*MHz.*$/) { $processors = $1; } ++ } + } + + diff --git a/net/ocsinventory-agent/patches/patch-ak b/net/ocsinventory-agent/patches/patch-ak new file mode 100644 index 00000000000..f0cb6f0fb33 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ak @@ -0,0 +1,29 @@ +$NetBSD: patch-ak,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/I386.pm.orig 2009-07-30 15:47:09.000000000 +0200 ++++ lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/I386.pm 2009-07-30 15:52:59.000000000 +0200 +@@ -29,14 +29,16 @@ + # proc type with sysctl (hw.model) + chomp($processort=`sysctl -n hw.model`); + # XXX quick and dirty _attempt_ to get proc speed through dmesg +- for(`dmesg`){ +- my $tmp; +- if (/^cpu\S*\s.*\D[\s|\(]([\d|\.]+)[\s|-]mhz/i) { # XXX unsure +- $tmp = $1; +- $tmp =~ s/\..*//; +- $processors=$tmp; +- last +- } ++ if ( -r "/var/run/dmesg.boot") { ++ for(`cat /var/run/dmesg.boot`){ ++ my $tmp; ++ if (/^cpu\S*\s.*\D[\s|\(]([\d|\.]+)[\s|-]mhz/i) { # XXX unsure ++ $tmp = $1; ++ $tmp =~ s/\..*//; ++ $processors=$tmp; ++ last ++ } ++ } + } + + # Writing data diff --git a/net/ocsinventory-agent/patches/patch-al b/net/ocsinventory-agent/patches/patch-al new file mode 100644 index 00000000000..f7b896f48a6 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-al @@ -0,0 +1,21 @@ +$NetBSD: patch-al,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Sgimips.pm.orig 2009-07-30 15:47:09.000000000 +0200 ++++ lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Sgimips.pm 2009-07-30 15:53:34.000000000 +0200 +@@ -45,10 +45,12 @@ + # cpu0 at mainbus0: MIPS R5000 CPU rev 2.1 180 MHz with R5000 based FPC rev 1.0 + # cpu0: cache L1-I 32KB D 32KB 2 way, L2 512KB direct + +- for (`dmesg`) { +- if (/$SystemModel\s*\[\S*\s*(\S*)\]/) { $SystemSerial = $1; } +- if (/cpu0 at mainbus0:\s*(.*)$/) { $processort = $1; } +- if (/CPU\s*.*\D(\d+)\s*MHz/) { $processors = $1; } ++ if ( -r "/var/run/dmesg.boot") { ++ for (`cat /var/run/dmesg.boot`) { ++ if (/$SystemModel\s*\[\S*\s*(\S*)\]/) { $SystemSerial = $1; } ++ if (/cpu0 at mainbus0:\s*(.*)$/) { $processort = $1; } ++ if (/CPU\s*.*\D(\d+)\s*MHz/) { $processors = $1; } ++ } + } + + # number of procs with sysctl (hw.ncpu) diff --git a/net/ocsinventory-agent/patches/patch-am b/net/ocsinventory-agent/patches/patch-am new file mode 100644 index 00000000000..3c2d804363c --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-am @@ -0,0 +1,19 @@ +$NetBSD: patch-am,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Sparc.pm.orig 2009-07-30 15:47:09.000000000 +0200 ++++ lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Sparc.pm 2009-07-30 15:54:21.000000000 +0200 +@@ -52,9 +52,11 @@ + # c) FreeBSD + # cpu0: Sun Microsystems UltraSparc-I Processor (167.00 MHz CPU) + +- for (`dmesg`) { +- if (/^mainbus0 \(root\):\s*(.*)$/) { $SystemModel = $1; } +- if (/^cpu[^:]*:\s*(.*)$/i) { $processort = $1 unless $processort; } ++ if ( -r "/var/run/dmesg.boot") { ++ for(`cat /var/run/dmesg.boot`){ ++ if (/^mainbus0 \(root\):\s*(.*)$/) { $SystemModel = $1; } ++ if (/^cpu[^:]*:\s*(.*)$/i) { $processort = $1 unless $processort; } ++ } + } + $SystemModel || chomp ($SystemModel = `sysctl -n hw.model`); # for FreeBSD + $SystemManufacturer = "SUN"; diff --git a/net/ocsinventory-agent/patches/patch-an b/net/ocsinventory-agent/patches/patch-an new file mode 100644 index 00000000000..efd66622c2c --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-an @@ -0,0 +1,21 @@ +$NetBSD: patch-an,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- lib/Ocsinventory/Agent/Backend/OS/BSD/Storages.pm.orig 2009-07-30 16:04:02.000000000 +0200 ++++ lib/Ocsinventory/Agent/Backend/OS/BSD/Storages.pm 2009-07-30 16:04:06.000000000 +0200 +@@ -19,10 +19,12 @@ + } + for my $dev (@devices) { + my ($model,$capacity,$found, $manufacturer); +- for(`dmesg`){ +- if(/^$dev/) { $found = 1;} +- if(/^$dev.*<(.*)>/) { $model = $1; } +- if(/^$dev.*\s+(\d+)\s*MB/) { $capacity = $1;} ++ if ( -r "/var/run/dmesg.boot") { ++ for (`cat /var/run/dmesg.boot`) { ++ if(/^$dev/) { $found = 1;} ++ if(/^$dev.*<(.*)>/) { $model = $1; } ++ if(/^$dev.*\s+(\d+)\s*MB/) { $capacity = $1;} ++ } + } + + if ($model =~ s/^(SGI|SONY|WDC|ASUS|LG|TEAC|SAMSUNG|PHILIPS|PIONEER|MAXTOR|PLEXTOR|SEAGATE|IBM|SUN|SGI|DEC|FUJITSU|TOSHIBA|YAMAHA|HITACHI|VERITAS)\s*//i) { diff --git a/net/ocsinventory-agent/patches/patch-ao b/net/ocsinventory-agent/patches/patch-ao new file mode 100644 index 00000000000..9de771fa088 --- /dev/null +++ b/net/ocsinventory-agent/patches/patch-ao @@ -0,0 +1,17 @@ +$NetBSD: patch-ao,v 1.1.1.1 2009/08/16 18:25:53 bouyer Exp $ + +--- lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci.pm.orig 2009-08-16 17:53:53.000000000 +0200 ++++ lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci.pm 2009-08-16 17:59:58.000000000 +0200 +@@ -1,7 +1,11 @@ + package Ocsinventory::Agent::Backend::OS::Generic::Lspci; + use strict; + +-sub check {can_run("lspci")} ++sub check { ++ return if can_run("pcictl"); ++ return unless can_run("lspci"); ++ 1; ++} + + + sub run {} |