wok-next view wordpress/receipt @ rev 20976

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