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