novi paket
authorroot <root@nekkar.carnet.hr>
Fri, 26 Jun 2009 13:36:02 +0000 (15:36 +0200)
committerroot <root@nekkar.carnet.hr>
Fri, 26 Jun 2009 13:36:02 +0000 (15:36 +0200)
12 files changed:
Hostname.pm [new file with mode: 0644]
README.CARNet [new file with mode: 0644]
changelog.CARNet [new symlink]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/install [new file with mode: 0644]
debian/postinst [new file with mode: 0755]
debian/postrm [new file with mode: 0755]
debian/preinst [new file with mode: 0755]
debian/rules [new file with mode: 0755]

diff --git a/Hostname.pm b/Hostname.pm
new file mode 100644 (file)
index 0000000..e641d8d
--- /dev/null
@@ -0,0 +1,34 @@
+package Ocsinventory::Agent::Backend::OS::Generic::Hostname;
+
+sub check {
+  eval { require (Sys::Hostname) };
+  return 1 unless $@;
+  `which hostname 2>&1`;
+  return if ($? >> 8)!=0;
+  `hostname 2>&1`;
+  return if ($? >> 8)!=0;
+  1;
+}
+
+# Initialise the distro entry
+sub run {
+  my $params = shift;
+  my $inventory = $params->{inventory};
+
+  my $hostname;
+
+  # ico, Tue, 26 May 2009 17:58:27 +0200
+  chomp ( my $hostname = `hostname --fqdn` );
+  #eval { require (Sys::Hostname) };
+  #if (!$@) {
+  #  $hostname = Sys::Hostname::hostname();
+  #} else {
+  #  chomp ( $hostname = `hostname` ); # TODO: This is not generic.
+  #}
+  #$hostname =~ s/\..*//; # keep just the hostname
+
+
+  $inventory->setHardware ({NAME => $hostname});
+}
+
+1;
diff --git a/README.CARNet b/README.CARNet
new file mode 100644 (file)
index 0000000..4c08e4c
--- /dev/null
@@ -0,0 +1,6 @@
+ocsinventory-agent-cn
++-------------------+
+
+Paket zamjenjuje Hostname.pm zbog slanja dugog oblika imena (FQDN).
+
+ -- Ivan Rako <Ivan.Rako@CARNet.hr>  Fri, 26 Jun 2009 15:00:05 +0200
diff --git a/changelog.CARNet b/changelog.CARNet
new file mode 120000 (symlink)
index 0000000..194579e
--- /dev/null
@@ -0,0 +1 @@
+changelog.Debian
\ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..c027f14
--- /dev/null
@@ -0,0 +1,5 @@
+ocsinventory-agent-cn (1:0.0.9.2repack1-4) stable; urgency=low
+
+  * inicijalna verzija paketa
+
+ -- Ivan Rako <Ivan.Rako@CARNet.hr>  Fri, 26 Jun 2009 15:01:18 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..ea777c3
--- /dev/null
@@ -0,0 +1,16 @@
+Source: ocsinventory-agent-cn
+Section: net
+Priority: optional
+Maintainer: Ivan Rako <Ivan.Rako@CARNet.hr>
+Build-Depends: debhelper (>= 4.0.0)
+Standards-Version: 3.6.1
+
+Package: ocsinventory-agent-cn
+Architecture: all
+Depends: carnet-tools-cn (>= 2.7), ocsinventory-agent (>= 1:0.0.9.2repack1-4)
+Description: Hardware and software inventory tool (client)
+ Open Computer and Software Inventory Next Generation is an
+ application designed to help a network or system administrator to
+ keep track of the hardware and software configurations of computers
+ that are installed on the network.  It also allows deploying
+ software, scripts and files on client computers.
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..d92e2d1
--- /dev/null
@@ -0,0 +1,2 @@
+README.CARNet
+changelog.CARNet
diff --git a/debian/install b/debian/install
new file mode 100644 (file)
index 0000000..8e29198
--- /dev/null
@@ -0,0 +1 @@
+Hostname.pm usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic
diff --git a/debian/postinst b/debian/postinst
new file mode 100755 (executable)
index 0000000..31ed91a
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+[ "$1" = "configure" ] || exit 0
+[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
+
+# Load CARNet Tools
+. /usr/share/carnet-tools/functions.sh
+# Load Debconf
+. /usr/share/debconf/confmodule
+
+ocsmethod="http"
+ocsserver="inventory.CARNet.hr"
+
+db_get ocsinventory-agent/method || true
+method="$RET"
+
+if [ "$method" != "$ocsmethod" ]; then
+  db_set ocsinventory-agent/method "$ocsmethod" || true
+fi
+
+db_get ocsinventory-agent/server
+server="$RET"
+
+if [ "$server" != "$ocsserver" ]; then
+  db_set ocsinventory-agent/server "$ocsserver"
+fi
+
+cp_check_and_sed "^server" \
+                 "s/^server.*/server=$ocsserver/g" \
+                 /etc/ocsinventory/ocsinventory-agent.cfg || true
+
+if ! grep -q ^server= /etc/ocsinventory/ocsinventory-agent.cfg; then
+  echo "server=$ocsserver" >> /etc/ocsinventory/ocsinventory-agent.cfg
+fi
diff --git a/debian/postrm b/debian/postrm
new file mode 100755 (executable)
index 0000000..23cc4e2
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = remove ]; then
+  rm -f /etc/init.d/amavis
+  dpkg-divert --quiet --package ocsinventory-agent-cn --remove --rename \
+    --divert /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm.divert
+    /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm || true
+fi
diff --git a/debian/preinst b/debian/preinst
new file mode 100755 (executable)
index 0000000..da715bf
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = install -o "$1" = upgrade ]; then
+  dpkg-divert --quiet --package ocsinventory-agent-cn --rename \
+    --divert /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm.divert \
+    /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm
+fi
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..b41b855
--- /dev/null
@@ -0,0 +1,86 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+
+       touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+       dh_testdir
+
+       # Add here commands to compile the package.
+       # $(MAKE)
+
+       touch build-stamp
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       # -$(MAKE) clean
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/ocsinventory-agent-cn.
+       # $(MAKE) install DESTDIR=$(CURDIR)/debian/ocsinventory-agent-cn
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs -k
+       dh_installdocs
+#      dh_installexamples
+       dh_install
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+#      dh_link
+#      dh_strip
+#      dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_python
+#      dh_makeshlibs
+       dh_installdeb
+#      dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure