wok-next view glpi/receipt @ rev 20514

ardour, gdal, icu, js, jsoncpp, libvpx, llvm, mesa, minetest, opencv, qt5, scilab, webkit2gtk, webkitgtk, xalan-c: remove std.patch, use `fix math`.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Mar 21 16:15:19 2018 +0200 (2018-03-21)
parents 9e01bc6321ea
children d5aab818505e
line source
1 # SliTaz package receipt.
3 PACKAGE="glpi"
4 VERSION="0.80.7"
5 CATEGORY="network"
6 SHORT_DESC="IT and Asset Management."
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://glpi-project.org/"
11 WGET_URL="https://forge.indepnet.net/attachments/download/1054/$TARBALL"
12 CONFIG_FILES="/etc/glpi/config_db.php"
14 DEPENDS="mysql apache php-apache php-ldap php-imap php-mysql pam logrotate"
16 # Rules to gen a SliTaz package suitable for Tazpkg.
17 genpkg_rules()
18 {
19 mkdir -p $fs/usr/share/$PACKAGE \
20 $fs/etc/$PACKAGE \
21 $fs/var/log/$PACKAGE \
22 $fs/var/lib/$PACKAGE
24 cp -a $src/* $fs/usr/share/$PACKAGE
25 [ -d $fs/usr/share/$PACKAGE/files ] && mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE
27 # Copy config db as temporary file.
28 cp $stuff/config_db.php $fs/etc/glpi/
29 cp -a $stuff/logrotate.d $fs/etc
31 cd $fs/usr/share/glpi
32 [ -f config/config_db.php ] && rm -f config/config_db.php
33 [ -f config/config_db_slave.php ] && rm -f config/config_db_slave.php
34 ln -s /etc/glpi/config_db.php config/
35 [ -f $fs/etc/glpi/config_db_slave.php ] && ln -s /etc/glpi/config_db_slave.php config/
36 ln -s /var/lib/glpi/files
37 cd -
38 chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/*
40 # Create the magic file config_path.php
41 cat <<EOF> $fs/usr/share/glpi/config/config_path.php
42 <?php
43 // for packaging defaults
45 define("GLPI_CONFIG_DIR", "/etc/glpi");
47 define("GLPI_DOC_DIR", "/var/lib/glpi/files");
48 define("GLPI_DUMP_DIR", "/var/lib/glpi/files/_dumps");
49 define("GLPI_CACHE_DIR", "/var/lib/glpi/files/_cache/");
50 define("GLPI_CRON_DIR", "/var/lib/glpi/files/_cron");
51 define("GLPI_SESSION_DIR", "/var/lib/glpi/files/_sessions");
52 define("GLPI_PLUGIN_DOC_DIR", "/var/lib/glpi/files/_plugins");
53 define("GLPI_LOCK_DIR", "/var/lib/glpi/files/_lock/");
55 define("GLPI_LOG_DIR", "/var/log/glpi");
56 ?>
58 EOF
59 }
61 post_install()
62 {
63 # Configure apache server
64 if [ -f "$1/etc/apache/httpd.conf" ]; then
65 if [ ! -f "$1/etc/apache/conf.d/glpi" ]; then
66 cat > "$1/etc/apache/conf.d/glpi" <<EOT
67 <IfModule mod_alias.c>
68 Alias /glpi /usr/share/glpi/
69 </IfModule>
70 <Directory "/usr/share/glpi">
71 Options Indexes FollowSymLinks
73 php_value memory_limit 64M
75 AllowOverride None
76 Order deny,allow
77 Allow from all
78 </Directory>
80 <Directory /usr/share/glpi/config>
81 Order Allow,Deny
82 Deny from all
83 </Directory>
85 <Directory /usr/share/glpi/locales>
86 Order Allow,Deny
87 Deny from all
88 </Directory>
90 <Directory /usr/share/glpi/install/mysql>
91 Order Allow,Deny
92 Deny from all
93 </Directory>
95 <Directory /usr/share/glpi/scripts>
96 Order Allow,Deny
97 Deny from all
98 </Directory>
101 EOT
102 if [ -z "$1" ]; then
103 # Start Web server.
104 test -f /var/run/apache/httpd.pid && \
105 ( kill -0 $(cat /var/run/apache/httpd.pid) && /etc/init.d/apache restart )
106 fi
107 fi
108 fi
110 # Configure every thing for glpi.
111 if [ -z "$1" ]; then
112 if ( ! mysqladmin -s ping > /dev/null ); then
113 echo "Starting MySQL server"
114 ( /etc/init.d/mysql start ; status ) || exit
115 sleep 4 #let the mysql daemon start
116 fi
117 if ( ! mysql -u root -Be 'show databases' | grep -q glpi ); then
118 echo -n "Create Glpi database"
119 mysql -Be "create database glpi" ; status
120 # We suppose that glpi user does not exist.
121 # It may be false.
122 echo -n "Create user glpi with password glpi"
123 mysql -Be "grant all privileges on glpi.* to 'glpi'@'localhost'
124 identified by 'glpi'" ; status
125 # At last create the database for glpi.
126 echo -n "Create glpi database schema."
127 mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-0.80.3-empty.sql ; status
129 fi
131 fi
132 true
133 }
135 post_remove()
136 {
137 echo -n "Would you like to remove data and database files.(y/n) "
138 read answer
140 case $answer in
141 y|Y)
142 echo -n "Removing data directories..."
143 rm -rf /var/lib/glpi ; status
144 if ( mysql -u root -Be 'show databases' | grep -q glpi ); then
145 echo -n "Deleting Glpi database"
146 mysql -Be "drop database glpi" ; status
147 # We suppose that glpi user does not exist.
148 # It may be false.
149 echo -n "Delete user glpi"
150 mysql -Be "delete from mysql.db where user='glpi'" ; status
151 fi
152 unset $answer
153 ;;
154 *)
155 ;;
156 esac
158 }