wok-current view wordpress/receipt @ rev 25434
Up znc (1.8.2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 29 10:14:47 2022 +0000 (2022-08-29) |
parents | 669f61f44760 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="wordpress"
4 VERSION="6.0.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 SUGGESTED="apache cherokee"
15 DEPENDS="mysql php php-mysql"
17 # What is the latest version available today?
18 current_version()
19 {
20 wget -O - https://core.trac.wordpress.org/browser 2>/dev/null | \
21 sed 's|<opt|\n&|g' | sed '/tags\/[0-9]/!d;s|.*">tags/||;s|<.*||' | sort -Vr | sed q
22 }
24 # Rules to gen a SliTaz package suitable for Tazpkg.
25 genpkg_rules()
26 {
27 mkdir -p $fs/var/www/wordpress
29 cp -a $src/* $fs/var/www/wordpress
30 chown -R www.www $fs/var/www/wordpress
31 }
33 post_install()
34 {
35 local db=wordpress
36 local db_user=wordpress
37 local db_password=wordpress
39 # Minimal configuration for wordpress.
40 if [ -z "$1" ]
41 then
42 if ( ! mysqladmin -s ping > /dev/null )
43 then
44 echo
45 echo "Starting MySQL server"
46 ( /etc/init.d/mysql start ; status ) || exit
47 sleep 4 #let the mysql daemon start
48 fi
49 if ( ! mysql -u root -Be 'show databases' | grep -q $db )
50 then
51 echo
52 echo -n "Create $db database"
53 mysql -Be "create database $db"
54 status
55 # We suppose that $DB_USER user does not exist.
56 # It may be false.
57 echo -n "Create user $db_user with password $db_password"
58 mysql -Be "grant all privileges on $db.* to '"$db_user"'@'localhost'
59 identified by '"$db_password"'" ; status
60 # At last create the database for $PACKAGE.
61 echo -n "Create $db database schema."
62 #mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-${VERSION}-empty.sql ; status
63 fi
64 fi
66 }
68 post_remove()
69 {
70 local db=wordpress
71 local db_user=wordpress
72 local db_password=wordpress
74 if [ -z "$1" ]
75 then
76 echo -n "Would you like to remove data and database files.(y/n) "
77 read answer
79 case $answer in
80 (y|Y)
81 echo -n "Removing data directories..."
82 [ -d /var/lib/wordpress ] && rm -rf /var/lib/wordpress ; status
83 if ( mysql -u root -Be 'show databases' | grep -q $db )
84 then
85 echo -n "Deleting $db database"
86 mysql -Be "drop database $db"
87 status
88 # We suppose that glpi user does not exist.
89 # It may be false.
90 echo -n "Delete user $db_user"
91 mysql -Be "delete from mysql.db where user='"$db_user"'"
92 status
93 fi
94 unset $answer
95 ;;
96 (*)
97 ;;
98 esac
99 fi
100 }