wok-next view wordpress/receipt @ rev 21020

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