RSBAC packages Installation
---------------------------

Prerequisites:
-------------

You need to instal the following packages before you can continue:
 - make
 - gcc
 - binutils
 - coreutils
 - libc-dev (glibc 2.1+)
 - findutils
 - dialog
 - libtool
 
Might need (architecture dependent):
 - kernel-headers

For pam:
 - pam-dev
 

This list is non-exhaustive and you might need other packages,
depending on your operating system

Notes about distributions and packages making:
---------------------------------------------

The main/libs directory has essential RSBAC libraries, which need to be available at all times. Thus, it is recommanded to override their default location to /lib instead of $(PREFIX)/lib (which will be /usr/lib usually). This allows the system to come up even if /usr is not mounted for some reason.

This cause a problem with the FHS, because .a and .la archives will be automatically installed by libtool into /lib, next to the .so (the real library).

To alleviate this problem, you must move the .a and .la archives to /usr/lib, and either symlink /usr/lib/libraryname.so to /lib/libraryname.so (easy and clean) either write a script telling the linked to look in /lib (gentoo-style).


Options:
-------

There are several options you can set for the compilation or installation.
You can set them this way:
$ make target OPTION=value OPTION1=value ...

Sparc machines are known to compile with:
$ make install CFLAGS="-mcpu=ultrasparc"

If you do not have gettext (uclibc), you will need:
$ make install NLS=0

You can get a list of options by doing:
$ make -p

Or by browsing the Makefiles for directories or special variables.

Other common values are PREFIX or DESTDIR, for example:
$ make PREFIX=/usr
the above will install into /usr (like, /usr/bin)

or
$ make PREFIX=/usr DESTDIR=/chroot/another_install/
the above will install into /chroot/another_install/usr (like, /chroot/another_install/usr/bin)

If not detected correctly, you can also select the architecture you are compiling RSBAC libraries for with the ARCH setting. Warning, ARCH is only used for this very case. The tradionnal HOST setting is used in other cases.
$ make ARCH=i386

Make sure to check your architecture exists in ``main/libs/asm-arches' first. You can guess it by running either:
$ uname -m
or
$ gcc -dumpmachine

Likewise, LIBDIR is set automatically to /lib64 if your system is listed as a 64bit architecture. This detection ignore the ARCH setting, but not the HOST setting. You can override this by setting LIBDIR manually, for example:
$ make LIBDIR=/lib
or
$ make LIBDIR=/lib64

If you wish to debug the build process, use:
$ make VERBOSE=1


Available targets per package:
-----------------------------

You have to change to the package directory first :)

To make a target:
$ make <target>

Each package contains similar targets:

install: effectively tries to install the package, please have administrator privileges !

install-strip: same, stripping binaries (removes symbols, debug stuff, smaller binaries)

uninstall: attempts to remove every file installed by the package, you also need administrator privileges.

clean: remove all object files, possibly binaries if no object files are present.
distclean: restore the original state of the directory, by running clean and removing every binary or file left during the build process

Simply typing make will only build the package.
