Cómo tener Setedit corriendo remótamente sin instalación de root

     Un pequeño documento que explica cómo instalar Setedit en un Unix en el que no tenemos acceso a la cuenta root, y lo queremos exportar por NFS y que funcione en todas partes, incluso donde no hay Turbo Vision.

How to run setedit remotely without root installation
By Grzegorz Adam Hankiewicz.

I'm a lucky guy and I've been hired by eFaber (http://www.efaber.net)
to do some open source hacking. The first day I started I was given
a computer and received strong orders: "Install Suse Linux 8.1 and
customize your environment". Obviously I chose to install setedit,
and it worked great. However, from time to time I have to go to
another workstation or login remotely. We export /home through NFS,
so apparently we have the same configuration everywhere. But setedit
doesn't work.

First of all, setedit depends on the TVision library, and only my PC
has it installed. setedit also needs a global directory where shared
files reside, usually /usr/share/setedit, or something else pointed
by SET_FILES.  One solution would be to install setedit everywhere,
but this is not scalable, and it's error prone. If I wanted to
upgrade setedit or TVision I would spend much time copying and
installing on every machine. Besides, even if my coworkers let me
access root on their workstation, or told me the password, I would
never be given access to the intranet's server, and it's the only
one with email input/output (I use setedit for email too). What's
the solution?

The solution is to put the files needed by setedit on the exported
directory, in other words, $HOME. After you compile setedit, put the
binary in ~/bin. Find where your TVision is (librhtv*) and copy the
library to ~/lib. If you run ldd on ~/bin/setedit you will see that
the librhtv dependency is resolved to your local file system. If
you logged now to another computer, the library wouldn't be found.

To avoid this, add something similar to your .bashrc:

export PATH=$PATH:~/bin
export LD_LIBRARY_PATH=~/lib

After you log in again, try to use ldd on the binary, and now you
should see the linker resolve it to your ~/lib everywhere. First step
complete.  The second step is to move the shared files. I created the
directory in ~/bin/setedit_shared_files, and made /usr/share/setedit
on my local machine a symlink to it, so newer installs of setedit
overwrite the correct shared files. Now make SET_FILES point to it:

export SET_FILES=~/bin/setedit_shared_files

Nice. Now, if you run setedit it will be able to load,
but you will find still two annoying facts: setedit always
looks for the setedit.info file (which is usually found in
/usr/info/setedit.info.gz), and the language translations won't
be found because GNU's gettext doesn't know anything about our
exportation trick.

To solve the info file warning, copy setedit.info.gz to
~/bin/setedit_shared_files and add that directory to the appropriate
environment variable:


Finally, to correct the gettext problem, first make SET_LOCELEDIR
point to SET_FILES:


And now, in SET_FILES create the directory structure xx/LC_MESSAGES/,
where `xx' is a two letter code representing a language. I would
then create ~/bin/setedit_shared_files/es/LC_MESSAGES, and put
inside the file setedit.mo I found typing `locate setedit.mo' on
my workstation.  After copying the file there, GNU's gettext will
find the translation file always, from any directory, and you will
be able to hack from every computer as if you were at home.

Again, what you have to add to your .bashrc file is:

export PATH=$PATH:~/bin
export LD_LIBRARY_PATH=~/lib
export SET_FILES=~/bin/setedit_shared_files

Happy hacking!