The name of that directory is [software]-[version], where we assume that [software] and [version] don't contain any dashes (convert any dashes to underscores, `-' to `_').
For example, emacs version 19.22 would be installed in a directory called emacs-19.22
The software, when configured, should reference the directory name with the version number. This allows one to install a different version of a software package without having collisions between the two versions. This means that the whole compilation process must be done for each new version of software.
In this way, everything related to a software package is located in one directory, namely [software]-[version]. There will be various references to these files, perhaps even copies of them local to machines, but for the most part the entire package is in this one directory.
Software Package Subdirectories
Each package directory should contain a set of standard directories,
it varies with each package, but most will need some, if not all of
the following:
Specifically, a collection of software contains a directory called packages. This directory contains a set of all the software packages in this collection. (All in the form of [software]-[version].)
The software collection directory also has a subdirectory for each of the directories that are known to be in software package directories. Thus it has a bin, a doc, an etc, and so on. Each of these directories is populated with symbolic links pointing to the various package-specific files.
As an example, consider an arbitrary collection of software, it contains the directories which users will reference:
[collection]/bin [collection]/etc [collection]/man/man? [collection]/lib [collection]/packages [collection]/srcIf emacs-19.25 is installed as part of this collection, then it will be in the packages subdirectory: [collection]/packages/emacs-19.25
The files in the emacs package will be mirrored in the collection directories, so if emacs has these files:
[collection]/packages/emacs-19.25/bin/emacs [collection]/packages/emacs-19.25/bin/etags [collection]/packages/emacs-19.25/lib/emacs-lispThen these files will be created:
[collection]/bin/emacs -> ../packages/emacs-19.25/bin/emacs [collection]/bin/etags -> ../packages/emacs-19.25/bin/etags [collection]/lib/emacs-lisp -> ../packages/emacs-19.25/lib/emacs-lispNotice that the symbolic links are made relative, not absolute. This will typically minimize the number of file systems references that will have to be made to locate the file. Further, it allows collections of software packages to be moved as a group without depending on the specific absolute pathname of the collection.
Also notice that the symbolic links refererence the version specific pointer (i.e. "emacs-19.25", not just "emacs"). Although it would seem to make sense to link to "emacs", and then only need to change this one link on a later update, however we have decided that since this is automated by tools, they will be able to resolve uneeded symbolic links. Also, an update to an application does not always contain the same programs/binaries, thus it makes more sense to use the tools to "un-link" the previous version, and "link" the new version.
All source code should be kept in the /ccs/src tree following the format of:
/ccs/src/[category]/[software]-[version].
When you pull down source from somewhere and try to install it, you may find that you need to modify certain files to get it to compile. When you have to modify something, always make a copy of the files to "filename.orig". If you know how to use RCS, it is even better to use, but if you don't, use the ".orig" convention. It really helps to keep these around so we know how the files originally looked.
If you find that you need to make different changes to files on different architectures, you should make backups of the files after they have been modified to work on a certain architecture, i.e. if a Makefile works only on sun4s, make a copy of it called 'Makefile.sun4'.
If you pulled some tricks to get something to compile, it would be useful to others if you document these changes. You should create the file 'Compiling.notes' under the package/Install directory. i.e. for perl, I created /arch/unix/packages/perl-4.036/Install/Compiling.notes which contains the notes on how I got it compiled. In the case of perl, I also realized that the only changes I made were to one file, the config.sh file, so I copied this into that directory as well; this will allow someone to recompile it without figuring out all the configuration options.
You'll be glad you followed these conventions.
Specifically, you should do a make clean (or whatever the package uses to clean up) to cleanup the software package, i.e. delete all of the compiled/generate stuff to conserve space. Then you should tar and compress the directory to the filename "[software]-[version].tar.gz". Once this is done, you can remove the directory.
To tar and compress the directory, you could do:
tar -cvf - software-version | gzip > software-version.tar.gzor if you use gnu tar, it's simpler:
tar -cvzf software-version.tar.gz software-version
You need determine which collection the applications belongs in. If you don't know, you could assume the unix collection and later verify if this is the right collection.
Unpack the source into /ccs/src/[category]/[software]-[version].
If the source is a compressed tar file, you can unpack it like this:
> cd /ccs/src > gzcat foo-1.0.tar.gz | tar xvf -Warning!! Make sure the tar file will create a directory for all of its files before you attempt to unpack it. (Some misbehaved source packages may just dump all its files right in your current directory.) Check the tar file first like this if you have any doubts:
> gzcat foo-1.0.tar.gz | tar tf - | headIf the package does not create a subdirectory in the form of [software]-[version], be sure to rename the directory to the proper syntax.
Build (compile) the software according to its own instructions. When configuring the software, specify that it will live in:
/arch/[collection]/packages/[software]-[version]
(with subdirectories bin, man, and so on underneath that).
If the program you're installing is actually just a shell script or some other type of shareable code, then it should be configured to be installed solely in:
/share/[collection]/packages/[software]-[version]
For example, most GNU software can be configured with:
./configure --prefix=/arch/gnu/packages/[software]-[version]If the program is not from GNU, how you configure it will vary greatly. You may need to manually edit the Makefile to configure it, it may have it's own configure-like program, or may not have any configuration options at all. It all depends on the package.
If you have to create Makefiles that only work on one kind of architecture, name them `Makefile.[arch]' or follow the conventions that the software package may be using. When building the software, create a symbolic link `Makefile' pointing to the particular Makefile for the architecture you're now building.
If you have to make any custom modifications to the software in order to make it build, documenting your changes in a file called "Compiling.notes", which should be placed under the "Install" directory of the installed application.
Also be sure to keep [file].orig files around if you have to make any custom changes. Alternatively, you can use RCS to track modifications to files.
When you're finished building the software, test it, both as you, and as `testuser'.
There are essentially four steps to installing software with softinst.
Be sure to thoroughly test the installation before announcing it. Veryfy that all of the files have the correct permissions for all users to read/execute the proper files.
If you made minor changes to the source, you may want to #ifdef them into the source. If you made major changes, mail the source back to the author, and tell them to incorporate the changes...
Finally, you should tar and compress the source directory for the package. To tar and compress the directory, you could do:
tar -cvf - software-version | gzip > software-version.tar.gzor if you use gnu tar, it's simpler:
tar -cvzf software-version.tar.gz software-versionThen remove the source directory:
rm -fr software-version