wok view wordpress/receipt @ rev 20319
Up tazlito (501)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 20 13:28:18 2018 +0200 (2018-05-20) |
parents | 9e01bc6321ea |
children | 6135577f4d08 |
line source
1 # SliTaz package receipt.
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 SUGGESTED="apache cherokee"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://wordpress.org"
12 WGET_URL="$WEB_SITE/$TARBALL"
14 DEPENDS="php mysql php-mysql"
16 # Rules to gen a SliTaz package suitable for Tazpkg.
17 genpkg_rules()
18 {
19 mkdir -p $fs/var/www/wordpress
20 cp -a $src/* $fs/var/www/wordpress
21 chown -R www.www $fs/var/www/wordpress
22 }
24 post_install()
25 {
26 local db=wordpress
27 local db_user=wordpress
28 local db_password=wordpress
30 # Minimal config for wordpress.
31 if [ -z "$1" ]; then
32 if ( ! mysqladmin -s ping > /dev/null ); then
33 echo
34 echo "Starting MySQL server"
35 ( /etc/init.d/mysql start ; status ) || exit
36 sleep 4 #let the mysql daemon start
37 fi
38 if ( ! mysql -u root -Be 'show databases' | grep -q $db ); then
39 echo
40 echo -n "Create $db database"
41 mysql -Be "create database $db" ; status
42 # We suppose that $DB_USER user does not exist.
43 # It may be false.
44 echo -n "Create user $db_user with password $db_password"
45 mysql -Be "grant all privileges on $db.* to '"$db_user"'@'localhost'
46 identified by '"$db_password"'" ; status
47 # At last create the database for $PACKAGE.
48 echo -n "Create $db database schema."
49 #mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-${VERSION}-empty.sql ; status
50 fi
51 fi
53 }
55 post_remove()
56 {
57 local db=wordpress
58 local db_user=wordpress
59 local db_password=wordpress
61 if [ -z "$1" ]; then
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 echo -n "Removing data directories..."
68 [ -d /var/lib/wordpress ] && rm -rf /var/lib/wordpress ; status
69 if ( mysql -u root -Be 'show databases' | grep -q $db ); then
70 echo -n "Deleting $db database"
71 mysql -Be "drop database $db" ; status
72 # We suppose that glpi user does not exist.
73 # It may be false.
74 echo -n "Delete user $db_user"
75 mysql -Be "delete from mysql.db where user='"$db_user"'" ; status
76 fi
77 unset $answer
78 ;;
79 *)
80 ;;
81 esac
82 fi
83 }