wok rev 2715

glpi: move apache conf to post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Apr 23 16:59:05 2009 +0200 (2009-04-23)
parents e08653819ea5
children 1eec1672606e
files glpi/receipt
line diff
     1.1 --- a/glpi/receipt	Thu Apr 23 16:13:34 2009 +0200
     1.2 +++ b/glpi/receipt	Thu Apr 23 16:59:05 2009 +0200
     1.3 @@ -1,7 +1,5 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6 -PACKED_SIZE="2.0M"
     1.7 -UNPACKED_SIZE="11.5M"
     1.8  PACKAGE="glpi"
     1.9  VERSION="0.71.5"
    1.10  CATEGORY="network"
    1.11 @@ -13,8 +11,6 @@
    1.12  WGET_URL="http://glpi-project.org/IMG/gz/$TARBALL"
    1.13  CONFIG_FILES="/etc/glpi/config/config_db.php"
    1.14  
    1.15 -
    1.16 -
    1.17  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.18  genpkg_rules()
    1.19  {
    1.20 @@ -36,6 +32,21 @@
    1.21  	chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/config
    1.22  	# Copy config db as temporary file.
    1.23  	cp stuff/config_db.php $fs/etc/glpi/config/
    1.24 +}
    1.25 +
    1.26 +post_install()
    1.27 +{
    1.28 +	# Configure lighttpd server
    1.29 +	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    1.30 +		if ! grep -q /usr/share/glpi/ $1/etc/lighttpd/lighttpd.conf; then
    1.31 +	    		sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/glpi/" => "/usr/share/glpi/",|g' -i $1/etc/lighttpd/lighttpd.conf
    1.32 +			if [ -z "$1" ]; then
    1.33 +				# Start Web server.
    1.34 +				/etc/init.d/lighttpd stop
    1.35 +				/etc/init.d/lighttpd start
    1.36 +			fi
    1.37 +		fi
    1.38 +	fi
    1.39  	# Configure apache server
    1.40  	if [ -f $1/etc/apache/httpd.conf ]; then
    1.41  		if [ ! -f $1/etc/apache/conf.d/glpi ]; then
    1.42 @@ -58,10 +69,7 @@
    1.43  			fi
    1.44  		fi
    1.45  	fi
    1.46 -}
    1.47  
    1.48 -post_install()
    1.49 -{
    1.50  	# Configure every thing for glpi.
    1.51  	if [ -z $1 ]; then
    1.52  		if ( ! mysqladmin -s ping > /dev/null ); then