Monday, January 2, 2012

HOWTO INSTALL LOTUS NOTUS 852 OR 853 IN CHROOT 32BIT ON DEBIAN

This is how is installed 32bit chroot in my Debian wheezy 64bit to run Notes 853 (also works for 852).
I posted it because it took me hours looking for answers in the web and it could save you time. There are other and possibly better ways to accomplish some of the tasks. Follow these instructions at your own risk.

Step I: Obtain the software to install

You can untar it before or inside the chroot, your choice.

ibm-lotus-symphony-1hardy1_i386.deb
symphony-nl3_3.0_component-1hardy1_i386.deb
symphony-nl2_3.0_component-1hardy1_i386.deb
symphony-nl1_3.0_component-1hardy1_i386.deb
symphony_3.0_component-1hardy1_i386.deb
installationguide_addon
release_notes_addon
ibm-lotus-notes-8.5.3.i586.deb
ibm-lotus-activities-8.5.3.i586.deb
ibm-lotus-cae-8.5.3.i586.deb
ibm-lotus-sametime-8.5.3.i586.deb
ibm-lotus-symphony-8.5.3.i586.deb
ibm-lotus-feedreader-8.5.3.i586.deb
smartupgrade.sh
license.tar
AddTrustExternalCARoot.crt
ctxusb_2.0_i386.deb
icaclient_12.0.0_i386.deb
skype-debian_2.2.0.35-1_i386.deb
LOT_SYMP_3.0_ADDON_PK_LNX_DEB_ML.tar
LOT_SYMP_3_INSTLR_EDCMPNT_LNX_DEB.tar
NOTES_DIC_853_FOR_LIN_ML.zip
lotus_notes853_linuxUb_en.tar
install_flash_player_11_linux.i386.tar.gz

Phase II: Decide what is going to be chroot /home. By default it is your system /home and is the easiest to setup.

I decided to have a different /home for chroot to avoid config clashes between the same application running in 32 and 64 bit. My HOME for 32bit is /home/jail-un and for 64bit is /home/wr

Phase III: Install chroot and optional 32 bit apps.

Note: [user] and [GID] are to be replaced by user and group accordingly.

a) Using synaptic or apt-get install debootstrap and schroot
b) mkdir /srv/chroot/jail
c) edit /etc/schroot/schroot.conf to add:
=========
[jail-UN]
description=Debian jail 32-bit
directory=/srv/chroot/jail
aliases=default
personality=linux32
type=directory
message-verbosity=verbose
users=[user]
groups=[GID]
script-config=desktop/config
preserve-environment=true
#
===========
d) uncomment this line in /etc/schroot/desktop/fstab:
/var/run/gdm3 /var/run/gdm3 none rw,bind 0 0

e) if you do not change the default /home skip this step.
[modify the /home line if you want a diff home mounted (this is useful if you use apps like firefox that have 2 versions (32 and 64bits) running in your system so they dont overwrite each others config in home]
if you do this make sure you:
e.1) mkdir /home/jail-un
e.2) cd /home/jail-un
--for iceweasel:
e.3) mkdir .local
e.4) mkdir .local/share
e.5) edit /etc/schroot/desktop/fstab
/home/jail-un /home/[user] none rw,bind 0 0

f) get the 32bit code from Debian.
Note: If you have squeeze or sid replace it in the line below instead of wheezy

debootstrap --arch i386 wheezy /srv/chroot/jail/ http://ftp.us.debian.org/debian/

Note: In what follows I run all commands as root. Alternatively you could chroot as root, install and configure sudo then run everything as with sudo

g) schroot -c jail

h) apt-get install locales

i) dpkg-reconfigure locales (use en_US.UTF-8)

j) dpkg-reconfigure tzdata

k) apt-get update

l) apt-get upgrade

m) apt-get instal x11-apps (optional to make sure x apps like xclock run)

n) apt-get install fontconfig

o) apt-get install xterm (you need this so the Notes license pops up)

p) apt-get install libcanberra-gtk-module

q) apt-get install iceweasel (optional)

r) if you have certificates of authority for your browser put them in place. (optional)

