wok-next diff wordpress/receipt @ rev 20692

typos
author Erkan Yilmaz <erkan@slitaz.org>
date Tue May 22 09:48:44 2018 +0000 (2018-05-22)
parents 9e01bc6321ea
children 7506b35e1c6f
line diff
     1.1 --- a/wordpress/receipt	Sun Dec 20 15:13:45 2015 +0100
     1.2 +++ b/wordpress/receipt	Tue May 22 09:48:44 2018 +0000
     1.3 @@ -1,81 +1,79 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="wordpress"
     1.8  VERSION="3.4.1"
     1.9  CATEGORY="misc"
    1.10 -SHORT_DESC="Blog Tool and Publishing Platform."
    1.11 +SHORT_DESC="Blog Tool and Publishing Platform"
    1.12  MAINTAINER="slaxemulator@gmail.com"
    1.13  LICENSE="GPL2"
    1.14 -SUGGESTED="apache cherokee"
    1.15 +WEB_SITE="http://wordpress.org"
    1.16 +
    1.17  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.18 -WEB_SITE="http://wordpress.org"
    1.19  WGET_URL="$WEB_SITE/$TARBALL"
    1.20  
    1.21  DEPENDS="php mysql php-mysql"
    1.22  
    1.23 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.24 -genpkg_rules()
    1.25 -{
    1.26 +genpkg_rules() {
    1.27  	mkdir -p $fs/var/www/wordpress
    1.28  	cp -a $src/* $fs/var/www/wordpress
    1.29  	chown -R www.www $fs/var/www/wordpress
    1.30 +SUGGESTED="apache cherokee"
    1.31  }
    1.32  
    1.33 -post_install()
    1.34 -{
    1.35 +post_install() {
    1.36  	local db=wordpress
    1.37  	local db_user=wordpress
    1.38  	local db_password=wordpress
    1.39 -	
    1.40 +
    1.41  	# Minimal config for wordpress.
    1.42 -	if [ -z "$1" ]; then
    1.43 -		if ( ! mysqladmin -s ping > /dev/null ); then
    1.44 -			echo "Starting MySQL server"
    1.45 -			( /etc/init.d/mysql start ; status  ) || exit 
    1.46 -			sleep 4 #let the mysql daemon start
    1.47 -		fi
    1.48 -		if ( ! mysql -u root -Be 'show databases' | grep -q $db ); then
    1.49 -			echo -n "Create $db database"
    1.50 -			mysql -Be "create database $db" ; status
    1.51 -			# We suppose that $DB_USER user does not exist.
    1.52 -			# It may be false.
    1.53 -			echo  -n "Create user $db_user with password $db_password"
    1.54 -			mysql -Be "grant all privileges on $db.* to '"$db_user"'@'localhost' 
    1.55 -				identified by '"$db_password"'" ; status
    1.56 -			# At last create the database for $PACKAGE.
    1.57 -			echo -n "Create $db database schema."
    1.58 -			#mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-${VERSION}-empty.sql ; status
    1.59 -		fi
    1.60 +	[ -z "$1" ] || return 0
    1.61 +
    1.62 +	if ( ! mysqladmin -s ping >/dev/null ); then
    1.63 +		echo "Starting MySQL server"
    1.64 +		( /etc/init.d/mysql start; status ) || exit
    1.65 +		sleep 4 #let the mysql daemon start
    1.66  	fi
    1.67 -	
    1.68 +	if ( ! mysql -u root -Be 'show databases' | grep -q $db ); then
    1.69 +		action "Create $db database"
    1.70 +		mysql -Be "create database $db"; status
    1.71 +
    1.72 +		# We suppose that $DB_USER user does not exist.
    1.73 +		# It may be false.
    1.74 +		action "Create user $db_user with password $db_password"
    1.75 +		mysql -Be "grant all privileges on $db.* to '"$db_user"'@'localhost' 
    1.76 +			identified by '"$db_password"'" ; status
    1.77 +
    1.78 +		# At last create the database for $PACKAGE.
    1.79 +		action "Create $db database schema."
    1.80 +		#mysql -u glpi -pglpi -D glpi < /usr/share/glpi/install/mysql/glpi-${VERSION}-empty.sql ; status
    1.81 +	fi
    1.82  }
    1.83  
    1.84 -post_remove()
    1.85 -{
    1.86 +post_remove() {
    1.87  	local db=wordpress
    1.88  	local db_user=wordpress
    1.89  	local db_password=wordpress
    1.90 -	
    1.91 -	if [ -z "$1" ]; then
    1.92 -		echo -n "Would you like to remove data and database files.(y/n) "
    1.93 -		read answer
    1.94  
    1.95 -		case $answer in 
    1.96 +	[ -z "$1" ] || return 0
    1.97 +
    1.98 +	echo -n "Would you like to remove data and database files.(y/n) "
    1.99 +	read answer
   1.100 +
   1.101 +	case $answer in
   1.102  		y|Y)
   1.103 -			echo -n "Removing data directories..."
   1.104 -			[ -d /var/lib/wordpress ] && rm -rf /var/lib/wordpress ; status
   1.105 +			action "Removing data directories..."
   1.106 +			[ -d /var/lib/wordpress ] && rm -rf /var/lib/wordpress; status
   1.107 +
   1.108  			if ( mysql -u root -Be 'show databases' | grep -q $db ); then
   1.109 -				echo -n "Deleting $db database"
   1.110 -				mysql -Be "drop database $db" ; status
   1.111 +				action "Deleting $db database"
   1.112 +				mysql -Be "drop database $db"; status
   1.113 +
   1.114  				# We suppose that glpi user does not exist.
   1.115  				# It may be false.
   1.116 -				echo  -n "Delete user $db_user"
   1.117 -				mysql -Be "delete from mysql.db where user='"$db_user"'" ; status
   1.118 +				action "Delete user $db_user"
   1.119 +				mysql -Be "delete from mysql.db where user='"$db_user"'"; status
   1.120  			fi
   1.121  			unset $answer
   1.122  			;;
   1.123 -		*)
   1.124 -			;;
   1.125 -		esac
   1.126 -	fi
   1.127 +	esac
   1.128  }