wok-6.x annotate ocsinventory-server/receipt @ rev 3674

Add ocsinventory-server
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sat Jul 11 12:17:23 2009 +0200 (2009-07-11)
parents
children 93d0091756cf
rev   line source
erjo@3674 1 # SliTaz package receipt.
erjo@3674 2
erjo@3674 3 PACKAGE="ocsinventory-server"
erjo@3674 4 VERSION="1.02.1"
erjo@3674 5 CATEGORY="network"
erjo@3674 6 SHORT_DESC="Iventory and package deployment system"
erjo@3674 7 MAINTAINER="pascal.bellard@slitaz.org"
erjo@3674 8 DEPENDS="apache php-apache mysql perl perl-xml-simple perl-compress-raw-zlib
erjo@3674 9 perl-dbi perl-dbd-mysql perl-apache-dbi perl-net-ip perl-soap-lite
erjo@3674 10 perl-xml-parser perl-xml-sax-writer apache-mod-perl"
erjo@3674 11 SOURCE="OCSNG_UNIX_SERVER"
erjo@3674 12 TARBALL="${SOURCE}_${VERSION}.tar.gz"
erjo@3674 13 WEB_SITE="http://www.ocsinventory-ng.org/index.php?page=English"
erjo@3674 14 WANTED="ocsinventory"
erjo@3674 15
erjo@3674 16 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@3674 17 genpkg_rules()
erjo@3674 18 {
erjo@3674 19 src=$WOK/$WANTED/$SOURCE-$VERSION
erjo@3674 20 _pkg=$WOK/$WANTED/$SOURCE-$VERSION/_pkg
erjo@3674 21
erjo@3674 22 mkdir -p $fs/usr
erjo@3674 23 cp -a $_pkg/usr/lib $fs/usr
erjo@3674 24
erjo@3674 25 install -o www -g www -m 0775 -d $fs/var/log/ocsinventory-server
erjo@3674 26 install -o root -g www -m 0775 -d $fs/var/lib/ocsinventory-server/ipd
erjo@3674 27 install -o root -g www -m 0775 -d $fs/var/lib/ocsinventory-server/download
erjo@3674 28
erjo@3674 29 mkdir -p $fs/etc/logrotate.d
erjo@3674 30 cp -f $src/Apache/etc/logrotate.d/ocsinventory-server \
erjo@3674 31 $fs/etc/logrotate.d/ocsinventory-server
erjo@3674 32 sed -i "s#PATH_TO_LOG_DIRECTORY#/var/log/ocsinventory-server#g" \
erjo@3674 33 $fs/etc/logrotate.d/ocsinventory-server
erjo@3674 34
erjo@3674 35 mkdir -p $fs/etc/apache/conf.d
erjo@3674 36 cp $src/Apache/etc/ocsinventory/ocsinventory-server.conf \
erjo@3674 37 $fs/etc/apache/conf.d/ocsinventory-server.conf
erjo@3674 38 sed -i -e "s#DATABASE_SERVER#localhost#g" \
erjo@3674 39 -e "s#DATABASE_PORT#3306#g" \
erjo@3674 40 -e "s#VERSION_MP#2#g" \
erjo@3674 41 -e "s#PATH_TO_LOG_DIRECTORY#/var/log/ocsinventory-server#g" \
erjo@3674 42 $fs/etc/apache/conf.d/ocsinventory-server.conf
erjo@3674 43
erjo@3674 44 if ! grep -q mod_perl.so $fs/etc/apache/conf.d/ocsinventory-server.conf;
erjo@3674 45 then
erjo@3674 46 cat > $fs/etc/apache/conf.d/ocsinventory-server.tmp <<EOT
erjo@3674 47 <IfModule !mod_perl.c>
erjo@3674 48 loadmodule perl_module share/apache/modules/mod_perl.so
erjo@3674 49 </IfModule>
erjo@3674 50
erjo@3674 51 $(cat $fs/etc/apache/conf.d/ocsinventory-server.conf)
erjo@3674 52 EOT
erjo@3674 53 mv $fs/etc/apache/conf.d/ocsinventory-server.tmp \
erjo@3674 54 $fs/etc/apache/conf.d/ocsinventory-server
erjo@3674 55 [ -f $fs/etc/apache/conf.d/ocsinventory-server.conf ] && \
erjo@3674 56 rm -f $fs/etc/apache/conf.d/ocsinventory-server.conf
erjo@3674 57 fi
erjo@3674 58 }
erjo@3674 59
erjo@3674 60 post_install()
erjo@3674 61 {
erjo@3674 62 if [ -z $1 ]; then
erjo@3674 63 echo "Now you can connect to http://$(hostname)/ocsreports"
erjo@3674 64 # Restart Apache if is running
erjo@3674 65 [ -f /var/run/apache/httpd.pid ] && /etc/init.d/apache reload
erjo@3674 66 fi
erjo@3674 67 }
erjo@3674 68
erjo@3674 69