rpms/ocsinventory-client/devel ocsinventory-client.README, NONE, 1.1 ocsinventory-client.README.fr, NONE, 1.1 ocsinventory-client.patch, NONE, 1.1 ocsinventory-client.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Remi Collet (remi) fedora-extras-commits at redhat.com
Thu Nov 30 06:04:55 UTC 2006


Author: remi

Update of /cvs/extras/rpms/ocsinventory-client/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22437/devel

Modified Files:
	.cvsignore sources 
Added Files:
	ocsinventory-client.README ocsinventory-client.README.fr 
	ocsinventory-client.patch ocsinventory-client.spec 
Log Message:
auto-import ocsinventory-client-1.0-0.5.RC3.fc7 on branch devel from ocsinventory-client-1.0-0.5.RC3.fc7.src.rpm


--- NEW FILE ocsinventory-client.README ---
Thie RPM install the OCS Inventory NG client
It is configure to generate a local report:

	/var/log/ocsinventory-client/<DEVIDE_ID>.ocs

If you want it to automaticaly transfer the result
to your organization communication server, 
edit the configuration file:

	/etc/ocsinventory-client/ocsinv.conf

Change the line
	<OCSFSERVER>local</OCSFSERVER>
To
	<OCSFSERVER>ocsserver.domain.tld:port</OCSFSERVER>

If you want to use the ocs TAG,
edit the administrative file:

	/etc/ocsinventory-client/ocsinv.adm

Change the lines
	<KEYNAME>TAG</KEYNAME>
	<KEYVALUE></KEYVALUE>
To
	<KEYNAME>TAG</KEYNAME>
	<KEYVALUE>tagvalue</KEYVALUE>

If you want to deploy this client on a important number of
computer, you can generate a already configured RPM with

rpmbuild -bb \
	--define "ocstag    tagvalue" \
	--define "ocsserver ocsserver.domain.tld:port" \
	ocsinventory-client-<version>.src.rpm

Result will be : ocsinventory-client-<version>.<tagvalue>.<arch>.rpm



--- NEW FILE ocsinventory-client.README.fr ---
Ce RPM installe le client d"OCS Inventory NG"
Il est configuré pour générer un rapport local :

	/var/log/ocsinventory-client/<DEVIDE_ID>.ocs

Si vous souhaitez transmettre ce rapport au serveur
de communication de votre organisation, éditez le
fichier de configuration :

	/etc/ocsinventory-client/ocsinv.conf

Modifiez la ligne
	<OCSFSERVER>local</OCSFSERVER>
en
	<OCSFSERVER>ocsserver.domain.tld:port</OCSFSERVER>

Si vous souhaitez utilise le TAG ocs,
éditez le fichier admistratif :

	/etc/ocsinventory-client/ocsinv.adm

Modifiez les lignes
	<KEYNAME>TAG</KEYNAME>
	<KEYVALUE></KEYVALUE>
en
	<KEYNAME>TAG</KEYNAME>
	<KEYVALUE>tagvalue</KEYVALUE>

Si vous désirez déployer ce client sur un parc important, vous
pouvez générer un RPM préconfiguré à l'aide de la commande

rpmbuild -bb \
	--define "ocstag    tagvalue" \
	--define "ocsserver ocsserver.domain.tld:port" \
	ocsinventory-client-<version>.src.rpm

Le résultat sera : ocsinventory-client-<version>.<tagvalue>.<arch>.rpm


ocsinventory-client.patch:

--- NEW FILE ocsinventory-client.patch ---
--- Ocsinventory/ocsinventory-client.pl.fedora	2006-07-03 22:27:03.000000000 +0200
+++ Ocsinventory/ocsinventory-client.pl	2006-11-28 19:04:59.000000000 +0100
@@ -35,7 +35,8 @@
 #
 use constant VERSION =>13;
 #
-my $log_path		= "/var/log/ocsinventory-client/ocsinv.log";
+my $log_folder		= "/var/log/ocsinventory-client";
+my $log_path		= $log_folder. "/ocsinv.log";
 my $default_server	= "ocsinventory-ng";
 my $install_path	= "/etc/ocsinventory-client";
 my $exe_path		= "/usr/sbin";
@@ -263,9 +264,6 @@
 	}elsif(-e "/etc/mandrake-release"){
 		$distro = 'Mandrake';
 		$distro_file = "/etc/mandrake-release";
-	}elsif(-e "/etc/redhat-release"){
-		$distro = 'Redhat';
-		$distro_file = "/etc/redhat-release";
 	}elsif(-e "/etc/SuSE-release"){
 		$distro = 'SuSe';
 		$distro_file = "/etc/SuSE-release";
@@ -276,11 +274,14 @@
 		$distro = 'Knoppix'; 
 		$distro_file = "/etc/knoppix_version";
 	}elsif(-e "/etc/fedora-release"){
-	   	$distro = 'Fedora Core';
+	   	$distro = 'Fedora';
 		$distro_file = "/etc/fedora-release";
 	}elsif(-e "/etc/trustix-release"){
 	   	$distro = 'Trustix';
 		$distro_file = "/etc/trustix-release";
+	}elsif(-e "/etc/redhat-release"){
+		$distro = 'Redhat';
+		$distro_file = "/etc/redhat-release";
 	}
 	
 	open DISTRO, $distro_file;
