wok view phpmyadmin/receipt @ rev 16905

Add pangox-compat
author Yuri Pourre <yuripourre@gmail.com>
date Tue Jul 15 19:21:23 2014 -0300 (2014-07-15)
parents 1019443a6c35
children 9e01bc6321ea
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 LICENSE="GPL2"
9 PHPMYADM="phpMyAdmin-$VERSION-all-languages"
10 TARBALL="$PHPMYADM.tar.bz2"
11 WEB_SITE="http://www.phpmyadmin.net/"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
13 SUGGESTED="php-mcrypt"
14 CONFIG_FILES="/etc/phpmyadmin/config.inc.php"
15 HOST_ARCH="any"
17 DEPENDS="php-mysqli"
19 # Rules to gen a SliTaz package suitable for Tazpkg.
20 genpkg_rules()
21 {
22 mkdir -p $fs/usr/share/phpmyadmin $fs/etc/phpmyadmin $fs/usr/share/applications
23 cp -a $src/. $fs/usr/share/phpmyadmin
24 ln -s /etc/phpmyadmin/config.inc.php $fs/usr/share/phpmyadmin/config.inc.php
25 cp $src/config.sample.inc.php $fs/etc/phpmyadmin/config.inc.php
26 rm -f $fs/usr/share/phpmyadmin/phpMyAdmin-$VERSION-all-languages
27 cp $stuff/phpmyadmin.desktop $fs/usr/share/applications
28 chown -R www.www $fs/usr/share/phpmyadmin $fs/etc/phpmyadmin
29 chmod 700 $fs/etc/phpmyadmin
30 chmod 644 $fs/etc/phpmyadmin/config.inc.php
32 sed -i s'/\?>//' $fs/etc/phpmyadmin/config.inc.php
34 cat <<"EOT">> $fs/etc/phpmyadmin/config.inc.php
36 $cfg['McryptDisableWarning'] = true;
37 // For public use you may comment the following lines
38 // to enforce the security.
39 $cfg['Servers'][$i]['AllowNoPassword'] = true;
40 $cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
41 $cfg['Servers'][$i]['AllowRoot'] = true;
42 ?>
43 EOT
44 }
46 post_install()
47 {
48 secret=$(dd if=/dev/urandom count=1 2> /dev/null | md5sum | sed 's/ .*//')
49 sed -i "s/^\(.*blowfish_secret'] = '\)'/\1$secret'/" \
50 $1/etc/phpmyadmin/config.inc.php
51 # Configure lighttpd server
52 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
53 if ! grep -q /usr/share/phpmyadmin/ $1/etc/lighttpd/lighttpd.conf; then
54 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpmyadmin/" => "/usr/share/phpmyadmin/",|g' -i $1/etc/lighttpd/lighttpd.conf
55 if [ -z "$1" ]; then
56 # Start Web server.
57 /etc/init.d/lighttpd stop
58 /etc/init.d/lighttpd start
59 fi
60 fi
61 fi
62 # Configure apache server
63 if [ -f $1/etc/apache/httpd.conf ]; then
64 if [ ! -f $1/etc/apache/conf.d/phpmyadmin ]; then
65 cat > $1/etc/apache/conf.d/phpmyadmin <<EOT
66 <IfModule mod_alias.c>
67 Alias /phpmyadmin /usr/share/phpmyadmin
68 </IfModule>
69 <Directory /usr/share/phpmyadmin/>
70 DirectoryIndex index.php
71 Options +FollowSymLinks
72 AllowOverride None
73 Order allow,deny
74 Allow from all
75 </Directory>
76 EOT
77 if [ -z "$1" ]; then
78 # Start Web server.
79 /etc/init.d/apache stop
80 /etc/init.d/apache start
81 fi
82 fi
83 fi
84 }