Skip to content
Snippets Groups Projects
Commit 773120fa authored by rds's avatar rds
Browse files

Simple installer for Request Tracker.

parent 2980751c
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# README
# ------
# - This is a dumb installer which needs to be run again and again
# until it finishes without errors. This is so the CPAN dependencies
# can all be resolved (2 or 3 times is usually sufficient).
# - It makes no real attempt to recover or handle errors.
# - It installs RT using the ../ directory as the base directory.
# This is useful for installing where you don't have permission to
# install into /opt, /usr, etc...
# - It will install loads of CPAN stuff and will not use any CPAN
# install other than the system installed libraries.
# - It installs a few accessory scripts for use with the completed
# install. These are:
# etc/rt_env.sh - environment script to source to make
# running the scripts easier
# bin/run_binary.sh - auto source the rt_env.sh and run
# specified script.
# sbin/run_system_binary.sh - as run_binary.sh, but for sbin scripts.
# Author: Roy Storey (rds@sanger.ac.uk)
cd $(dirname $0)
# About all there is to configure.
# Where you want to install. [Default is ../ using $(cd .. && pwd)]
RT_ROOT=$(cd .. && pwd)
# Where is comes from
RELEASE_DIR=http://download.bestpractical.com/pub/rt/release
# version to download (3.8.2 part of rt-3.8.2.tar.gz)
VERSION=3.8.2
# END OF CONFIGURABLE BITS
# ------------------------ #
# No user servicable parts #
# ------------------------ #
# Simple directories to store tars and build bits
TAR_DIR=$RT_ROOT/tars
BUILD_DIR=$RT_ROOT/build
# make the RT tar filename.
RT_TAR=rt-$VERSION.tar.gz
mkdir -p $TAR_DIR $BUILD_DIR
mkdir -p $RT_ROOT/.cpan/{build,sources,CPAN} $RT_ROOT/CPAN/sources
cat > $RT_ROOT/.cpan/CPAN/MyConfig.pm <<EOF
\$CPAN::Config = {
'auto_commit' => q[1],
'build_cache' => q[10],
'build_dir' => q[$RT_ROOT/.cpan/build],
'cache_metadata' => q[1],
'commandnumber_in_prompt' => q[1],
'cpan_home' => q[$RT_ROOT/.cpan],
'dontload_hash' => { },
'ftp' => q[/bin/ftp],
'ftp_passive' => q[1],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gzip' => q[/bin/gzip],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[$RT_ROOT/.cpan/sources],
'lynx' => q[/usr/bin/lynx],
'make' => q[/usr/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'make_install_make_command' => q[/usr/bin/make],
'makepl_arg' => q[PREFIX=$RT_ROOT/CPAN/sources],
'mbuild_arg' => q[],
'mbuild_install_arg' => q[],
'mbuild_install_build_command' => q[./Build],
'mbuildpl_arg' => q[],
'ncftp' => q[/],
'ncftpget' => q[],
'no_proxy' => q[],
'pager' => q[/usr/local/bin/less],
'prerequisites_policy' => q[follow],
'scan_cache' => q[atstart],
'shell' => q[/bin/tcsh],
'tar' => q[/bin/tar],
'term_is_latin' => q[1],
'term_ornaments' => q[1],
'unzip' => q[/usr/bin/unzip],
'urllist' => [q[ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/]],
'use_sqlite' => q[0],
'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]],
'wget' => q[/usr/local/bin/wget],
};
1;
__END__
EOF
# Update Perl library path
PERL5LIB=$RT_ROOT/CPAN/sources/lib/5.8.8:$RT_ROOT/CPAN/sources/lib/site_perl/5.8.8
# write the environment in the users shell language...
mkdir $RT_ROOT/etc
cat > $RT_ROOT/etc/rt_env.bash <<EOF
#!/bin/echo dot-script please source .
RT_ROOT=$RT_ROOT
HOME=$RT_ROOT
PERL5LIB=$PERL5LIB
PATH=$RT_ROOT/bin:\$PATH
export PERL5LIB RT_ROOT HOME PATH
EOF
cat > $RT_ROOT/etc/rt_env.csh <<EOF
#!/bin/echo dot-script please source .
setenv RT_ROOT "$RT_ROOT"
setenv HOME "$RT_ROOT"
setenv PERL5LIB "$PERL5LIB"
setenv PATH "$RT_ROOT/bin:\$PATH"
EOF
cd $RT_ROOT/etc
if [ "x$SHELL" == "x/bin/bash" ]; then
ln -s rt_env.bash rt_env.sh
else
ln -s rt_env.csh rt_env.sh
fi
# Get RT distribution
cd $TAR_DIR
[ -f $RT_TAR ] || wget $RELEASE_DIR/$RT_TAR
# Build the distribution
cd $BUILD_DIR
tar -zxf $TAR_DIR/$RT_TAR
cd rt-$VERSION
# Source the environment
. $RT_ROOT/etc/rt_env.bash
# Configure
./configure \
--prefix=$RT_ROOT \
--with-my-user-group \
--with-db-type=SQLite
# make fixing dependencies and install
make fixdeps install
FIXDEPS_INSTALL=$?
# make initialising the database
rm -f $RT_ROOT/var/rt3
make initialize-database
INIT_DB=$?
# write some cover scripts
touch $RT_ROOT/bin/run_binary.sh
chmod 755 $RT_ROOT/bin/run_binary.sh
cat > $RT_ROOT/bin/run_binary.sh <<EOF
#!/bin/bash
# auto-generated by $0
. $RT_ROOT/etc/rt_env.sh
if [ \$# != 0 ]; then
\$(dirname \$0)/\$@
else
echo "usage $0 <script> [options]"
fi
EOF
touch $RT_ROOT/sbin/run_system_binary.sh
chmod 755 $RT_ROOT/sbin/run_system_binary.sh
cat > $RT_ROOT/sbin/run_system_binary.sh <<EOF
#!/bin/bash
# auto-generated by $0
. $RT_ROOT/etc/rt_env.sh
if [ \$# != 0 ]; then
\$(dirname \$0)/\$@
else
echo "usage $0 <script> [options]"
fi
EOF
# helpful final message...
if [ $FIXDEPS_INSTALL == 0 ]; then
if [ $INIT_DB == 0 ]; then
echo ""
echo " ================================================================================ "
echo " $0 has completed successfully. "
echo " To run the server 'source $RT_ROOT/etc/rt_env.sh' and run 'standalone_httpd 8080'"
echo " or run $RT_ROOT/bin/run_binary.sh standalone_httpd "
echo " ================================================================================ "
fi
fi
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment