wok-next rev 21687

updated glpi (0.80.7 -> 9.4.6)
author Hans-G?nter Theisgen
date Mon Jun 29 17:11:21 2020 +0100 (2020-06-29)
parents ec9fd404de11
children 375bb1aabefe
files glpi/receipt
line diff
     1.1 --- a/glpi/receipt	Mon Jun 29 16:57:49 2020 +0100
     1.2 +++ b/glpi/receipt	Mon Jun 29 17:11:21 2020 +0100
     1.3 @@ -1,37 +1,41 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="glpi"
     1.8 -VERSION="0.80.7"
     1.9 +VERSION="9.4.6"
    1.10  CATEGORY="network"
    1.11  SHORT_DESC="IT and Asset Management"
    1.12 -MAINTAINER="devel@slitaz.org"
    1.13 +MAINTAINER="maintainer@slitaz.org"
    1.14  LICENSE="GPL2"
    1.15 -WEB_SITE="http://glpi-project.org/"
    1.16 +WEB_SITE="https://glpi-project.org/"
    1.17  
    1.18 -TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.19 -WGET_URL="https://forge.indepnet.net/attachments/download/1054/$TARBALL"
    1.20 +TARBALL="$PACKAGE-$VERSION.tgz"
    1.21 +WGET_URL="https://github.com/glpi-project/$PACKAGE/releases/download/$VERSION/$TARBALL"
    1.22  
    1.23 -genpkg_rules() {
    1.24 +genpkg_rules()
    1.25 +{
    1.26  	mkdir -p $fs/usr/share/$PACKAGE \
    1.27  		$fs/etc/$PACKAGE \
    1.28  		$fs/var/log/$PACKAGE \
    1.29  		$fs/var/lib/$PACKAGE
    1.30  
    1.31 -	cp -a $src/* $fs/usr/share/$PACKAGE
    1.32 -	[ -d $fs/usr/share/$PACKAGE/files ] &&  mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE
    1.33 +	cp -a $src/*	$fs/usr/share/$PACKAGE
    1.34 +	[ -d $fs/usr/share/$PACKAGE/files ] &&
    1.35 +	mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE
    1.36  
    1.37 -	# Copy config db as temporary file.
    1.38 -	cp $stuff/config_db.php $fs/etc/glpi/
    1.39 -	cp -a $stuff/logrotate.d $fs/etc
    1.40 +	# Copy configuration db as temporary file.
    1.41 +	cp $stuff/config_db.php		$fs/etc/glpi/
    1.42 +	cp -a $stuff/logrotate.d	$fs/etc
    1.43  
    1.44  	cd $fs/usr/share/glpi
    1.45  	[ -f config/config_db.php ] && rm -f config/config_db.php
    1.46  	[ -f config/config_db_slave.php ] && rm -f config/config_db_slave.php
    1.47 +
    1.48  	ln -s /etc/glpi/config_db.php config/
    1.49  	[ -f $fs/etc/glpi/config_db_slave.php ] && ln -s /etc/glpi/config_db_slave.php config/
    1.50  	ln -s /var/lib/glpi/files
    1.51  	cd -
    1.52 -	chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/*
    1.53 +	chown -R www.www		$fs/var/lib/$PACKAGE/files
    1.54 +	chown -R www.www		$fs/etc/$PACKAGE/*
    1.55  
    1.56  	# Create the magic file config_path.php
    1.57  	cat > $fs/usr/share/glpi/config/config_path.php <<EOF
    1.58 @@ -52,14 +56,17 @@
    1.59  ?>
    1.60  
    1.61  EOF
    1.62 -	DEPENDS="mysql apache php-apache php-ldap php-imap php-mysql pam logrotate"
    1.63 +	DEPENDS="apache logrotate mysql pam php-apache php-imap php-ldap php-mysql"
    1.64  	CONFIG_FILES="/etc/glpi/config_db.php"
    1.65  }
    1.66  
    1.67 -post_install() {
    1.68 +post_install()
    1.69 +{
    1.70  	# Configure apache server
    1.71 -	if [ -f "$1/etc/apache/httpd.conf" ]; then
    1.72 -		if [ ! -f "$1/etc/apache/conf.d/glpi" ]; then
    1.73 +	if [ -f "$1/etc/apache/httpd.conf" ]
    1.74 +	  then
    1.75 +		if [ ! -f "$1/etc/apache/conf.d/glpi" ]
    1.76 +		  then
    1.77  			cat > "$1/etc/apache/conf.d/glpi" <<EOT
    1.78  <IfModule mod_alias.c>
    1.79      Alias /glpi /usr/share/glpi/
    1.80 @@ -96,9 +103,11 @@
    1.81  
    1.82  
    1.83  EOT
    1.84 -			if [ -z "$1" ]; then
    1.85 +			if [ -z "$1" ]
    1.86 +			  then
    1.87  				# Start Web server.
    1.88 -				if [ -f /var/run/apache/httpd.pid ]; then
    1.89 +				if [ -f /var/run/apache/httpd.pid ]
    1.90 +				  then
    1.91  					kill -0 $(cat /var/run/apache/httpd.pid) &&
    1.92  					/etc/init.d/apache restart
    1.93  				fi
    1.94 @@ -107,14 +116,17 @@
    1.95  	fi
    1.96  
    1.97  	# Configure every thing for glpi.
    1.98 -	if [ -z "$1" ]; then
    1.99 -		if ( ! mysqladmin -s ping > /dev/null ); then
   1.100 +	if [ -z "$1" ]
   1.101 +	  then
   1.102 +		if ( ! mysqladmin -s ping > /dev/null )
   1.103 +		  then
   1.104  			echo "Starting MySQL server"
   1.105  			( /etc/init.d/mysql start; status  ) || exit
   1.106  			sleep 4 #let the mysql daemon start
   1.107  		fi
   1.108  
   1.109 -		if ( ! mysql -u root -Be 'show databases' | grep -q glpi ); then
   1.110 +		if ( ! mysql -u root -Be 'show databases' | grep -q glpi )
   1.111 +		  then
   1.112  			action "Create Glpi database"
   1.113  			mysql -Be "create database glpi"
   1.114  			status
   1.115 @@ -135,7 +147,8 @@
   1.116  	true
   1.117  }
   1.118  
   1.119 -post_remove() {
   1.120 +post_remove()
   1.121 +{
   1.122  	echo -n "Would you like to remove data and database files.(y/n) "
   1.123  	read answer
   1.124  
   1.125 @@ -145,7 +158,8 @@
   1.126  			rm -rf /var/lib/glpi
   1.127  			status
   1.128  
   1.129 -			if ( mysql -u root -Be 'show databases' | grep -q glpi ); then
   1.130 +			if ( mysql -u root -Be 'show databases' | grep -q glpi )
   1.131 +			  then
   1.132  				action "Deleting Glpi database"
   1.133  				mysql -Be "drop database glpi"
   1.134  				 status