diff options
author | Renat Lumpau <rl03@gentoo.org> | 2005-06-26 21:18:35 +0000 |
---|---|---|
committer | Renat Lumpau <rl03@gentoo.org> | 2005-06-26 21:18:35 +0000 |
commit | e1cc09146bf68a25ab7e09c234b463bf8503c4bc (patch) | |
tree | d83957ce4cf060c5f2f55c9617008b7f58cd8ed7 /www-apps/bugzilla/files | |
parent | New upstream version. (diff) | |
download | gentoo-2-e1cc09146bf68a25ab7e09c234b463bf8503c4bc.tar.gz gentoo-2-e1cc09146bf68a25ab7e09c234b463bf8503c4bc.tar.bz2 gentoo-2-e1cc09146bf68a25ab7e09c234b463bf8503c4bc.zip |
Fixed reconfig script. Closes #80996 and #96072
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'www-apps/bugzilla/files')
-rw-r--r-- | www-apps/bugzilla/files/2.18.1-r1/apache.htaccess | 3 | ||||
-rw-r--r-- | www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.daily | 5 | ||||
-rw-r--r-- | www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.tab | 1 | ||||
-rw-r--r-- | www-apps/bugzilla/files/2.18.1-r1/reconfig | 110 | ||||
-rw-r--r-- | www-apps/bugzilla/files/digest-bugzilla-2.18.1-r1 | 1 |
5 files changed, 120 insertions, 0 deletions
diff --git a/www-apps/bugzilla/files/2.18.1-r1/apache.htaccess b/www-apps/bugzilla/files/2.18.1-r1/apache.htaccess new file mode 100644 index 000000000000..eb747223ccec --- /dev/null +++ b/www-apps/bugzilla/files/2.18.1-r1/apache.htaccess @@ -0,0 +1,3 @@ +AddHandler cgi-script .cgi +Options +Indexes +ExecCGI +FollowSymLinks +DirectoryIndex index.cgi diff --git a/www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.daily b/www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.daily new file mode 100644 index 000000000000..e3e86589891d --- /dev/null +++ b/www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.daily @@ -0,0 +1,5 @@ +#!/bin/sh +cd /var/www/bugzilla/ +./collectstats.pl +./whineatnews.pl +echo "*** Bugzilla nighlty flush has done! ***" diff --git a/www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.tab b/www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.tab new file mode 100644 index 000000000000..0ac2ef6d65a6 --- /dev/null +++ b/www-apps/bugzilla/files/2.18.1-r1/bugzilla.cron.tab @@ -0,0 +1 @@ +0 0 * * * /var/www/bugzilla/bugzilla.cron.daily diff --git a/www-apps/bugzilla/files/2.18.1-r1/reconfig b/www-apps/bugzilla/files/2.18.1-r1/reconfig new file mode 100644 index 000000000000..29c46230453a --- /dev/null +++ b/www-apps/bugzilla/files/2.18.1-r1/reconfig @@ -0,0 +1,110 @@ +#!/bin/bash + +FILE="bugzilla.cron.daily bugzilla.cron.tab" + +function die () +{ + echo + echo "***" + echo "*** Fatal error: $*" + echo "***" + exit 1 +} + +if [ $1 = "install" ]; then + + cd "${MY_INSTALLDIR}" || die "Cannot find install dir ${MY_INSTALLDIR}" + + sed -e "s|/var/www/bugzilla|${MY_INSTALLDIR}|g;" -i ${FILE} + + [[ -a localconfig ]] && die "The following does not work on previous installations, please run checksetup.pl in ${MY_INSTALLDIR}" + + echo + echo "Finalizing the installation of bugzilla in ${MY_INSTALLDIR}" + echo + + # config setting + echo "Details for the bugzilla database" + echo "(This scripts creates the database & user)" + echo + + echo -n "mysql bugs db host [localhost]: "; read mybugshost + [[ -z "${mybugshost}" ]] && mybugshost="localhost" + + echo -n "mysql bugs db port [3306]: "; read mybugsport + [[ -z "${mybugsport}" ]] && mybugsport="3306" + + echo -n "mysql bugs db name [bugs]: "; read mybugsdb + [[ -z "${mybugsdb}" ]] && mybugsdb="bugs" + + echo -n "mysql bugs dbuser name [bugs]: "; read mybugsuser + [[ -z "${mybugsuser}" ]] && mybugsuser="bugs" + + echo -n "mysql bugs dbuser password: "; read mybugspwd + [[ -z "${mybugspwd}" ]] && die "Error: no dbuser password" + pw=${mybugspwd//\'/\\\'} + + echo -n "admin email [no@spam.com]: "; read myadminemail + [[ -z "${myadminemail}" ]] && myadminemail="no@spam.com" + + echo -n "admin password [password]: "; read myadminpwd + [[ -z "${myadminpwd}" ]] && myadminpwd="password" + + echo -n "admin real name [Foo Bar]: "; read myadminrealname + [[ -z "${myadminrealname}" ]] && myadminrealname="Foo Bar" + + # let's create a config file for checksetup.pl + echo "\$answer{'db_host'} = '\$db_host = \"${mybugshost}\";" > bz.cfg.pl + echo "\$db_port = ${mybugsport};" >> bz.cfg.pl + echo "\$db_name = \"${mybugsdb}\";" >> bz.cfg.pl + echo "\$db_user = \"${mybugsuser}\";';" >> bz.cfg.pl + echo "\$answer{'db_pass'} = q[\$db_pass = '${mybugspwd}';];" >> bz.cfg.pl + echo "\$answer{'db_sock'} = q[\$db_sock = '/var/run/mysqld/mysqld.sock';];" >> bz.cfg.pl + + echo "\$answer{'ADMIN_OK'} = 'Y';" >> bz.cfg.pl + echo "\$answer{'ADMIN_EMAIL'} = '${myadminemail}';" >> bz.cfg.pl + echo "\$answer{'ADMIN_PASSWORD'} = '${myadminpwd}';" >> bz.cfg.pl + echo "\$answer{'ADMIN_REALNAME'} = '${myadminrealname}';" >> bz.cfg.pl + + # privileges + echo "Setting correct privileges for bugzilla mysql connection" + echo -n "Please enter login info for user who has grant privileges on ${mybugshost} [${USER}]: "; read adminuser + [[ -z ${adminuser} ]] && adminuser="${USER}" + if [ "${mybugshost}" != "localhost" ]; then + echo -n "Client address for bugzilla (at db side) [$(hostname -f)]: "; read clientaddr + [[ -z ${clientaddr} ]] && clientaddr="$(hostname -f)" + fi + # this will be default for localhost + [[ -z ${clientaddr} ]] && clientaddr="${mybugshost}" + + # check the installed mysql version + type -p mysql &>/dev/null || die "mysql program not found ! Check your PATH (or did you emerge with --nodeps ?)" + mysql_version="`mysql -V | cut -d' ' -f6 | sed -e 's:,$::'`" + [[ -z ${mysql_version} ]] && die "mysql version check failed (got '${mysql_version}')" + extra_bugzie_privs="" + (( ${mysql_version:0:1} < 4 )) && extra_bugzie_privs=",LOCK TABLES,CREATE TEMPORARY TABLES" + + # if $bugshost == localhost, don't specify -h argument, so local socket can be used. + host=${mybugshost/localhost} + /etc/init.d/mysql restart || die "Could not (re)start mysql!" + mysql -u "${adminuser}" "${host:+-h ${host}}" -p \ + -P "${mybugsport}" \ + -e "GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP,REFERENCES${extra_bugzie_privs} ON ${mybugsdb}.* TO '${mybugsuser}'@'${clientaddr}' IDENTIFIED BY '${pw}'; FLUSH PRIVILEGES;" \ + || die "Error initializing database. Please grant permissions manually. See http://www.bugzilla.org/docs/2.18/html/configuration.html." + + echo "Setting the template for localconfig variables" + chmod 755 ./checksetup.pl + ./checksetup.pl bz.cfg.pl || exit 1 + + echo "Final step: setting all html templates and db tables" + ./checksetup.pl || exit 1 + + echo -n "Do you want to set a crontab [y/N]" ; read cronyes + if [ "${cronyes}+" = "y+" ] ; then + /usr/bin/crontab -u apache ${MY_INSTALLDIR}/bugzilla.cron.tab + fi + +else + [[ -z "${MY_INSTALLDIR}" ]] && die "${MY_INSTALLDIR} not found!" + rm -f "${FILES}" bz.cfg.pl +fi diff --git a/www-apps/bugzilla/files/digest-bugzilla-2.18.1-r1 b/www-apps/bugzilla/files/digest-bugzilla-2.18.1-r1 new file mode 100644 index 000000000000..e24a62e80d17 --- /dev/null +++ b/www-apps/bugzilla/files/digest-bugzilla-2.18.1-r1 @@ -0,0 +1 @@ +MD5 3765b0021377d626a9b8c50868dd51b9 bugzilla-2.18.1.tar.gz 1542054 |