wok rev 3675

Add ocsinventory-agent
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sat Jul 11 12:17:46 2009 +0200 (2009-07-11)
parents fb7e577211da
children 6cf13fdfcede
files ocsinventory-agent/receipt ocsinventory-agent/stuff/Slitaz.pm ocsinventory-agent/stuff/manifest.u
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ocsinventory-agent/receipt	Sat Jul 11 12:17:46 2009 +0200
     1.3 @@ -0,0 +1,59 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="ocsinventory-agent"
     1.7 +VERSION="1.02"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="OCS Inventory NG agent for Linux."
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +SOURCE="OCSNG_UNIX_AGENT"
    1.12 +TARBALL="$SOURCE-$VERSION.tar.gz"
    1.13 +DEPENDS="perl perl-lwp-useragent perl-uri-url dmidecode"
    1.14 +SUGGESTED="nmap perl-ssleay"
    1.15 +BUILD_DEPENDS="perl"
    1.16 +WEB_SITE="http://www.ocsinventory-ng.org/"
    1.17 +WGET_URL="http://downloads.sourceforge.net/sourceforge/ocsinventory/$TARBALL"
    1.18 +
    1.19 +# Rules to configure and make the package.
    1.20 +compile_rules()
    1.21 +{
    1.22 +	  
    1.23 +	src=$WOK/$PACKAGE/Ocsinventory-Agent-1.0.1
    1.24 +
    1.25 +	cp stuff/Slitaz.pm $src/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB
    1.26 +	cd $src
    1.27 +	
    1.28 +	# don't run postinstall script
    1.29 +	rm -f run-postinst
    1.30 +	patch -p1 -i ../stuff/manifest.u || exit
    1.31 +	perl Makefile.PL 
    1.32 +	rm -f run-postinst
    1.33 +	 make && \
    1.34 +	 make DESTDIR=$PWD/_pkg install
    1.35 +}
    1.36 +
    1.37 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.38 +genpkg_rules()
    1.39 +{
    1.40 +	_pkg=$WOK/$PACKAGE/Ocsinventory-Agent-1.0.1/_pkg
    1.41 +		
    1.42 +	mkdir -p $fs/usr \
    1.43 +		$fs/etc/ocsinventory-agent \
    1.44 +		$fs/var/lib/ocsinventory-agent
    1.45 +		
    1.46 +	cp -a $_pkg/usr/bin $fs/usr
    1.47 +	cp -a $_pkg/usr/lib $fs/usr
    1.48 +}
    1.49 +
    1.50 +post_install(){
    1.51 +	echo "postinstall commands"
    1.52 +	cat > $1/etc/ocsinventory-agent/ocsinventory-agent.cfg <<EOT
    1.53 +basevardir=/var/lib/ocsinventory-agent
    1.54 +server=http://$(hostname)/ocsinventory
    1.55 +EOT
    1.56 +}	
    1.57 +
    1.58 +clean_wok()
    1.59 +{
    1.60 +	[ -d Ocsinventory-Agent-1.0.1 ] && rm -rf Ocsinventory-Agent-1.0.1
    1.61 +}
    1.62 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/ocsinventory-agent/stuff/Slitaz.pm	Sat Jul 11 12:17:46 2009 +0200
     2.3 @@ -0,0 +1,29 @@
     2.4 +package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Slitaz;
     2.5 +use strict;
     2.6 +
     2.7 +sub check {-f "/etc/slitaz-release"}
     2.8 +
     2.9 +#####
    2.10 +sub findRelease {
    2.11 +  my $v;
    2.12 +
    2.13 +  open V, "</etc/slitaz-release" or warn;
    2.14 +  chomp ($v=<V>);
    2.15 +  close V;
    2.16 +  return "SliTaz GNU/Linux $v";
    2.17 +}
    2.18 +
    2.19 +sub run {
    2.20 +  my $params = shift;
    2.21 +  my $inventory = $params->{inventory};
    2.22 +
    2.23 +  my $OSComment;
    2.24 +  chomp($OSComment =`uname -v`);
    2.25 +
    2.26 +  $inventory->setHardware({ 
    2.27 +      OSNAME => findRelease(),
    2.28 +      OSCOMMENTS => "$OSComment"
    2.29 +    });
    2.30 +}
    2.31 +
    2.32 +1;
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/ocsinventory-agent/stuff/manifest.u	Sat Jul 11 12:17:46 2009 +0200
     3.3 @@ -0,0 +1,10 @@
     3.4 +--- Ocsinventory-Agent-1.0.1.ori/MANIFEST	Sun Mar 22 20:19:28 2009
     3.5 ++++ Ocsinventory-Agent-1.0.1/MANIFEST	Thu Jul  9 16:27:30 2009
     3.6 +@@ -82,6 +82,7 @@
     3.7 + lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/LSB.pm
     3.8 + lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB.pm
     3.9 + lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Debian.pm
    3.10 ++lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Slitaz.pm
    3.11 + lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Fedora.pm
    3.12 + lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Gentoo.pm
    3.13 + lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Knoppix.pm