@@ -713,6 +714,7 @@
 
 sub _monitors{
 	# Looking for XFConfig
+	-e "/etc/X11/xorg.conf" and $xfree = "/etc/X11/xorg.conf";
 	-e "/etc/X11/XF86Config" and $xfree = "/etc/X11/XF86Config";
 	-e "/etc/X11/XF86Config-4" and $xfree = "/etc/X11/XF86Config-4";
 	-e "/etc/XF86Config" and $xfree = "/etc/XF86Config";
@@ -846,7 +848,7 @@
 		my $dpkg_path = &_get_path('dpkg');
 		@liste = `$dpkg_path -l`;
 		$dpkg = 1;
-	}elsif($distro=~/mandrake|redhat|suse/i){
+	}elsif($distro=~/mandrake|redhat|fedora|suse/i){
 		my $rpm_path = &_get_path('rpm');
 		my $buff;
 		foreach(`rpm -qa --queryformat "%{NAME} %{VERSION}-%{RELEASE} %{SUMMARY}\n--\n"`) {
@@ -894,23 +896,16 @@
 
 	# If $ServerName is local, we know that the inventory is generated on the local machine
 	if(($ServerName eq 'local') or $xml){
-		$err=1;
 
-		while($err){
-			print "\n\n\tChoose your target directory ? :  ";
-
-			chomp($ptmontage=<STDIN>);
+			$ptmontage=$log_folder;
 
 			# Checking existence and permissions of the destination directory
 			if(!(-e $ptmontage)){
-				print "The directory do not exist .\n";
-				$err++;
+				die("The directory do not exist .\n");
 			}elsif(!(-w $ptmontage)){
-				print "The mount point is not writeable.\n";
-				$err++;
+				die("The mount point is not writeable.\n");
 			# Generate...
 			}else{
-				$err = 0;
 				open XML, ">$ptmontage/$DeviceID.ocs" or die localtime()." => Cannot create file : $!\n";
 
 				if($xml){
@@ -924,8 +919,6 @@
 				close XML;
 			}
 
-			die("Abort.\n") if $err>3;
-		}
 		print localtime()." => Inventory generated...\n";
 	}else{
 		# Sending inventory to web server


--- NEW FILE ocsinventory-client.spec ---
%define tarname OCSNG_LINUX_AGENT_1.0RC3

# Can, optionaly, be define at build time (see README.fedora)
# - ocstag    : administrative tag
# - ocsserver : OCS Inventory NG communication serveur

Name:      ocsinventory-client
Version:   1.0
Release:   0.5.RC3%{?dist}%{?ocstag:.}%{?ocstag}
Summary:   Open Computer and Software Inventory Next Generation client

Group:     Development/Libraries
License:   GPL
URL:       http://ocsinventory.sourceforge.net/
Source0:   http://heanet.dl.sourceforge.net/sourceforge/ocsinventory/%{tarname}.tar.gz
Source1:   ocsinventory-client.README
Source2:   ocsinventory-client.README.fr
Patch0:    ocsinventory-client.patch

# Not noarch because of ipdiscover.c - BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: %{_sbindir}/dmidecode, perl
%if %{?fedora}0
Requires:  perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%else
%define perl_vendorlib  %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
%endif
Requires:  perl(HTTP::Request)
Requires:  %{_sbindir}/dmidecode, coreutils, net-tools, pciutils
Requires:  %{_sysconfdir}/logrotate.d, %{_sysconfdir}/cron.daily

%description
Open Computer and Software Inventory Next Generation is an application
designed to help a network or system administrator keep track of computer
configuration and software installed on the network. 

It also allows deploying softwares, commands or files on Windows and 
Linux client computers.

%{name} provide the client agent for Linux.

%description -l fr
Open Computer and Software Inventory Next Generation est une application
destinée à aider l'administrateur système ou réseau à garder un oeil sur
la configuration des machines du réseau et sur les logiciels qui y sont
installés. 

Elle autorise aussi la télédiffusion (ou déploiement) de logiciels, 
de commandes ou de fichiers sur les clients Windows ou Linux.

%{name} fournit l'agent client pour Linux.

%prep
%setup -q -n %{tarname}
%patch0 -p0 -b .fedora
%{__sed} -i -e 's/\r//' changelogs

cat <<EOF >ocsinv.conf
<CONF>
  <DEVICEID>OCS_AGENT_DEVICE_ID</DEVICEID>
  <DMIVERSION>$(%{_sbindir}/dmidecode --version)</DMIVERSION>
  <IPDISCOVER_VERSION>3</IPDISCOVER_VERSION>
  <OCSFSERVER>%{?ocsserver}%{!?ocsserver:local}</OCSFSERVER>
  <UPDATE>0</UPDATE>
</CONF>
EOF

cat <<EOF >ocsinv.adm
<ADM>
  <ACCOUNTINFO>
    <KEYNAME>TAG</KEYNAME>
    <KEYVALUE>%{?ocstag}</KEYVALUE>
  </ACCOUNTINFO>
</ADM>
EOF

cat <<EOF >cron
#!/bin/sh
%{_sbindir}/ocsinventory-client.pl &>/dev/null
EOF

%{__sed} -i -e 's|PATH_TO_LOG_DIRECTORY|%{_localstatedir}/log/%{name}|' logrotate.ocsinventory-client

cp %{SOURCE1} README.fedora
cp %{SOURCE2} README.fedora.fr

%build
pushd Ocsinventory
%{__perl} Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
popd
%{__cc} %{optflags} -o ipdiscover ipdiscover.c

%install
rm -rf %{buildroot}

pushd Ocsinventory
make pure_install PERL_INSTALL_ROOT=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';'
chmod -R u+rwX,go+rX,go-w %{buildroot}/*
rm %{buildroot}%{perl_vendorlib}/Ocsinventory/ocsinventory-client.pl
popd

%{__install} -m 755 ipdiscover %{buildroot}%{_sbindir}

%{__mkdir_p} %{buildroot}%{_localstatedir}/log/%{name}

%{__mkdir_p} %{buildroot}%{_sysconfdir}/%{name}
%{__install} -m 644 ocsinv.conf ocsinv.adm %{buildroot}%{_sysconfdir}/%{name}

%{__mkdir_p} %{buildroot}%{_sysconfdir}/logrotate.d
%{__install} -m 644 logrotate.ocsinventory-client %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

%{__mkdir_p} %{buildroot}%{_sysconfdir}/cron.daily
%{__install} -m 755 cron %{buildroot}%{_sysconfdir}/cron.daily/%{name}

%clean
rm -rf %{buildroot}

%post
# First install : generate DEVICE_ID
if [ "$1" -eq "1" ]
then   
    OCS_AGENT_DEVICE_ID=$(hostname)-$(date +%%Y-%%m-%%d-%%H-%%M-%%S)
    %{__sed} -i -e "s/OCS_AGENT_DEVICE_ID/$OCS_AGENT_DEVICE_ID/" %{_sysconfdir}/%{name}/ocsinv.conf
fi

%files
%defattr(-, root, root, -)
%doc changelogs README README.fedora
%lang(fr) %doc README.fedora.fr
%{perl_vendorlib}/Ocsinventory
%{_sbindir}/ocsinventory-client.pl
%{_sbindir}/ipdiscover
%dir %{_localstatedir}/log/%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/ocsinv.*
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_sysconfdir}/cron.daily/%{name}


%changelog
* Wed Nov 29 2006 Remi Collet <Fedora at famillecollet.com> 1.0-0.5.RC3
- Requires %%{_sysconfdir}/logrotate.d and %%{_sysconfdir}/cron.daily
- define perl_vendorlib on non-fedora (for RHEL3)

* Tue Nov 28 2006 Remi Collet <Fedora at famillecollet.com> 1.0-0.4.RC3
- requires %%{_sbindir}/dmidecode (kernel-utils in FC3) rather than dmidecode 
- requires perl(:MODULE_COMPAT) only on Fedora (not provided on RHEL3)
- patch improved (Fedora is RPM based)

* Mon Nov 27 2006 Remi Collet <Fedora at famillecollet.com> 1.0-0.3.RC3
- $RPM_OPT_FLAGS changed to %%{optflags}. 
- add not detected Requires perl(HTTP::Request)

* Sun Nov 26 2006 Remi Collet <Fedora at famillecollet.com> 1.0-0.2.RC3
- replace perl and dos2unix by sed
- split README.fedora

* Sun Nov 26 2006 Remi Collet <Fedora at famillecollet.com> 1.0-0.1.RC3
- initial spec


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/ocsinventory-client/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	30 Nov 2006 06:03:30 -0000	1.1
+++ .cvsignore	30 Nov 2006 06:04:25 -0000	1.2
@@ -0,0 +1 @@
+OCSNG_LINUX_AGENT_1.0RC3.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/ocsinventory-client/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	30 Nov 2006 06:03:30 -0000	1.1
+++ sources	30 Nov 2006 06:04:25 -0000	1.2
@@ -0,0 +1 @@
+34edd057f1937245d06c3515c0ff50ad  OCSNG_LINUX_AGENT_1.0RC3.tar.gz




More information about the fedora-extras-commits mailing list