3.5. Using Software Collections over NFS

In some environments, the requirement is often to have a centralized model for how applications and tools are distributed rather than allowing users to install the application or tool version they prefer. In this way, NFS is the common method of mounting centrally managed software.
To use a Software Collection over NFS, you need to define a Software Collection macro nfsmountable. If you define the macro when building a Software Collection, the resulting Software Collection has its state files and configuration files located outside the Software Collection's /opt file system hierarchy. This enables you to mount the /opt file system hierarchy over NFS as read-only.
To build a Software Collection with the nfsmountable macro defined, run the following command:
 rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1' 
where software_collection is the name of the Software Collection. Defining the macro changes the values for the _sysconfdir, _sharedstatedir, and _localstatedir macros. The changed values are detailed in the following table.

Table 3.1. Changed Values for Software Collection Macros

Original definition
Expanded value for the original definition
Changed definition
Expanded value for the changed definition
Note that the expanded values for the changed definitions contain a /scls directory in their paths.

3.5.1. Changed Directory Structure and File Ownership

The nfsmountable macro also has an impact on how the scl_install and scl_files macros create a directory structure and set the file ownership when you run the rpmbuild command.
For example, a directory structure of a Software Collection named software_collection looks as follows:
$ rpmbuild -ba software_collection.spec --define 'scl software_collection' --define 'nfsmountable 1'
$ rpm -qlp software_collection-runtime-1-1.el6.x86_64