# HG changeset patch # User Hans-G?nter Theisgen # Date 1582202916 -3600 # Node ID 3cc12822b466e7e9ed7057b2950230862fac46fd # Parent a540ef638b811e7bac0772adac4a31805e506c4b updated glpi (9.4.0 -> 9.4.5) diff -r a540ef638b81 -r 3cc12822b466 glpi/receipt --- a/glpi/receipt Thu Feb 20 13:34:48 2020 +0100 +++ b/glpi/receipt Thu Feb 20 13:48:36 2020 +0100 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="glpi" -VERSION="9.4.0" +VERSION="9.4.5" CATEGORY="network" SHORT_DESC="IT and Asset Management." MAINTAINER="erjo@slitaz.org" @@ -11,33 +11,36 @@ TARBALL="$PACKAGE-$VERSION.tgz" WGET_URL="https://github.com/glpi-project/$PACKAGE/releases/download/$VERSION/$TARBALL" -DEPENDS="mysql apache php-apache php-ldap php-imap php-mysql pam logrotate" +DEPENDS="apache logrotate mysql pam php-apache php-imap php-ldap php-mysql" BUILD_DEPENDS="" CONFIG_FILES="/etc/glpi/config_db.php" # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - mkdir -p $fs/usr/share/$PACKAGE \ - $fs/etc/$PACKAGE \ - $fs/var/log/$PACKAGE \ - $fs/var/lib/$PACKAGE - - cp -a $src/* $fs/usr/share/$PACKAGE - [ -d $fs/usr/share/$PACKAGE/files ] && mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE + mkdir -p $fs/usr/share/$PACKAGE + mkdir -p $fs/etc/$PACKAGE + mkdir -p $fs/var/log/$PACKAGE + mkdir -p $fs/var/lib/$PACKAGE - # Copy config db as temporary file. - cp $stuff/config_db.php $fs/etc/glpi/ - cp -a $stuff/logrotate.d $fs/etc - + cp -a $src/* $fs/usr/share/$PACKAGE + [ -d $fs/usr/share/$PACKAGE/files ] && + mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE + + # Copy configuration db as temporary file. + cp $stuff/config_db.php $fs/etc/glpi/ + cp -a $stuff/logrotate.d $fs/etc + cd $fs/usr/share/glpi [ -f config/config_db.php ] && rm -f config/config_db.php [ -f config/config_db_slave.php ] && rm -f config/config_db_slave.php ln -s /etc/glpi/config_db.php config/ - [ -f $fs/etc/glpi/config_db_slave.php ] && ln -s /etc/glpi/config_db_slave.php config/ + [ -f $fs/etc/glpi/config_db_slave.php ] && + ln -s /etc/glpi/config_db_slave.php config/ ln -s /var/lib/glpi/files cd - - chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/* + chown -R www.www $fs/var/lib/$PACKAGE/files \ + $fs/etc/$PACKAGE/* # Create the magic file config_path.php cat < $fs/usr/share/glpi/config/config_path.php @@ -63,8 +66,10 @@ post_install() { # Configure apache server - if [ -f "$1/etc/apache/httpd.conf" ]; then - if [ ! -f "$1/etc/apache/conf.d/glpi" ]; then + if [ -f "$1/etc/apache/httpd.conf" ] + then + if [ ! -f "$1/etc/apache/conf.d/glpi" ] + then cat > "$1/etc/apache/conf.d/glpi" < Alias /glpi /usr/share/glpi/ @@ -101,22 +106,27 @@ EOT - if [ -z "$1" ]; then + if [ -z "$1" ] + then # Start Web server. test -f /var/run/apache/httpd.pid && \ - ( kill -0 $(cat /var/run/apache/httpd.pid) && /etc/init.d/apache restart ) + ( kill -0 $(cat /var/run/apache/httpd.pid) && \ + /etc/init.d/apache restart ) fi fi fi # Configure every thing for glpi. - if [ -z "$1" ]; then - if ( ! mysqladmin -s ping > /dev/null ); then + if [ -z "$1" ] + then + if ( ! mysqladmin -s ping > /dev/null ) + then echo "Starting MySQL server" ( /etc/init.d/mysql start ; status ) || exit sleep 4 #let the mysql daemon start fi - if ( ! mysql -u root -Be 'show databases' | grep -q glpi ); then + if ( ! mysql -u root -Be 'show databases' | grep -q glpi ) + then echo -n "Create Glpi database" mysql -Be "create database glpi" ; status # We suppose that glpi user does not exist. @@ -143,7 +153,8 @@ y|Y) echo -n "Removing data directories..." rm -rf /var/lib/glpi ; status - if ( mysql -u root -Be 'show databases' | grep -q glpi ); then + if ( mysql -u root -Be 'show databases' | grep -q glpi ) + then echo -n "Deleting Glpi database" mysql -Be "drop database glpi" ; status # We suppose that glpi user does not exist. @@ -156,5 +167,4 @@ *) ;; esac - }