wok view glpi/receipt @ rev 8751

Removed all/most _pkg= lines in wok. The new tazwok-experimental can SOURCE paths and source are are all extracted to WOK/PACKAGE/PACKAGE-VERSION now with tazwok-experimental.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Feb 20 06:53:59 2011 +0000 (2011-02-20)
parents 9dde2e58512f
children 012847ddd0cb
line source
1 # SliTaz package receipt.
3 PACKAGE="glpi"
4 VERSION="0.78.2"
5 CATEGORY="network"
6 SHORT_DESC="IT and Asset Management."
7 MAINTAINER="erjo@slitaz.org"
8 DEPENDS="mysql apache php-apache php-ldap php-imap php-mysql pam logrotate"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://glpi-project.org/"
11 WGET_URL="https://forge.indepnet.net/attachments/download/772/$TARBALL"
12 CONFIG_FILES="/etc/glpi/config_db.php"
14 # Rules to gen a SliTaz package suitable for Tazpkg.
15 genpkg_rules()
16 {
17 mkdir -p $fs/usr/share/$PACKAGE \
18 $fs/etc/$PACKAGE \
19 $fs/var/log/$PACKAGE \
20 $fs/var/lib/$PACKAGE
22 cp -a $src/* $fs/usr/share/$PACKAGE
23 [ -d $fs/usr/share/$PACKAGE/files ] && mv $fs/usr/share/$PACKAGE/files $fs/var/lib/$PACKAGE
25 # Copy config db as temporary file.
26 cp stuff/config_db.php $fs/etc/glpi/
27 cp -a stuff/logrotate.d $fs/etc
29 cd $fs/usr/share/glpi
30 [ -f config/config_db.php ] && rm -f config/config_db.php
31 [ -f config/config_db_slave.php ] && rm -f config/config_db_slave.php
32 ln -s /etc/glpi/config_db.php config/
33 [ -f $fs/etc/glpi/config_db_slave.php ] && ln -s /etc/glpi/config_db_slave.php config/
34 ln -s /var/lib/glpi/files
35 cd -
36 chown -R www.www $fs/var/lib/$PACKAGE/files $fs/etc/$PACKAGE/*
38 # Create the magic file config_path.php
39 cat <<EOF> $fs/usr/share/glpi/config/config_path.php
40 <?php
41 // for packaging defaults
43 define("GLPI_CONFIG_DIR", "/etc/glpi");
45 define("GLPI_DOC_DIR", "/var/lib/glpi/files");
46 define("GLPI_DUMP_DIR", "/var/lib/glpi/files/_dumps");
47 define("GLPI_CACHE_DIR", "/var/lib/glpi/files/_cache/");
48 define("GLPI_CRON_DIR", "/var/lib/glpi/files/_cron");
49 define("GLPI_SESSION_DIR", "/var/lib/glpi/files/_sessions");
50 define("GLPI_PLUGIN_DOC_DIR", "/var/lib/glpi/files/_plugins");
51 define("GLPI_LOCK_DIR", "/var/lib/glpi/files/_lock/");
53 define("GLPI_LOG_DIR", "/var/log/glpi");
54 ?>
56 EOF
57 }
59 post_install()
60 {
61 # Configure apache server
62 if [ -f $1/etc/apache/httpd.conf ]; then
63 if [ ! -f $1/etc/apache/conf.d/glpi ]; then
64 cat > $1/etc/apache/conf.d/glpi <<EOT
65 <IfModule mod_alias.c>
66 Alias /glpi /usr/share/glpi/
67 </IfModule>
68 <Directory "/usr/share/glpi">
69 Options Indexes FollowSymLinks
71 php_value memory_limit 64M
73 AllowOverride None
74 Order deny,allow
75 Allow from all
76 </Directory>
78 <Directory /usr/share/glpi/config>
79 Order Allow,Deny
80 Deny from all
81 </Directory>
83 <Directory /usr/share/glpi/locales>
84 Order Allow,Deny
85 Deny from all
86 </Directory>
88 <Directory /usr/share/glpi/install/mysql>
89 Order Allow,Deny
90 Deny from all
91 </Directory>
93 <Directory /usr/share/glpi/scripts>
94 Order Allow,Deny
95 Deny from all
96 </Directory>
99 EOT
100 if [ -z "$1" ]; then
101 # Start Web server.
102 test -f /var/run/apache/httpd.pid && \
103 ( kill -0 $(cat /var/run/apache/httpd.pid) && /etc/init.d/apache restart )
104 fi
105 fi
106 fi
108 # Configure every thing for glpi.
109 if [ -z $1 ]; then
110 if ( ! mysqladmin -s ping > /dev/null ); then
111 echo "Starting MySQL server"
112 ( /etc/init.d/mysql start ; status ) || exit
113 sleep 4 #let the mysql daemon start
114 fi
115 if ( ! mysql -u root -Be 'show databases' | grep -q glpi ); then
116 echo -n "Create Glpi database"
117 mysql -Be "create database glpi" ; status
118 # We suppose that glpi user does not exist.
119 # It may be false.
120 echo -n "Create user glpi with password glpi"
121 mysql -Be "grant all privileges on glpi.* to 'glpi'@'localhost'
122 identified by 'glpi'" ; status
123 # At last create the database for glpi.
124 echo -n "Create glpi database schema."
125 mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-${VERSION}-empty.sql ; status
127 fi
129 fi
130 }
132 post_remove()
133 {
134 echo -n "Would you like to remove data and database files.(y/n) "
135 read answer
137 case $answer in
138 y|Y)
139 echo -n "Removing data directories..."
140 rm -rf /var/lib/glpi ; status
141 if ( mysql -u root -Be 'show databases' | grep -q glpi ); then
142 echo -n "Deleting Glpi database"
143 mysql -Be "drop database glpi" ; status
144 # We suppose that glpi user does not exist.
145 # It may be false.
146 echo -n "Delete user glpi"
147 mysql -Be "delete from mysql.db where user='glpi'" ; status
148 fi
149 unset $answer
150 ;;
151 *)
152 ;;
153 esac
155 }