wok-6.x annotate wordpress/receipt @ rev 22856

updated gmime and gmime-dev (3.2.3 -> 3.2.6)
author Hans-G?nter Theisgen
date Thu Feb 20 14:14:07 2020 +0100 (2020-02-20)
parents 6135577f4d08
children 6de35f9c4eab
rev   line source
slaxemulator@7399 1 # SliTaz package receipt.
slaxemulator@7399 2
slaxemulator@7399 3 PACKAGE="wordpress"
Hans-G?nter@22138 4 VERSION="5.2.4"
slaxemulator@7399 5 CATEGORY="misc"
slaxemulator@7399 6 SHORT_DESC="Blog Tool and Publishing Platform."
slaxemulator@7399 7 MAINTAINER="slaxemulator@gmail.com"
pascal@15363 8 LICENSE="GPL2"
Hans-G?nter@22138 9 WEB_SITE="https://wordpress.org/"
Hans-G?nter@22138 10
Hans-G?nter@22138 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
Hans-G?nter@22138 12 WGET_URL="${WEB_SITE}$TARBALL"
Hans-G?nter@22138 13
pascal@13024 14 SUGGESTED="apache cherokee"
Hans-G?nter@22138 15 DEPENDS="mysql php php-mysql"
pascal@15363 16
slaxemulator@7399 17 # Rules to gen a SliTaz package suitable for Tazpkg.
slaxemulator@7399 18 genpkg_rules()
slaxemulator@7399 19 {
slaxemulator@7399 20 mkdir -p $fs/var/www/wordpress
slaxemulator@7399 21 cp -a $src/* $fs/var/www/wordpress
erjo@8354 22 chown -R www.www $fs/var/www/wordpress
slaxemulator@7399 23 }
slaxemulator@7399 24
erjo@8354 25 post_install()
erjo@8354 26 {
erjo@8354 27 local db=wordpress
erjo@8354 28 local db_user=wordpress
erjo@8354 29 local db_password=wordpress
erjo@8354 30
erjo@8354 31 # Minimal config for wordpress.
pascal@18730 32 if [ -z "$1" ]; then
erjo@8354 33 if ( ! mysqladmin -s ping > /dev/null ); then
pascal@20319 34 echo
erjo@8354 35 echo "Starting MySQL server"
erjo@8354 36 ( /etc/init.d/mysql start ; status ) || exit
erjo@8354 37 sleep 4 #let the mysql daemon start
erjo@8354 38 fi
erjo@8354 39 if ( ! mysql -u root -Be 'show databases' | grep -q $db ); then
pascal@20319 40 echo
erjo@8354 41 echo -n "Create $db database"
erjo@8354 42 mysql -Be "create database $db" ; status
erjo@8354 43 # We suppose that $DB_USER user does not exist.
erjo@8354 44 # It may be false.
erjo@8354 45 echo -n "Create user $db_user with password $db_password"
erjo@8354 46 mysql -Be "grant all privileges on $db.* to '"$db_user"'@'localhost'
erjo@8354 47 identified by '"$db_password"'" ; status
erjo@8354 48 # At last create the database for $PACKAGE.
erjo@8354 49 echo -n "Create $db database schema."
erjo@8354 50 #mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-${VERSION}-empty.sql ; status
erjo@8354 51 fi
erjo@8354 52 fi
erjo@8354 53
erjo@8354 54 }
erjo@8354 55
erjo@8354 56 post_remove()
erjo@8354 57 {
slaxemulator@8651 58 local db=wordpress
slaxemulator@8651 59 local db_user=wordpress
slaxemulator@8651 60 local db_password=wordpress
erjo@8354 61
pascal@18730 62 if [ -z "$1" ]; then
erjo@8354 63 echo -n "Would you like to remove data and database files.(y/n) "
erjo@8354 64 read answer
erjo@8354 65
erjo@8354 66 case $answer in
erjo@8354 67 y|Y)
erjo@8354 68 echo -n "Removing data directories..."
slaxemulator@8651 69 [ -d /var/lib/wordpress ] && rm -rf /var/lib/wordpress ; status
erjo@8354 70 if ( mysql -u root -Be 'show databases' | grep -q $db ); then
erjo@8354 71 echo -n "Deleting $db database"
erjo@8354 72 mysql -Be "drop database $db" ; status
erjo@8354 73 # We suppose that glpi user does not exist.
erjo@8354 74 # It may be false.
erjo@8354 75 echo -n "Delete user $db_user"
erjo@8354 76 mysql -Be "delete from mysql.db where user='"$db_user"'" ; status
erjo@8354 77 fi
erjo@8354 78 unset $answer
erjo@8354 79 ;;
erjo@8354 80 *)
erjo@8354 81 ;;
erjo@8354 82 esac
slaxemulator@8651 83 fi
erjo@8354 84 }