diff options
author | Karl Trygve Kalleberg <karltk@gentoo.org> | 2004-09-08 15:58:15 +0000 |
---|---|---|
committer | Karl Trygve Kalleberg <karltk@gentoo.org> | 2004-09-08 15:58:15 +0000 |
commit | 9df7397989463b1d19a940923ea52d1eeb05943e (patch) | |
tree | 8e08f5f8f50e10f0293de75499421e9319b7eea1 /www-apps/issue-tracker/files | |
parent | Change profile to virtual/dev-manager (diff) | |
download | gentoo-2-9df7397989463b1d19a940923ea52d1eeb05943e.tar.gz gentoo-2-9df7397989463b1d19a940923ea52d1eeb05943e.tar.bz2 gentoo-2-9df7397989463b1d19a940923ea52d1eeb05943e.zip |
Rewritten to work with the new webapp-config
Diffstat (limited to 'www-apps/issue-tracker/files')
-rw-r--r-- | www-apps/issue-tracker/files/digest-issue-tracker-4.0.3-r1 | 1 | ||||
-rw-r--r-- | www-apps/issue-tracker/files/postinstall-en.txt | 38 | ||||
-rw-r--r-- | www-apps/issue-tracker/files/reconfig | 92 |
3 files changed, 131 insertions, 0 deletions
diff --git a/www-apps/issue-tracker/files/digest-issue-tracker-4.0.3-r1 b/www-apps/issue-tracker/files/digest-issue-tracker-4.0.3-r1 new file mode 100644 index 000000000000..4e17c935b262 --- /dev/null +++ b/www-apps/issue-tracker/files/digest-issue-tracker-4.0.3-r1 @@ -0,0 +1 @@ +MD5 dbf3b8d4e46fb00170891b9c549d6e3c issue-tracker-4.0.3.tar.bz2 191396 diff --git a/www-apps/issue-tracker/files/postinstall-en.txt b/www-apps/issue-tracker/files/postinstall-en.txt new file mode 100644 index 000000000000..fb75ea6acfce --- /dev/null +++ b/www-apps/issue-tracker/files/postinstall-en.txt @@ -0,0 +1,38 @@ +You will need to configure issue-tracker for a particular database + +(1) First, you must decide on: + - a database username, <it-username> + - a database name in the database, <it-dbname> + +(2) Next, you must create the database + +For MySQL: +mysqladmin -p -u <it-username> create <it-dbname> +mysql -p -u <it-username> <it-dbname> \ + < ${MY_INSTALLDIR}/issue-tracker/setup/schema.mysql +mysql -p -u <it-username> <it-dbname> \ + < ${MY_INSTALLDIR}/issue-tracker/setup/data.sql +mysql -p -u <it-username> <it-dbname> \ + < ${MY_INSTALLDIR}/issue-tracker/setup/indexes.sql + +For PostgreSQL: +createdb -U <it-username> <it-dbname> +psql -U <it-username> \ + < ${MY_INSTALLDIR}/issue-tracker/setup/schema.pgsql +psql -U <it-username> \ + < ${MY_INSTALLDIR}/issue-tracker/setup/data.sql +psql -U <it-username> \ + < ${MY_INSTALLDIR}/issue-tracker/setup/indexes.sql + +(3) Next, you will need to configure issue-tracker +cp ${MY_INSTALLDIR}/issue-tracker/conf/config.php-default \ + ${MY_INSTALLDIR}/issue-tracker/conf/config.php" + +Edit ${MY_INSTALLDIR}/issue-tracker/conf/config.php +with name=<it-dbname>, user=<it-username> and the correct db info + +Make sure you don't just edit the commented-out example;) + +(4) Finally, you must restart the server, log in to the +issue-tracker as admin/demo, and change the password in Preferences. + diff --git a/www-apps/issue-tracker/files/reconfig b/www-apps/issue-tracker/files/reconfig new file mode 100644 index 000000000000..f58646ec63c2 --- /dev/null +++ b/www-apps/issue-tracker/files/reconfig @@ -0,0 +1,92 @@ +#!/bin/bash + +function die() { + echo '***************' + echo + echo $1 + echo + echo '***************' + exit 1 +} + +if [ $1 = "start" -o $1 = "install" ]; then + + # default values + SUPPORTED_DB="MySQL PostgreSQL" + PN="issue-tracker" + D_DBNAME="it" + D_DBUSER="it" + D_DBHOST="localhost" + + echo "Configuring ${PN}:" + echo + # config setting + select DB_TYPE in ${SUPPORTED_DB}; do [ -z ${DB_TYPE} ] || break; done + + echo -n "Database name [${D_DBNAME}]: "; read DBNAME + if (test -z ${DBNAME}) ; then DBNAME=${D_DBNAME} ; fi + + echo -n "Database host [${D_DBHOST}]: "; read DBHOST + if (test -z ${DBHOST}) ; then DBHOST=${D_DBHOST} ; fi + echo "IMPORTANT: be sure that the database daemon is running on ${DBHOST}" + + echo -n "Database user name [${D_DBUSER}]: "; read DBUSER + if (test -z ${DBUSER}) ; then DBUSER=${D_DBUSER} ; fi + + echo -n "${DBUSER}'s password: "; read DBPASS + + # privileges + echo "Configuring your database connection:" + echo -n "Please enter login info for user who has grant privileges on ${DBHOST} [$USER]: "; read adminuser + if (test -z ${adminuser}) ; then adminuser="$USER" ; fi + if [ "${DBHOST}" != "localhost" ]; then + echo -n "Client address (at db side) [$(hostname -f)]: "; read clientaddr + if (test -z ${clientaddr}) ; then clientaddr="$(hostname -f)" ; fi + fi + # this will be default for localhost + if (test -z ${clientaddr}) ; then clientaddr="${DBHOST}" ; fi + + # if $DBHOST == localhost, don't specify -h argument, so local socket can be used. + host=${DBHOST/localhost} + + case ${DB_TYPE} in + "MySQL" ) { + mysqladmin -p -u ${adminuser} ${host:+-h ${host}} create ${DBNAME} + mysql -u ${adminuser} ${host:+-h ${host}} -p mysql --exec="GRANT SELECT,INSERT,UPDATE,DELETE,INDEX, ALTER,CREATE,DROP,REFERENCES ON ${DBNAME}.* TO ${DBUSER}@${clientaddr} IDENTIFIED BY '${DBPASS}'; FLUSH PRIVILEGES;" || { + echo "Error running query!" + echo + echo "Please run it manually on ${host}." + echo + echo " \$ mysql -u ${adminuser} -p mysql --exec=\"GRANT SELECT,INSERT,UPDATE,DELETE,INDEX, ALTER,CREATE,DROP,REFERENCES ON ${DBNAME}.* TO ${DBUSER}@${clientaddr} IDENTIFIED BY '${DBPASS}'; FLUSH PRIVILEGES;\"" + echo + } + DB_TYPE="mysql" + DBPORT="3306" + mysql -u ${adminuser} ${host:+-h ${host}} -p ${DBNAME} < ${MY_INSTALLDIR}/setup/schema.mysql + mysql -u ${adminuser} ${host:+-h ${host}} -p ${DBNAME} < ${MY_INSTALLDIR}/setup/data.sql + mysql -u ${adminuser} ${host:+-h ${host}} -p ${DBNAME} < ${MY_INSTALLDIR}/setup/indexes.sql + };; + "PostgreSQL" ) { + DB_TYPE="pgsql" + DBPORT="5432" + createdb -U ${adminuser} ${host:+-h ${host}} ${DBNAME} + psql -U ${adminuser} ${host:+-h ${host}} ${DBNAME} < ${MY_INSTALLDIR}/setup/schema.pgsql + psql -U ${adminuser} ${host:+-h ${host}} ${DBNAME} < ${MY_INSTALLDIR}/setup/data.sql + psql -U ${adminuser} ${host:+-h ${host}} ${DBNAME} < ${MY_INSTALLDIR}/setup/indexes.sql + } + ;; + esac + echo + echo "These and more settings can be found in ${MY_INSTALLDIR}/conf/config.php" + echo + # editing config file + sed -e "s|<type>|${DB_TYPE}| + s|<host>|${DBHOST}| + s|<port>|${DBPORT}| + s|<name>|${DBNAME}| + s|<user>|${DBUSER}| + s|<pass>|${DBPASS}| + " -i ${MY_INSTALLDIR}/conf/config.php-default +else + echo $1 +fi |