wok-current view phpmyadmin/receipt @ rev 24538

updated fbcat (0.5.1 -> 0.5.2)
author Hans-G?nter Theisgen
date Wed Feb 23 15:14:49 2022 +0100 (2022-02-23)
parents 15650f5d595b
children eb2b710f40e2
line source
1 # SliTaz package receipt.
3 PACKAGE="phpmyadmin"
4 VERSION="5.0.4"
5 CATEGORY="misc"
6 SHORT_DESC="Administration of MySQL over the Web."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.phpmyadmin.net/"
11 SOURCE="phpMyAdmin"
12 TARBALL="$PACKAGE-$VERSION.tar.xz"
13 WGET_URL="https://files.phpmyadmin.net/$SOURCE/$VERSION/$SOURCE-$VERSION-all-languages.tar.xz"
15 DEPENDS="php-mysqli"
17 CONFIG_FILES="/etc/phpmyadmin/config.inc.php"
19 HOST_ARCH="any"
21 current_version()
22 {
23 wget -O - $WEB_SITE 2>/dev/null | \
24 sed '/phpMyAdmin-/!d;s|.*phpMyAdmin-||;s|-all.*||;q'
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 mkdir -p $fs/usr/share/phpmyadmin
31 mkdir -p $fs/etc/phpmyadmin
32 mkdir -p $fs/usr/share/applications
34 cp -a $src/. $fs/usr/share/phpmyadmin
35 ln -s /etc/phpmyadmin/config.inc.php $fs/usr/share/phpmyadmin/config.inc.php
36 cp $src/config.sample.inc.php $fs/etc/phpmyadmin/config.inc.php
37 rm -f $fs/usr/share/phpmyadmin/phpMyAdmin-$VERSION-all-languages
38 cp $stuff/phpmyadmin.desktop $fs/usr/share/applications
39 chown -R www.www $fs/usr/share/phpmyadmin $fs/etc/phpmyadmin
40 chmod 700 $fs/etc/phpmyadmin
41 chmod 644 $fs/etc/phpmyadmin/config.inc.php
43 sed -i s'/\?>//' $fs/etc/phpmyadmin/config.inc.php
45 cat <<"EOT">> $fs/etc/phpmyadmin/config.inc.php
47 $cfg['McryptDisableWarning'] = true;
48 // For public use you may comment the following lines
49 // to enforce the security.
50 $cfg['Servers'][$i]['AllowNoPassword'] = true;
51 $cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
52 $cfg['Servers'][$i]['AllowRoot'] = true;
53 ?>
54 EOT
55 }
57 post_install()
58 {
59 secret=$(dd if=/dev/urandom count=1 2> /dev/null | md5sum | sed 's/ .*//')
60 sed -i "s/^\(.*blowfish_secret'] = '\)'/\1$secret'/" \
61 "$1/etc/phpmyadmin/config.inc.php"
63 # Configure lighttpd server
64 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
65 then
66 if ! grep -q /usr/share/phpmyadmin/ "$1/etc/lighttpd/lighttpd.conf"
67 then
68 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpmyadmin/" => "/usr/share/phpmyadmin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
69 if [ -z "$1" ]
70 then
71 # Start Web server.
72 /etc/init.d/lighttpd stop
73 /etc/init.d/lighttpd start
74 fi
75 fi
76 fi
78 # Configure apache server
79 if [ -f "$1/etc/apache/httpd.conf" ]
80 then
81 if [ ! -f "$1/etc/apache/conf.d/phpmyadmin" ]
82 then
83 cat > "$1/etc/apache/conf.d/phpmyadmin" <<EOT
84 <IfModule mod_alias.c>
85 Alias /phpmyadmin /usr/share/phpmyadmin
86 </IfModule>
87 <Directory /usr/share/phpmyadmin/>
88 DirectoryIndex index.php
89 Options +FollowSymLinks
90 AllowOverride None
91 Order allow,deny
92 Allow from all
93 </Directory>
94 EOT
95 if [ -z "$1" ]
96 then
97 # Start Web server.
98 /etc/init.d/apache stop
99 /etc/init.d/apache start
100 fi
101 fi
102 fi
103 }