SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "ocsinventory-server"

# SliTaz package receipt.

PACKAGE="ocsinventory-server"
VERSION="2.0.4"
CATEGORY="network"
SHORT_DESC="Iventory and package deployment system"
MAINTAINER="pascal.bellard@slitaz.org"
DEPENDS="apache php-apache mysql perl perl-xml-simple perl-compress-raw-zlib
 perl-dbi perl-dbd-mysql perl-apache-dbi perl-net-ip perl-soap-lite
 perl-xml-parser perl-xml-sax-writer apache-mod-perl"
SOURCE="OCSNG_UNIX_SERVER"
WEB_SITE="http://www.ocsinventory-ng.org/index.php?page=English"
WANTED="ocsinventory"

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr
    cp -a $_pkg/usr/lib $fs/usr
    
    install -o www -g www -m 0775  -d $fs/var/log/ocsinventory-server
    install -o root -g www -m 0775 -d $fs/var/lib/ocsinventory-server/ipd
    install -o root -g www -m 0775 -d $fs/var/lib/ocsinventory-server/download
    
    mkdir -p $fs/etc/logrotate.d
    cp -f $src/etc/logrotate.d/ocsinventory-server \
        $fs/etc/logrotate.d/ocsinventory-server
    sed -i "s#PATH_TO_LOG_DIRECTORY#/var/log/ocsinventory-server#g" \
        $fs/etc/logrotate.d/ocsinventory-server 
    
    mkdir -p $fs/etc/apache/conf.d
    cp $src/etc/ocsinventory/ocsinventory-server.conf \
        $fs/etc/apache/conf.d/ocsinventory-server.conf
    sed -i  -e "s#DATABASE_SERVER#localhost#g" \
        -e "s#DATABASE_PORT#3306#g" \
        -e "s#VERSION_MP#2#g" \
        -e "s#PATH_TO_LOG_DIRECTORY#/var/log/ocsinventory-server#g" \
        $fs/etc/apache/conf.d/ocsinventory-server.conf

    if ! grep -q mod_perl.so $fs/etc/apache/conf.d/ocsinventory-server.conf;
    then
        cat > $fs/etc/apache/conf.d/ocsinventory-server.tmp <<EOT
<IfModule !mod_perl.c>
   loadmodule perl_module share/apache/modules/mod_perl.so
</IfModule>

$(cat $fs/etc/apache/conf.d/ocsinventory-server.conf)
EOT
        mv $fs/etc/apache/conf.d/ocsinventory-server.tmp \
            $fs/etc/apache/conf.d/ocsinventory-server
        [ -f $fs/etc/apache/conf.d/ocsinventory-server.conf ] && \
            rm -f $fs/etc/apache/conf.d/ocsinventory-server.conf
    fi
}

post_install()
{
    if [ -z $1 ]; then
        echo "Now you can connect to http://$(hostname)/ocsreports"
        # Restart Apache if is running
        [ -f /var/run/apache/httpd.pid ] && /etc/init.d/apache reload
    fi
}


3382 packages and 430813 files in stable database (Mon Mar 4 17:53:49 2019)