SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "ocsinventory-agent"

# SliTaz package receipt.

PACKAGE="ocsinventory-agent"
VERSION="2.0.4"
CATEGORY="network"
SHORT_DESC="OCS Inventory NG agent for Linux."
MAINTAINER="erjo@slitaz.org"
LICENSE="GPL2"
SOURCE="Ocsinventory-Unix-Agent"
TARBALL="$SOURCE-$VERSION.tar.gz"
SUGGESTED="nmap perl-net-ssleay"
WEB_SITE="https://www.ocsinventory-ng.org/"
WGET_URL="https://launchpad.net/ocsinventory-unix-agent/stable-${VERSION%.*}/$VERSION/+download/$TARBALL"

DEPENDS="perl perl-libwww perl-uri dmidecode"
BUILD_DEPENDS="perl wget"

# What is the latest version available today?
current_version()
{
    wget -O - https://launchpad.net/ocsinventory-unix-agent/ 2>/dev/null | \
    sed '/Latest version/!d;s|.*is ||'
}

# Rules to configure and make the package.
compile_rules()
{
    cp $stuff/Slitaz.pm $src/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB
    cp $stuff/Tazpkg.pm $src/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging

    # don't run postinstall script
    rm -f run-postinst
    for p in $stuff/ocsinventory-agent-1.1.2.1.u
    do
        [ -f done.$(basename $p) ] && continue
        patch -p1 -i $p || return 1
        touch done.$(basename $p)
    done
    perl Makefile.PL
    rm -f run-postinst
    make && make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr \
        $fs/etc/ocsinventory-agent \
        $fs/var/lib/ocsinventory-agent

    cp -a $install/usr/bin $fs/usr
    cp -a $install/usr/lib $fs/usr
}

post_install(){
    cat > "$1/etc/ocsinventory-agent/ocsinventory-agent.cfg" <<EOT
basevardir=/var/lib/ocsinventory-agent
server=http://localhost/ocsinventory
EOT
    # We need fix missing status for dpkg
    # So we can Ocs agent can run Tazpkg.pm
    if [ ! -d "$1/var/lib/dpkg" ]; then
        install -o root -g root -m 0755 -d "$1/var/lib/dpkg"
        touch "$1/var/lib/dpkg/status"
    fi
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)