#!/bin/sh # This is a shell archive (produced by GNU sharutils 4.2.1). # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # # Made on 2005-09-30 16:28 CEST by . # Source directory was `/home/szamcsi/w/egee/HEAD/org.glite.data/autogen'. # # Existing files will *not* be overwritten unless `-c' is specified. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 3263 -rwxr-xr-x glite-userspace-installer-1.5.0/glite-userspace-apt # 4611 -rwxr-xr-x glite-userspace-installer-1.5.0/glite-userspace-install.sh # 4873 -rwxr-xr-x glite-userspace-installer-1.5.0/glite-userspace-rpm # save_IFS="${IFS}" IFS="${IFS}:" gettext_dir=FAILED locale_dir=FAILED first_param="$1" for dir in $PATH do if test "$gettext_dir" = FAILED && test -f $dir/gettext \ && ($dir/gettext --version >/dev/null 2>&1) then set `$dir/gettext --version 2>&1` if test "$3" = GNU then gettext_dir=$dir fi fi if test "$locale_dir" = FAILED && test -f $dir/shar \ && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) then locale_dir=`$dir/shar --print-text-domain-dir` fi done IFS="$save_IFS" if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED then echo=echo else TEXTDOMAINDIR=$locale_dir export TEXTDOMAINDIR TEXTDOMAIN=sharutils export TEXTDOMAIN echo="$gettext_dir/gettext -s" fi if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$2 "$8"' else shar_touch=: echo $echo 'WARNING: not restoring timestamps. Consider getting and' $echo "installing GNU \`touch', distributed in GNU File Utilities..." echo fi rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch # if mkdir _sh15293; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' exit 1 fi # ============= glite-userspace-installer-1.5.0/glite-userspace-apt ============== if test ! -d 'glite-userspace-installer-1.5.0'; then $echo 'x -' 'creating directory' 'glite-userspace-installer-1.5.0' mkdir 'glite-userspace-installer-1.5.0' fi if test -f 'glite-userspace-installer-1.5.0/glite-userspace-apt' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'glite-userspace-installer-1.5.0/glite-userspace-apt' '(file already exists)' else $echo 'x -' extracting 'glite-userspace-installer-1.5.0/glite-userspace-apt' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'glite-userspace-installer-1.5.0/glite-userspace-apt' && #!/bin/bash X # # Copyright (c) Members of the EGEE Collaboration. 2004. # See http://public.eu-egee.org/partners/ for details on # the copyright holders. # For license conditions see the license file or # http://eu-egee.org/license.html # # Authors: # Akos Frohner # # This script helps the installations of RPMs into a userspace # area, specified by the GLITE_ROOT environmental variable. # # Apart from creating the necessary files this script is a wrapper # around apt, thus any options and parameters applicable to 'apt' # can be used here. # X APT_RPM_URL='http://linuxsoft.cern.ch/cern/slc30X/i386/SL/RPMS/apt-0.5.15cnc6-8.SL.cern.i386.rpm' X #DRYRUN=echo X if [ -z "$GLITE_ROOT" ]; then X echo "Error: \$GLITE_ROOT is not defined!" X exit -1 fi X if [ ! -d "$GLITE_ROOT" ]; then X echo "Info: creating the root at $GLITE_ROOT" X mkdir -p $GLITE_ROOT fi X # Needs 'glite-userspace-rpm' to operate. # Assuming, that it is at the same location. USERSPACE_RPM=$(cd $(dirname $0) && pwd)/glite-userspace-rpm if [ ! -x "$USERSPACE_RPM" ]; then X echo "Error: glite-userspace-rpm is not found!" X exit -2 fi X ############################# # basic directories and files X aptconfig="$GLITE_ROOT/etc/apt/glite-userspace-apt.conf" X if [ ! -r "$aptconfig" ]; then X echo "Info: initializing config at $aptconfig" X if [ -x "/usr/bin/apt-get" ]; then X # there is native APT, so we can make use of it X if [ ! -d "$GLITE_ROOT/etc/apt" ]; then X mkdir -p $GLITE_ROOT/etc X cp -a /etc/apt $GLITE_ROOT/etc/ X fi X if [ ! -d "$GLITE_ROOT/var/cache/apt" ]; then X mkdir -p $GLITE_ROOT/var/cache X cp -a /var/cache/apt $GLITE_ROOT/var/cache/ X fi X if [ ! -d "$GLITE_ROOT/var/state/apt" ]; then X mkdir -p $GLITE_ROOT/var/state X cp -a /var/state/apt $GLITE_ROOT/var/state/ X fi X cat <$aptconfig Dir "$GLITE_ROOT/"; Dir::Bin::rpm "$USERSPACE_RPM"; RPM::PM "external"; EOF X else X # APT has to be installed X echo "Info: postinstall scriptlet may fail. Please ignore!" X cd $GLITE_ROOT X wget $APT_RPM_URL X $USERSPACE_RPM -ivh apt-*.rpm X rm apt-*.rpm X X cat <$aptconfig Dir "$GLITE_ROOT/"; Dir::State "var/state/apt/"; Dir::Bin::methods "$GLITE_ROOT/usr/lib/apt/methods"; Dir::Bin::scripts "$GLITE_ROOT/usr/lib/apt/scripts"; Dir::Bin::rpm "$USERSPACE_RPM"; RPM::PM "external"; RPM::Allow-Duplicated { "^kernel$"; }; RPM::Allow-Duplicated { "^kernel-smp$"; }; EOF X fi # -d "/etc/apt" fi X ################################### # collecting the additional options X apt_pre_options=" -c $aptconfig" X # Calling different commands, depening on # the name of this executable. # Hint: use symlinks for different targets! command=$(basename $0 | sed -e 's/^glite-userspace-//') X # figuring out where is the actual binary if [ -x "/usr/bin/$command" ]; then X command="/usr/bin/$command" elif [ -x "$GLITE_ROOT/usr/bin/$command" ]; then X command="$GLITE_ROOT/usr/bin/$command" else X echo "Error: $command binary could not be found!" X exit -2 fi X # do the job, by callin 'apt' itself echo "Info: $command" $apt_pre_options $@ $DRYRUN $command $apt_pre_options $@ X SHAR_EOF (set 20 05 09 30 16 28 16 'glite-userspace-installer-1.5.0/glite-userspace-apt'; eval "$shar_touch") && chmod 0755 'glite-userspace-installer-1.5.0/glite-userspace-apt' || $echo 'restore of' 'glite-userspace-installer-1.5.0/glite-userspace-apt' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'glite-userspace-installer-1.5.0/glite-userspace-apt:' 'MD5 check failed' 4627005964fe1db20659b6ff43c6b6b4 glite-userspace-installer-1.5.0/glite-userspace-apt SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'glite-userspace-installer-1.5.0/glite-userspace-apt'`" test 3263 -eq "$shar_count" || $echo 'glite-userspace-installer-1.5.0/glite-userspace-apt:' 'original size' '3263,' 'current size' "$shar_count!" fi fi # ============= glite-userspace-installer-1.5.0/glite-userspace-install.sh ============== if test -f 'glite-userspace-installer-1.5.0/glite-userspace-install.sh' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'glite-userspace-installer-1.5.0/glite-userspace-install.sh' '(file already exists)' else $echo 'x -' extracting 'glite-userspace-installer-1.5.0/glite-userspace-install.sh' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'glite-userspace-installer-1.5.0/glite-userspace-install.sh' && #!/bin/bash # # Copyright (c) Members of the EGEE Collaboration. 2004. # See http://public.eu-egee.org/partners/ for details on # the copyright holders. # For license conditions see the license file or # http://eu-egee.org/license.html # # Authors: # Akos Frohner # # This script is a userspace installation of the gLite configuration. # It installs the system to a specified location using RPMs from the # gLite integration build (or local build directory) and some external # runtime dependency RPMs from the gLite external repository. # # The default installation location is in AFS. X X # set GLITE_APT_REPOSITORY to override DEFAULT_APT_REPOSITORY='rpm http://glitesoft.cern.ch/EGEE/gLite/APT/R1.3/ rhel30 externals Release1.3 updates' # pass a directory on the command line to override INSTALLROOT=/tmp/glite-ui X USAGE="$0 [--help] [userspace_install_dir]" X # working directory cd $(dirname $0) ADMINDIR=$PWD X X # default flags do_remove=no do_install=yes X TEMP=$(getopt -o hnd --long none,help,remove,install,dryrun -- "$@") eval set -- "$TEMP" X while true; do X case "$1" in X --remove) X do_remove=yes X shift X ;; X --install) X do_install=yes X shift X ;; X --dryrun) X DRYRUN=echo X shift X ;; X -h|--help) X echo $USAGE X exit X ;; X --) X # end of options X shift X break X ;; X *) X echo "Error: unknown option '$1'" X echo $USAGE X exit 1 X esac done X # replacing the default install directory, if specified if [ -n "$1" ]; then X INSTALLROOT="$1" fi X X ############################################################################## # main ###### X echo "Installing gLite UI to '$INSTALLROOT'" X if [ "$do_remove" == 'yes' ]; then X # removing old stuff X rm -rf $INSTALLROOT/* X X # re-creating the directories X mkdir -p $INSTALLROOT X case $INSTALLROOT in X /afs/*) X fs setacl -dir $INSTALLROOT -acl system:anyuser rl X ;; X esac fi X if [ "$do_install" == 'yes' ]; then X # preparing the 'root' environment X $DRYRUN mkdir -p $INSTALLROOT/root X export HOME="$INSTALLROOT/root" X X # script install X mkdir -p $HOME/bin X cp $ADMINDIR/glite-userspace-rpm $HOME/bin/ X cp $ADMINDIR/glite-userspace-apt $HOME/bin/ X cd $HOME/bin X ln -f -s glite-userspace-apt glite-userspace-apt-get X ln -f -s glite-userspace-apt glite-userspace-apt-cache X ln -f -s glite-userspace-apt glite-userspace-apt-config X X cat >$HOME/env_settings <$GLITE_ROOT/etc/apt/sources.list.d/glite-userspace.list X glite-userspace-apt-get update X X # the envinorment script for bash X cat >$GLITE_ROOT/env_settings.sh <$GLITE_ROOT/env_settings.csh < ' EOF X chmod +x $GLITE_ROOT/env_settings.sh X X # generating the documentation X cat >$GLITE_ROOT/README <&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'glite-userspace-installer-1.5.0/glite-userspace-install.sh:' 'MD5 check failed' 0f9444cf29ac9e8a7382bc32002af0ad glite-userspace-installer-1.5.0/glite-userspace-install.sh SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'glite-userspace-installer-1.5.0/glite-userspace-install.sh'`" test 4611 -eq "$shar_count" || $echo 'glite-userspace-installer-1.5.0/glite-userspace-install.sh:' 'original size' '4611,' 'current size' "$shar_count!" fi fi # ============= glite-userspace-installer-1.5.0/glite-userspace-rpm ============== if test -f 'glite-userspace-installer-1.5.0/glite-userspace-rpm' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'glite-userspace-installer-1.5.0/glite-userspace-rpm' '(file already exists)' else $echo 'x -' extracting 'glite-userspace-installer-1.5.0/glite-userspace-rpm' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'glite-userspace-installer-1.5.0/glite-userspace-rpm' && #!/bin/bash X # # Copyright (c) Members of the EGEE Collaboration. 2004. # See http://public.eu-egee.org/partners/ for details on # the copyright holders. # For license conditions see the license file or # http://eu-egee.org/license.html # # Authors: # Akos Frohner # # This script installs an RPM, specified as a parameter, into # a userspace directory, specified by the GLITE_ROOT environmental # variable. # # Apart from creating the necessary files this script is a wrapper # around RPM, thus any options and parameters applicable to 'rpm' # can be used here. # X # uncomment for debugging #DRYRUN=echo X if [ -z "$GLITE_ROOT" ]; then X echo "Error: \$GLITE_ROOT is not defined!" X exit -1 fi X if [ ! -d "$GLITE_ROOT" ]; then X echo "Info: creating the root at $GLITE_ROOT" X mkdir -p $GLITE_ROOT fi X ############################# # basic directories and files X rpmdbdir="$GLITE_ROOT/var/lib/rpm" X if [ -d "/var/lib/rpm" ]; then X # In theory one could use the --dbpath or --root X # option of RPM to specify the DB location. In X # practice it is just not working! You have to X # start hacking with the RPM macros to make it X # really happen. X X if [ ! -d "$GLITE_ROOT/root" ]; then X echo "Info: creating a fake root HOME environment in $GLITE_ROOT/root" X mkdir -p $GLITE_ROOT/root X fi X if [ ! -d "$GLITE_ROOT/root/.rpmmacros" ]; then X echo "%_dbpath $GLITE_ROOT/var/lib/rpm" >$GLITE_ROOT/root/.rpmmacros X fi X export HOME=$GLITE_ROOT/root fi X if [ ! -d "$rpmdbdir" ]; then X echo "Info: initializing the RPM database at $rpmdbdir" X mkdir -p $rpmdbdir X X if [ -d "/var/lib/rpm" ]; then X # if it is an RPM based system, then we can copy the base X cp /var/lib/rpm/* $rpmdbdir/ X # relocation does not help db4 X rm $rpmdbdir/__db* X rpm --rebuilddb X else X # otherwise start from scratch X rpm --initdb X # which means: ignore dependencies! X touch $rpmdbdir/.option.nodeps X fi fi X #################################### # figuring out the extra RPM options X rpm_pre_options="" rpm_post_options="" X # ignore dependencies, if it is not an RPM based distro if [ -e $rpmdbdir/.option.nodeps ]; then X rpm_post_options="$rpm_post_options --nodeps" fi X # Going through the arguments to check, # - if we need to do relocation at all and # - what prefixes has to be relocated. # # The '--root' option does not work in our # case, because the system RPMs are installed # at a different location. X relocate="false" relocate_root="false" X # poor man's hashtable relocatempfile=/tmp/$(basename $0).relocatempfile.$$ touch $relocatempfile chmod 600 $relocatempfile X function extract_rpm_prefix { X prefix=$(rpm -qp --qf '%{PREFIXES}' $1) X if [ "$prefix" = "/usr" ]; then X # special case for 'system' packages X echo "--relocate /etc=${GLITE_ROOT}/etc" >>$relocatempfile X echo "--relocate /var=${GLITE_ROOT}/var" >>$relocatempfile X echo "--relocate /usr=${GLITE_ROOT}/usr" >>$relocatempfile X X elif [ "$prefix" = "(none)" -o "$prefix" = "/" ]; then X echo "Warning: / relocation for "$(basename $1) X relocate_root="true" X # by default only these basic directories are relocated instead of / X echo "--relocate /etc=${GLITE_ROOT}/etc" >>$relocatempfile X echo "--relocate /var=${GLITE_ROOT}/var" >>$relocatempfile X echo "--relocate /usr=${GLITE_ROOT}/usr" >>$relocatempfile X X else X # the normal case X echo "--relocate ${prefix}=${GLITE_ROOT}${prefix}" >>$relocatempfile X fi } X for opt in "$@"; do X case $opt in X -F*|-i*|-U*) X relocate="true" X ;; X *.rpm) X extract_rpm_prefix $opt X ;; X *) X # apt sometimes passes the RPMs in a list file X if [ -r "$opt" ]; then X for rpm in $(grep '\.rpm$' $opt); do X extract_rpm_prefix $rpm X done X fi X ;; X esac done X if [ -n "$DRYRUN" ]; then X echo "Debug: relocate == $relocate, relocate_root == $relocate_root" X cat $relocatempfile | sed -e 's/^/Debug: /' fi X if [ "$relocate" = "true" ]; then X if [ "$relocate_root" = "true" -a "$GLITE_USERSPACE_ROOT_RELOCATE" = "true" ]; then X # root directory relocation is not compatible with any X # other directory relocations, because that would relocate X # those as well... X rpm_pre_options="$rpm_pre_options --relocate /=$GLITE_ROOT/" X else X # avoiding duplication of relocate options X rpm_pre_options="$rpm_pre_options "$(sort -u $relocatempfile) X fi fi X # do the job, by calling RPM itself echo "Info: rpm" $rpm_pre_options $@ $rpm_post_options $DRYRUN rpm $rpm_pre_options $@ $rpm_post_options X # clean up rm $relocatempfile X SHAR_EOF (set 20 05 09 30 16 28 16 'glite-userspace-installer-1.5.0/glite-userspace-rpm'; eval "$shar_touch") && chmod 0755 'glite-userspace-installer-1.5.0/glite-userspace-rpm' || $echo 'restore of' 'glite-userspace-installer-1.5.0/glite-userspace-rpm' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'glite-userspace-installer-1.5.0/glite-userspace-rpm:' 'MD5 check failed' 0a44c7c6db958f848316633ea5dded53 glite-userspace-installer-1.5.0/glite-userspace-rpm SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'glite-userspace-installer-1.5.0/glite-userspace-rpm'`" test 4873 -eq "$shar_count" || $echo 'glite-userspace-installer-1.5.0/glite-userspace-rpm:' 'original size' '4873,' 'current size' "$shar_count!" fi fi rm -fr _sh15293 exit 0