Tivoli 5.3.0 on Debian fun

Sadly, there aren’t any native Debian packages for Tivoli. So, I had to fetch the RPMs and install those. That works, mostly, provided you use alien to transform them into Debian packages. However that’s not enough. You need to extract a post installation script from TIVsm-BA.i386.rpm or the language stuff won’t be properly symlinked. I had to add some trailing fis to the shell script, as it wouldn’t run under my copy of bash.

$ ls -1
TIVsm-BA.i386.rpm
TIVsm-API.i386.rpm
TIVsm-HSM.i386.rpm
$ alien -d *.rpm
$ su -
# dpkg -i tivsm-api_5.3.0-1_i386.deb tivsm-ba_5.3.0-1_i386.deb tivsm-hsm_5.3.0-1_i386.deb

Almost ready. The shell script still must be run to do a few things. I extracted it by hand from the RPMs. The library path need be added to ld.so.conf too.

# echo "/opt/tivoli/tsm/client/api/bin" >> /etc/ld.so.conf
# ldconfig

And the script.

#!/bin/bash
set -x
echo "Postinstall of the Backup Archive client"
#echo "Installation directory is" $RPM_INSTALL_PREFIX
if [ -z $RPM_INSTALL_PREFIX ]; then
        RPM_INSTALL_PREFIX="/opt"
fi
CLIENTDIR=$RPM_INSTALL_PREFIX/tivoli/tsm/client
BUILDDATE=`cat $CLIENTDIR/ba/bin/.buildDate`
# tivoli inventory dir
TIVINV_DIR=/opt/tivoli/tsm/tivinv
# GUID dir
GUIDDIR=$RPM_INSTALL_PREFIX/tivoli/guid
chmod 4755 $CLIENTDIR/ba/bin/dsmtca
touch -t $BUILDDATE $CLIENTDIR/ba/bin/dsmadmc
touch -t $BUILDDATE $CLIENTDIR/ba/bin/dsmc
touch -t $BUILDDATE $CLIENTDIR/ba/bin/dsmj
touch -t $BUILDDATE $CLIENTDIR/ba/bin/dsmtca
touch -t $BUILDDATE $CLIENTDIR/ba/bin/dsmcad
touch -t $BUILDDATE $CLIENTDIR/ba/bin/dsmagent
touch -t $BUILDDATE $CLIENTDIR/ba/bin/plugins/libPiIMG.so
touch -t $BUILDDATE $CLIENTDIR/ba/bin/plugins/libPiSNAP.so
touch -t $BUILDDATE $CLIENTDIR/ba/bin/libxmlutil-5.3.0.0.so
touch -t $BUILDDATE $CLIENTDIR/ba/bin/libxerces-c1_6_0.so
################################
# Tivoli Inventory file
################################
#Create the necessary inventory dir
if [[ ! -d $TIVINV_DIR ]]
then
        mkdir -p $TIVINV_DIR
fi
#Create Inventory File
#clean pre-existing TSMBACLNX*.SIG and *.SYS files
rm -f $TIVINV_DIR/TSMBACL*.SIG >/dev/null 2>&1
rm -f $TIVINV_DIR/TSMBACL*.SYS >/dev/null 2>&1
#Create Inventory File
TIVINVFILE="TSMBACL05030000.SYS"
echo "TIVOLI" > $TIVINV_DIR/$TIVINVFILE
chmod 555 $TIVINV_DIR/$TIVINVFILE
# GUID verification
if [[ -f /etc/TIVGUID ]] && [[ -f $GUIDDIR ]]; then
   cd $GUIDDIR
   ./tivguid -show
   if [ $? != 0 ]; then
      ./tivguid -create
      if [ $? != 0 ]; then
#         echo "GUID was not found. A new one could not be generated."
         exit 1
      fi
   fi
else
   if [ -f $GUIDDIR ]; then
      cd $GUIDDIR
      ./tivguid -create
      if [ $? != 0 ]; then
#      echo "GUID was not found. A new one could not be generated."
         exit 1
      fi
   fi
fi
# remove buildDate
rm -f $CLIENTDIR/ba/bin/.buildDate
# create links for messages
for l in `ls $CLIENTDIR/lang | grep .._..` ; do
  ln -s ../../lang/$l $CLIENTDIR/ba/bin/$l
  [[ $l == "zh_CN" ]] && ln -s ../../lang/$l $CLIENTDIR/ba/bin/$l.GB18030
done
echo
echo "TSM Linux client installation complete."
echo
echo "Be sure to set up the system configuration file"
echo "before starting the client!"
echo "Uninstall of the Backup Archive client"
#
# JAB 20050124
# I don't think we need this
#
################################
# Tivoli Inventory file
################################
#TIVINV_DIR=/opt/tivoli/tsm/tivinv
#TIVINVFILE="TSMBACL05030000.SYS"
#Check for dir and file
#if [[ ! -d $TIVINV_DIR ]]
#then
#        echo "$TIVINV_DIR not exist"
#else
#        if [[ ! -f $TIVINV_DIR/$TIVINVFILE ]]
#        then
#                echo "$TIVINV_DIR/$TIVINVFILE not exist"
#        else
#                rm -f $TIVINV_DIR/$TIVINVFILE
#        rm -f $TIVINV_DIR/TSMBACL*.SIG
# recover '.buildDate' to satisfy rpm
#touch /opt/tivoli/tsm/client/ba/bin/.buildDate
# remove links for messages
#rm -f /opt/tivoli/tsm/client/ba/bin/??_??
#rm -f /opt/tivoli/tsm/client/ba/bin/??_??.GB18030
#echo "Uninstall of the Backup Archive client complete"
#echo ""

Of course that stuffs tons of junk in /opt, but what can you do? A proper Debian package could probably still be made if the RPMs were unpackaged into a temporary directory and then packged up. But it works for now.