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