wok-next annotate wordpress/receipt @ rev 20632

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