wok-next annotate wordpress/receipt @ rev 21522

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