joomla/joomla-setup.sh

Fri, 07 Sep 2012 19:08:07 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:08:07 +0200
changeset 667
9dacbd1d1aa2
permissions
-rw-r--r--

Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.

     1 #!/bin/sh
     2 ##
     3 ##  joomla-setup.sh -- Joomla! RDBMS Setup Utility
     4 ##
     6 #   database configuration
     7 db_name="joomla"
     8 db_user="joomla"
     9 db_pass="joomla"
    11 #   determine RDBMS-specific details
    12 db_suser=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\
    13           sed -e 's;^user[^=]*= *;;' -e 's; *$;;'`
    14 db_spass=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
    15           sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
    17 #   dispatch operation
    18 cmd="${1:-"install"}"
    19 case "$cmd" in
    20     install )
    21         #   create the database
    22         @l_prefix@/bin/mysqladmin --user="$db_suser" --password="$db_spass" create "$db_name"
    23         ( echo "GRANT ALL PRIVILEGES ON $db_name.* TO $db_user@localhost IDENTIFIED BY '$db_pass';"
    24           echo "FLUSH PRIVILEGES;"
    25         ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
    27         #   activate installer
    28         rm -f @l_prefix@/lib/joomla/runtime/configuration.php
    29         rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true
    30         cp -rp @l_prefix@/lib/joomla/installation @l_prefix@/lib/joomla/runtime/
    31         ;;
    32     cleanup )
    33         #   deactivate installer
    34         rm -rf @l_prefix@/lib/joomla/runtime/installation >/dev/null 2>&1 || true
    35         ;;
    36     uninstall )
    37         #   remove the database
    38         ( echo "DROP DATABASE $db_name;"
    39         ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
    41         #   remove the generated configuration
    42         rm -f @l_prefix@/lib/joomla/runtime/configuration.php
    43         ;;
    44 esac

mercurial