s) cd / [important bc the following tar extracts file to /usr. If you fail to cd you have to manually cp all files to /usr]
tar -xvf install_flash_player_11_linux.i386.tar.gz

t) cp libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so [plugin for flashplayer]

u) Citrix ICAClient (optional)

dpkg -i icaclient_12.0.0_i386.deb [has a dependency on libxp, so run apt-get -f intall]
dpkg -i ctxusb_2.0_i386.deb [has a dependency on libcap2, so run apt-get -f intall]
These errors come about but the daemon starts OK:
insserv: Service ###INIT_UDEV### has to be enabled to start service ctxusbd
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
You may get an error with Certificates when using your application. Check the cert causing error in Iceweasel/Firefox in Edit/Preferences/Advanced/Encryption and export the certificate to /opt/Citrix/ICAClient/keystore/cacerts

v) exit chroot

Phase IV : Installing NOTES:

Preparation:
a) copy all packages you want to install as root in a place where chroot can get then. In this case in the dir /home/jail-un

b) you may want some extra fonts for Notes
cp ttf-xfree86-nonfree.deb (to get them duplicate the line ftp://debian... in to /etc/apt/sources.list and add nonfree to the end of the line)

c) Extra step for Notes 8.5.2 only:
c.1) Select the lotus_notes_fixpack-8.5.2.i586.deb file in nautilus and choose “extract here”
c.2) edit ibm_lotus_notes_fixpack-8.5.2.i586/DEBIAN/control
c.3) replace 8.5.2-20111118.0756_FP4 with 8.5.2-20111118.0756FP4
c.4) dpkg-deb –build ibm_lotus_notes_fixpack-8.5.2.i586 ibm_lotus_notes_fixpack-8.5.2.i586.deb

Installing:
d) chroot as root: schroot -c jail-UN

e) dpkg -i ttf-xfree86-nonfree.deb

f) dpkg -i ibm-lotus-notes-8.5.2.i586.deb (or the 8.5.3 package)

g) apt-get -f install (to install all dependencies required)

h) dpkg-reconfigure ibm-lotus-notes

i) dpkg -i ibm-lotus-symphony-8.5.2.i586.deb (or the 8.5.3 package)

j) dpkg -i ibm_lotus_notes_fixpack-8.5.2.i586.deb (skip this step for the 8.5.3 package)

k) ./ibm_lotus_notes_fixpack.sh (skip this step for the 8.5.3 package)

l) apt-get install dnsutils (optional)

m) cd /opt/ibm/lotus/notes

n) in the command line run the below (or write a script if you may)
n.1) for file in *.so; do ldd $file >> ldd.out;done
n.2) grep not ldd.out > ldd.out.notfound
n.3) sort -u ldd.out.notfound > ldd.out.notfound.unique
Note: these not found libs are all there in the notes dir but for some reason Notes does not find them as it looks for libs at /lib. The better way is to config one of the properties file in Notes but I got lazy and made a link into the /lib dir for each file in:
n.4) cut -d' ' -f1 ldd.out.notfound.unique
## this does not work=> cut -d' ' -f1 ldd.out.notfound.unique | while read -r;do echo "$REPLY'; ln -s /opt/ibm/lotus/notes/$REPLY /lib/$REPLY;done
## manually create a ln -s /opt/ibm/lotus/notes/.so /lib/.so

o) apt-get install libgtk2.0-dev (following hack from https://github.com/sgh/lotus-notes_gtk2.23.3)

p) get files: notes-wrapper, libnotesgtkfix.c, README, and Makefile from https://github.com/sgh/lotus-notes_gtk2.23.3

q) either make all or compile as: gcc -Wall -Wextra `pkg-config --cflags gtk+-2.0`-m32 -shared libnotesgtkfix.c -o libnotesgtkfix.so -ldl

r) cp notes-wrapper and libnotesgtkfix.so to /opt/ibm/lotus/notes

s) chmod 755 /opt/ibm/lotus/notes/notes-wrapper

t) ln -s /opt/ibm/lotus/notes/libnotesgtkfix.so /lib/libnotesgtkfix.so
===done===


===run====
as root console: xhost +local::gdm3
start notes as $ schroot notes-wrapper
======