wok rev 22855

updated glpi (9.4.0 -> 9.4.5)
author Hans-G?nter Theisgen
date Thu Feb 20 13:48:36 2020 +0100 (23 months ago)
parents a540ef638b81
children 2622a9066658
files glpi/receipt
line diff
     1.1 --- a/glpi/receipt	Thu Feb 20 13:34:48 2020 +0100
     1.2 +++ b/glpi/receipt	Thu Feb 20 13:48:36 2020 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="glpi"
     1.7 -VERSION="9.4.0"
     1.8 +VERSION="9.4.5"
     1.9  CATEGORY="network"
    1.10  SHORT_DESC="IT and Asset Management."
    1.11  MAINTAINER="erjo@slitaz.org"
    1.12 @@ -11,33 +11,36 @@
    1.13  TARBALL="$PACKAGE-$VERSION.tgz"
    1.14  WGET_URL="https://github.com/glpi-project/$PACKAGE/releases/download/$VERSION/$TARBALL"
    1.15  
    1.16 -DEPENDS="mysql apache php-apache php-ldap php-imap php-mysql pam logrotate"
    1.17 +DEPENDS="apache logrotate mysql pam php-apache php-imap php-ldap php-mysql"
    1.18  BUILD_DEPENDS=""
    1.19  CONFIG_FILES="/etc/glpi/config_db.php"
    1.20  
    1.21  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.22  genpkg_rules()
    1.23  {
    1.24 -	mkdir -p $fs/usr/share/$PACKAGE \
    1.25 -		$fs/etc/$PACKAGE \
    1.26 -		$fs/var/log/$PACKAGE \
    1.27 -		$fs/var/lib/$PACKAGE
    1.28 -		 
    1.29 -	cp -a $src/* $fs/usr/share/$PACKAGE
    1.30 -	[ -d $fs/usr/share/$PACKAGE/files ] &&  mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE
    1.31 +	mkdir -p $fs/usr/share/$PACKAGE
    1.32 +	mkdir -p $fs/etc/$PACKAGE
    1.33 +	mkdir -p $fs/var/log/$PACKAGE
    1.34 +	mkdir -p $fs/var/lib/$PACKAGE
    1.35  
    1.36 -	# Copy config db as temporary file.
    1.37 -	cp $stuff/config_db.php $fs/etc/glpi/
    1.38 -	cp -a $stuff/logrotate.d $fs/etc
    1.39 -	
    1.40 +	cp -a $src/*	$fs/usr/share/$PACKAGE
    1.41 +	[ -d $fs/usr/share/$PACKAGE/files ] &&
    1.42 +	mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE
    1.43 +
    1.44 +	# Copy configuration db as temporary file.
    1.45 +	cp $stuff/config_db.php		$fs/etc/glpi/
    1.46 +	cp -a $stuff/logrotate.d	$fs/etc
    1.47 +
    1.48  	cd $fs/usr/share/glpi
    1.49  	[ -f config/config_db.php ] && rm -f config/config_db.php
    1.50  	[ -f config/config_db_slave.php ] && rm -f config/config_db_slave.php
    1.51  	ln -s /etc/glpi/config_db.php config/
    1.52 -	[ -f $fs/etc/glpi/config_db_slave.php ] && ln -s /etc/glpi/config_db_slave.php config/
    1.53 +	[ -f $fs/etc/glpi/config_db_slave.php ] &&
    1.54 +	ln -s /etc/glpi/config_db_slave.php config/
    1.55  	ln -s /var/lib/glpi/files
    1.56  	cd -
    1.57 -	chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/*
    1.58 +	chown -R www.www	$fs/var/lib/$PACKAGE/files \
    1.59 +				$fs/etc/$PACKAGE/*
    1.60  
    1.61  	# Create the magic file config_path.php
    1.62  	cat <<EOF> $fs/usr/share/glpi/config/config_path.php
    1.63 @@ -63,8 +66,10 @@
    1.64  post_install()
    1.65  {
    1.66  	# Configure apache server
    1.67 -	if [ -f "$1/etc/apache/httpd.conf" ]; then
    1.68 -		if [ ! -f "$1/etc/apache/conf.d/glpi" ]; then
    1.69 +	if [ -f "$1/etc/apache/httpd.conf" ]
    1.70 +	  then
    1.71 +		if [ ! -f "$1/etc/apache/conf.d/glpi" ]
    1.72 +		  then
    1.73  			cat > "$1/etc/apache/conf.d/glpi" <<EOT
    1.74  <IfModule mod_alias.c>
    1.75      Alias /glpi /usr/share/glpi/
    1.76 @@ -101,22 +106,27 @@
    1.77  
    1.78  
    1.79  EOT
    1.80 -			if [ -z "$1" ]; then
    1.81 +			if [ -z "$1" ]
    1.82 +			  then
    1.83  				# Start Web server.
    1.84  				test -f /var/run/apache/httpd.pid && \
    1.85 -					( kill -0 $(cat /var/run/apache/httpd.pid) && /etc/init.d/apache restart )
    1.86 +					( kill -0 $(cat /var/run/apache/httpd.pid) && \
    1.87 +					/etc/init.d/apache restart )
    1.88  			fi
    1.89  		fi
    1.90  	fi
    1.91  
    1.92  	# Configure every thing for glpi.
    1.93 -	if [ -z "$1" ]; then
    1.94 -		if ( ! mysqladmin -s ping > /dev/null ); then
    1.95 +	if [ -z "$1" ]
    1.96 +	  then
    1.97 +		if ( ! mysqladmin -s ping > /dev/null )
    1.98 +		  then
    1.99  			echo "Starting MySQL server"
   1.100  			( /etc/init.d/mysql start ; status  ) || exit 
   1.101  			sleep 4 #let the mysql daemon start
   1.102  		fi
   1.103 -		if ( ! mysql -u root -Be 'show databases' | grep -q glpi ); then
   1.104 +		if ( ! mysql -u root -Be 'show databases' | grep -q glpi )
   1.105 +		  then
   1.106  			echo -n "Create Glpi database"
   1.107  			mysql -Be "create database glpi" ; status
   1.108  			# We suppose that glpi user does not exist.
   1.109 @@ -143,7 +153,8 @@
   1.110  		y|Y)
   1.111  			echo -n "Removing data directories..."
   1.112  			rm -rf /var/lib/glpi ; status
   1.113 -			if ( mysql -u root -Be 'show databases' | grep -q glpi ); then
   1.114 +			if ( mysql -u root -Be 'show databases' | grep -q glpi )
   1.115 +			  then
   1.116  				echo -n "Deleting Glpi database"
   1.117  				mysql -Be "drop database glpi" ; status
   1.118  				# We suppose that glpi user does not exist.
   1.119 @@ -156,5 +167,4 @@
   1.120  		*)
   1.121  			;;
   1.122  		esac
   1.123 -	
   1.124  }