wok-current annotate wordpress/receipt @ rev 23875
Up alpine (2.23), ansible (2.9.10), wordpress (5.4.2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jun 27 16:47:12 2020 +0000 (2020-06-27) |
parents | 6de35f9c4eab |
children | 669f61f44760 |
rev | line source |
---|---|
slaxemulator@7399 | 1 # SliTaz package receipt. |
slaxemulator@7399 | 2 |
slaxemulator@7399 | 3 PACKAGE="wordpress" |
pascal@23875 | 4 VERSION="5.4.2" |
slaxemulator@7399 | 5 CATEGORY="misc" |
slaxemulator@7399 | 6 SHORT_DESC="Blog Tool and Publishing Platform." |
slaxemulator@7399 | 7 MAINTAINER="slaxemulator@gmail.com" |
pascal@15363 | 8 LICENSE="GPL2" |
Hans-G?nter@22138 | 9 WEB_SITE="https://wordpress.org/" |
Hans-G?nter@22138 | 10 |
Hans-G?nter@22138 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
Hans-G?nter@22138 | 12 WGET_URL="${WEB_SITE}$TARBALL" |
Hans-G?nter@22138 | 13 |
pascal@13024 | 14 SUGGESTED="apache cherokee" |
Hans-G?nter@22138 | 15 DEPENDS="mysql php php-mysql" |
pascal@15363 | 16 |
slaxemulator@7399 | 17 # Rules to gen a SliTaz package suitable for Tazpkg. |
slaxemulator@7399 | 18 genpkg_rules() |
slaxemulator@7399 | 19 { |
slaxemulator@7399 | 20 mkdir -p $fs/var/www/wordpress |
Hans-G?nter@23736 | 21 |
Hans-G?nter@23736 | 22 cp -a $src/* $fs/var/www/wordpress |
Hans-G?nter@23736 | 23 chown -R www.www $fs/var/www/wordpress |
slaxemulator@7399 | 24 } |
slaxemulator@7399 | 25 |
erjo@8354 | 26 post_install() |
erjo@8354 | 27 { |
erjo@8354 | 28 local db=wordpress |
erjo@8354 | 29 local db_user=wordpress |
erjo@8354 | 30 local db_password=wordpress |
erjo@8354 | 31 |
Hans-G?nter@23736 | 32 # Minimal configuration for wordpress. |
Hans-G?nter@23736 | 33 if [ -z "$1" ] |
Hans-G?nter@23736 | 34 then |
Hans-G?nter@23736 | 35 if ( ! mysqladmin -s ping > /dev/null ) |
Hans-G?nter@23736 | 36 then |
pascal@20319 | 37 echo |
erjo@8354 | 38 echo "Starting MySQL server" |
erjo@8354 | 39 ( /etc/init.d/mysql start ; status ) || exit |
erjo@8354 | 40 sleep 4 #let the mysql daemon start |
erjo@8354 | 41 fi |
Hans-G?nter@23736 | 42 if ( ! mysql -u root -Be 'show databases' | grep -q $db ) |
Hans-G?nter@23736 | 43 then |
pascal@20319 | 44 echo |
erjo@8354 | 45 echo -n "Create $db database" |
Hans-G?nter@23736 | 46 mysql -Be "create database $db" |
Hans-G?nter@23736 | 47 status |
erjo@8354 | 48 # We suppose that $DB_USER user does not exist. |
erjo@8354 | 49 # It may be false. |
erjo@8354 | 50 echo -n "Create user $db_user with password $db_password" |
erjo@8354 | 51 mysql -Be "grant all privileges on $db.* to '"$db_user"'@'localhost' |
erjo@8354 | 52 identified by '"$db_password"'" ; status |
erjo@8354 | 53 # At last create the database for $PACKAGE. |
erjo@8354 | 54 echo -n "Create $db database schema." |
erjo@8354 | 55 #mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-${VERSION}-empty.sql ; status |
erjo@8354 | 56 fi |
erjo@8354 | 57 fi |
erjo@8354 | 58 |
erjo@8354 | 59 } |
erjo@8354 | 60 |
erjo@8354 | 61 post_remove() |
erjo@8354 | 62 { |
slaxemulator@8651 | 63 local db=wordpress |
slaxemulator@8651 | 64 local db_user=wordpress |
slaxemulator@8651 | 65 local db_password=wordpress |
erjo@8354 | 66 |
Hans-G?nter@23736 | 67 if [ -z "$1" ] |
Hans-G?nter@23736 | 68 then |
erjo@8354 | 69 echo -n "Would you like to remove data and database files.(y/n) " |
erjo@8354 | 70 read answer |
erjo@8354 | 71 |
erjo@8354 | 72 case $answer in |
erjo@8354 | 73 y|Y) |
erjo@8354 | 74 echo -n "Removing data directories..." |
slaxemulator@8651 | 75 [ -d /var/lib/wordpress ] && rm -rf /var/lib/wordpress ; status |
Hans-G?nter@23736 | 76 if ( mysql -u root -Be 'show databases' | grep -q $db ) |
Hans-G?nter@23736 | 77 then |
erjo@8354 | 78 echo -n "Deleting $db database" |
Hans-G?nter@23736 | 79 mysql -Be "drop database $db" |
Hans-G?nter@23736 | 80 status |
erjo@8354 | 81 # We suppose that glpi user does not exist. |
erjo@8354 | 82 # It may be false. |
erjo@8354 | 83 echo -n "Delete user $db_user" |
Hans-G?nter@23736 | 84 mysql -Be "delete from mysql.db where user='"$db_user"'" |
Hans-G?nter@23736 | 85 status |
erjo@8354 | 86 fi |
erjo@8354 | 87 unset $answer |
erjo@8354 | 88 ;; |
erjo@8354 | 89 *) |
erjo@8354 | 90 ;; |
erjo@8354 | 91 esac |
slaxemulator@8651 | 92 fi |
erjo@8354 | 93 } |