wok-6.x view phpmyadmin/receipt @ rev 15050
kino: fix genpkg_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 12 18:52:35 2013 +0000 (2013-08-12) |
parents | a283e7450161 |
children | 78cb1e930abd |
line source
1 # SliTaz package receipt.
3 PACKAGE="phpmyadmin"
4 VERSION="3.5.2"
5 CATEGORY="misc"
6 SHORT_DESC="Administration of MySQL over the Web."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 PHPMYADM="phpMyAdmin-$VERSION-all-languages"
9 TARBALL="$PHPMYADM.tar.bz2"
10 WEB_SITE="http://www.phpmyadmin.net/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 SUGGESTED="php-mcrypt"
13 DEPENDS="php-mysqli"
14 CONFIG_FILES="/etc/phpmyadmin/config.inc.php"
17 # Rules to gen a SliTaz package suitable for Tazpkg.
18 genpkg_rules()
19 {
20 mkdir -p $fs/usr/share/phpmyadmin $fs/etc/phpmyadmin $fs/usr/share/applications
21 cp -a $src/. $fs/usr/share/phpmyadmin
22 ln -s /etc/phpmyadmin/config.inc.php $fs/usr/share/phpmyadmin/config.inc.php
23 cp $src/config.sample.inc.php $fs/etc/phpmyadmin/config.inc.php
24 rm -f $fs/usr/share/phpmyadmin/phpMyAdmin-$VERSION-all-languages
25 cp $stuff/phpmyadmin.desktop $fs/usr/share/applications
26 chown -R www.www $fs/usr/share/phpmyadmin $fs/etc/phpmyadmin
27 chmod 700 $fs/etc/phpmyadmin
28 chmod 644 $fs/etc/phpmyadmin/config.inc.php
30 sed -i s'/\?>//' $fs/etc/phpmyadmin/config.inc.php
32 cat <<"EOT">> $fs/etc/phpmyadmin/config.inc.php
34 $cfg['McryptDisableWarning'] = true;
35 // For public use you may comment the following lines
36 // to enforce the security.
37 $cfg['Servers'][$i]['AllowNoPassword'] = true;
38 $cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
39 $cfg['Servers'][$i]['AllowRoot'] = true;
40 ?>
41 EOT
42 }
44 post_install()
45 {
46 # Configure lighttpd server
47 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
48 if ! grep -q /usr/share/phpmyadmin/ $1/etc/lighttpd/lighttpd.conf; then
49 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpmyadmin/" => "/usr/share/phpmyadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
50 if [ -z "$1" ]; then
51 # Start Web server.
52 /etc/init.d/lighttpd stop
53 /etc/init.d/lighttpd start
54 fi
55 fi
56 fi
57 # Configure apache server
58 if [ -f $1/etc/apache/httpd.conf ]; then
59 if [ ! -f $1/etc/apache/conf.d/phpmyadmin ]; then
60 cat > $1/etc/apache/conf.d/phpmyadmin <<EOT
61 <IfModule mod_alias.c>
62 Alias /phpmyadmin /usr/share/phpmyadmin
63 </IfModule>
64 <Directory /usr/share/phpmyadmin/>
65 DirectoryIndex index.php
66 Options +FollowSymLinks
67 AllowOverride None
68 Order allow,deny
69 Allow from all
70 </Directory>
71 EOT
72 if [ -z "$1" ]; then
73 # Start Web server.
74 /etc/init.d/apache stop
75 /etc/init.d/apache start
76 fi
77 fi
78 fi
79 }