wok-next rev 8353

up: glpi (0.78.2) + improve install
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Thu Feb 03 17:09:38 2011 +0100 (2011-02-03)
parents 60850363fb57
children c7a65207a239
files glpi/receipt glpi/stuff/logrotate.d/glpi
line diff
     1.1 --- a/glpi/receipt	Thu Feb 03 16:35:01 2011 +0100
     1.2 +++ b/glpi/receipt	Thu Feb 03 17:09:38 2011 +0100
     1.3 @@ -1,15 +1,15 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="glpi"
     1.7 -VERSION="0.72.3"
     1.8 +VERSION="0.78.2"
     1.9  CATEGORY="network"
    1.10  SHORT_DESC="IT and Asset Management."
    1.11  MAINTAINER="erjo@slitaz.org"
    1.12 -DEPENDS="mysql apache php-apache php-ldap php-imap php-mysql pam"
    1.13 +DEPENDS="mysql apache php-apache php-ldap php-imap php-mysql pam logrotate"
    1.14  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.15  WEB_SITE="http://glpi-project.org/"
    1.16 -WGET_URL="http://glpi-project.org/IMG/gz/$TARBALL"
    1.17 -CONFIG_FILES="/etc/glpi/config/config_db.php"
    1.18 +WGET_URL="https://forge.indepnet.net/attachments/download/772/$TARBALL"
    1.19 +CONFIG_FILES="/etc/glpi/config_db.php /etc/glpi/config_db_slave.php"
    1.20  
    1.21  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.22  genpkg_rules()
    1.23 @@ -20,18 +20,45 @@
    1.24  	
    1.25  	mkdir -p $fs/usr/share/$PACKAGE \
    1.26  		$fs/etc/$PACKAGE \
    1.27 +		$fs/var/log/$PACKAGE \
    1.28  		$fs/var/lib/$PACKAGE
    1.29  		 
    1.30  	cp -a $_pkg/* $fs/usr/share/$PACKAGE
    1.31  	[ -d $fs/usr/share/$PACKAGE/files ] &&  mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE
    1.32 -	[ -d $fs/usr/share/$PACKAGE/config ] &&  mv $fs/usr/share/$PACKAGE/config $fs/etc/$PACKAGE
    1.33 +	#[ -d $fs/usr/share/$PACKAGE/config ] &&  mv $fs/usr/share/$PACKAGE/config $fs/etc/$PACKAGE
    1.34  
    1.35 +	# Copy config db as temporary file.
    1.36 +	cp stuff/config_db.php $fs/etc/glpi/
    1.37 +	cp -a stuff/logrotate.d $fs/etc
    1.38 +	
    1.39  	cd $fs/usr/share/glpi
    1.40 -	ln -s /etc/glpi/config ; ln -s /var/lib/glpi/files
    1.41 +	[ -f config/config_db.php ] && rm -f config/config_db.php
    1.42 +	[ -f config/config_db_slave.php ] && rm -f config/config_db_slave.php
    1.43 +	ln -s /etc/glpi/config_db.php config/
    1.44 +	[ -f $fs/etc/glpi/config_db_slave.php ] && ln -s /etc/glpi/config_db_slave.php config/
    1.45 +	ln -s /var/lib/glpi/files
    1.46  	cd -
    1.47 -	chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/config
    1.48 -	# Copy config db as temporary file.
    1.49 -	cp stuff/config_db.php $fs/etc/glpi/config/
    1.50 +	chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/*
    1.51 +
    1.52 +	# Create the magic file config_path.php
    1.53 +	cat <<EOF> $fs/usr/share/glpi/config/config_path.php
    1.54 +<?php
    1.55 +// for packaging defaults
    1.56 +
    1.57 +define("GLPI_CONFIG_DIR",     "/etc/glpi");
    1.58 +
    1.59 +define("GLPI_DOC_DIR",        "/var/lib/glpi/files");
    1.60 +define("GLPI_DUMP_DIR",       "/var/lib/glpi/files/_dumps");
    1.61 +define("GLPI_CACHE_DIR",      "/var/lib/glpi/files/_cache/");
    1.62 +define("GLPI_CRON_DIR",       "/var/lib/glpi/files/_cron");
    1.63 +define("GLPI_SESSION_DIR",    "/var/lib/glpi/files/_sessions");
    1.64 +define("GLPI_PLUGIN_DOC_DIR", "/var/lib/glpi/files/_plugins");
    1.65 +define("GLPI_LOCK_DIR",       "/var/lib/glpi/files/_lock/");
    1.66 +
    1.67 +define("GLPI_LOG_DIR",        "/var/log/glpi");
    1.68 +?>
    1.69 +
    1.70 +EOF
    1.71  }
    1.72  
    1.73  post_install()
    1.74 @@ -45,11 +72,35 @@
    1.75  </IfModule>
    1.76  <Directory "/usr/share/glpi">
    1.77  	Options Indexes FollowSymLinks
    1.78 +
    1.79 +	php_value memory_limit 64M
    1.80 +
    1.81  	AllowOverride None
    1.82  	Order deny,allow
    1.83  	Allow from all
    1.84  </Directory>
    1.85  
    1.86 +<Directory /usr/share/glpi/config>
    1.87 +    Order Allow,Deny
    1.88 +    Deny from all
    1.89 +</Directory>
    1.90 +
    1.91 +<Directory /usr/share/glpi/locales>
    1.92 +    Order Allow,Deny
    1.93 +    Deny from all
    1.94 +</Directory>
    1.95 +
    1.96 +<Directory /usr/share/glpi/install/mysql>
    1.97 +    Order Allow,Deny
    1.98 +    Deny from all
    1.99 +</Directory>
   1.100 +
   1.101 +<Directory /usr/share/glpi/scripts>
   1.102 +    Order Allow,Deny
   1.103 +    Deny from all
   1.104 +</Directory>
   1.105 +
   1.106 +
   1.107  EOT
   1.108  			if [ -z "$1" ]; then
   1.109  				# Start Web server.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/glpi/stuff/logrotate.d/glpi	Thu Feb 03 17:09:38 2011 +0100
     2.3 @@ -0,0 +1,10 @@
     2.4 +# Rotate GLPI logs daily, only if not empty
     2.5 +# Save 14 days old logs under compressed mode
     2.6 +/var/log/glpi/*.log {
     2.7 +    daily
     2.8 +    rotate 14
     2.9 +    compress
    2.10 +    notifempty
    2.11 +    missingok
    2.12 +    create 644 apache apache
    2.13 +}