wok view phpmyadmin/receipt @ rev 25671

Up optipng (0.7.8), osip (5.3.1), pcre2 (10.43), tor (0.4.7.16), unbound (1.19.1), vim (9.1.0135)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 25 19:17:19 2024 +0000 (2 months ago)
parents eb2b710f40e2
children 6acd28d149b8
line source
1 # SliTaz package receipt.
3 PACKAGE="phpmyadmin"
4 VERSION="5.1.1"
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
40 chown -R www.www $fs/etc/phpmyadmin
41 chmod 700 $fs/etc/phpmyadmin
42 chmod 644 $fs/etc/phpmyadmin/config.inc.php
44 sed -i s'/\?>//' $fs/etc/phpmyadmin/config.inc.php
46 cat <<"EOT">> $fs/etc/phpmyadmin/config.inc.php
48 $cfg['McryptDisableWarning'] = true;
49 // For public use you may comment the following lines
50 // to enforce the security.
51 $cfg['Servers'][$i]['AllowNoPassword'] = true;
52 $cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
53 $cfg['Servers'][$i]['AllowRoot'] = true;
54 ?>
55 EOT
56 }
58 post_install()
59 {
60 secret=$(dd if=/dev/urandom count=1 2> /dev/null | md5sum | sed 's/ .*//')
61 sed -i "s/^\(.*blowfish_secret'] = '\)'/\1$secret'/" \
62 "$1/etc/phpmyadmin/config.inc.php"
64 # Configure lighttpd server
65 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
66 then
67 if ! grep -q /usr/share/phpmyadmin/ "$1/etc/lighttpd/lighttpd.conf"
68 then
69 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpmyadmin/" => "/usr/share/phpmyadmin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
70 if [ -z "$1" ]
71 then
72 # Start Web server.
73 /etc/init.d/lighttpd stop
74 /etc/init.d/lighttpd start
75 fi
76 fi
77 fi
79 # Configure apache server
80 if [ -f "$1/etc/apache/httpd.conf" ]
81 then
82 if [ ! -f "$1/etc/apache/conf.d/phpmyadmin" ]
83 then
84 cat > "$1/etc/apache/conf.d/phpmyadmin" <<EOT
85 <IfModule mod_alias.c>
86 Alias /phpmyadmin /usr/share/phpmyadmin
87 </IfModule>
88 <Directory /usr/share/phpmyadmin/>
89 DirectoryIndex index.php
90 Options +FollowSymLinks
91 AllowOverride None
92 Order allow,deny
93 Allow from all
94 </Directory>
95 EOT
96 if [ -z "$1" ]
97 then
98 # Start Web server.
99 /etc/init.d/apache stop
100 /etc/init.d/apache start
101 fi
102 fi
103 fi
104 }