top curve

Using /usr/cs/contrib

How to Install Software in /usr/cs/contrib

Expectation and Purpose
The /usr/cs/contrib structure is intended to provide a place, outside of user home directories, which will hold programs of general interest, but not of wide enough interest to get ITC or CS Staff support. You must realize that by installing software in contrib you implicitly accept responsibility for that software. The staff do not support anything that is in contrib. Questions about contributed software are directed to the owner of the software.
Warning: Any user can place files in the /usr/cs/contrib/bin directory. Before running something you may want to make sure the command is provided by a user you can trust. In this environment trojan horses are possible. We rely on the responsible behavior of our students to make them unlikely.

How contrib Works

Different for Every Architecture
A different directory exists for /usr/cs on each architecture. This means that a different /usr/cs/contrib/ exists on each of these architectures, too. The architectures we currently support are:
1. SunOS 4.x
2. Solaris 2.x
3. AIX 3.2.5 and 4.1
4. IRIX 5.3 and 6.2

Because of the separation by architecture, building a program requires a separate compilation and installation for each supported architecture. Some files can be shared, however.
Sharing Across All Architectures
The following directories are shared:
  • /usr/cs/contrib/src
  • /usr/cs/contrib/man
  • /usr/cs/contrib/info
  • Everything under /usr/cs/contrib/share
  • This means that you only have to install the man pages once, and you only need to provide one copy of your source (if you want to put a copy out there at all).
    Additionally, if you install a program that has a lot of architecture-independent files, you can install those files once in /usr/cs/contrib/share and then use symbolic links in each architecture's /usr/cs/contrib to point to them.

    Installation Procedure

    Almost any software that has a Makefile has an install target. In other words, you type make install and it installs. You usually have to edit the Makefile to tell it where to go. For software packages that expect to install in /usr/local, this is especially easy.
    If the software expects to install in /usr/local, simply replace every instance of /usr/local in the Makefile with /usr/cs/contrib. Then, when you type make install, it will install into the correct locations.
    If the software does not support make install, then you need to install it by hand. The following guidelines explain most of what is involved. Every software package is a little different however.
  • Install binaries, shell scripts, and anything that you expect to type at the command line in /usr/cs/contrib/bin.
  • Install libraries in /usr/cs/contrib/lib
  • Install documentation that is not in the form of man pages in /usr/cs/contrib/doc
  • Install configuration information in /usr/cs/contrib/etc
  • Install man pages in /usr/cs/contrib/man
  • Put a copy of the source files (tarred and gzipped) in /usr/cs/contrib/src. This is optional, you do not have to provide source if you don't want to.
  • To install on multiple architectures, login on a machine of each architecture type and perform the installation.
  • For SunOS machines, login on larc or stretch.
  • For Solaris login on an interactive server (mamba, cobra, or viper)
  • A Word about Operating System Versions
    You need only compile and install your software for the operating systems you use/support. No need to feel pressured to compile for more than the architecture you use.

    If your installation procedure is simply make install, then do that on each architecture. If you have to manually install, then you'll have to do it on every architecture that you support.
    Some Caveats
    Before you install, you must edit the Makefile for the program. Here is a checklist of things that often need changing.
  • You need to tell it to use /usr/cs/contrib for all its paths. Frequently you can simply replace all instances of /usr/local with /usr/cs/contrib.
  • Remove the -g option from the CFLAGS unless you really think you are going to debug the program.
  • Check what CC it uses. gcc is often the best choice.
  • X programs are not in /usr/bin/X11 as some software expects. Use /X11.6/bin instead of /usr/bin/X11, etc.
  • Also, after you have installed, cd into /usr/cs/contrib/bin and run the strip command on all your binaries. This strips symbolic and debugging information out of them. It reduces file sizes dramatically. Many programs can be reduced as much as 50% by simply stripping them. Others do not reduce at all. Please do this to save disk space.