mksyscompat — Update system resources


mksyscompat [--force]


The mksyscompat script is the equivalent of mklpmcompat(1) for systems that do not use RPM.

When a LPMtool package is created by the lpbuild command, lpbuild determines the list of libraries, modules, and other dependencies the package needs. This becomes the list of resources that must be present before the package can be installed. All binary programs, for example, use the standard C runtime library. Therefore, the C runtime library is listed as a required resource of any package that installs an executable binary program.

When the package gets installed, LPMtool checks and makes sure that all required resources are present. However, unless the C runtime library itself was installed by LPMtool, LPMtool naturally wouldn't know anything about it.

This becomes a problem on any system that does not use LPMtool exclusively to install everything. Because LPMtool did not install the standard C library, LPMtool doesn't know anything about it. When lpbuild creates a package with a binary program, lpbuild automatically records that this package requires the standard C library; but when lpm tries to install this package, it fails because lpm doesn't know anything about it. The standard C library is installed by the system's package management system, not LPMtool.

The mksyscompat script tries to solve this problem. mksyscompat reads a predefined list of directories. mksyscompat records all libraries, modules, and other resources that it finds in those directories. mksyscompat compiles this list of resources, then creates a dummy package called lpmcompat, that claims those resources as its own. The mksyscompat script then automatically installs this package, thus populating LPMtool's internal database with the list of installed resources, such as the C runtime library. Now, packages that require the C runtime library can now be installed, because LPMtool knows about it.

Systems that use RPM should use the mklpmcompat script instead, which has the same purpose, but it pulls the list of installed resources straight out of the RPM database.

After installing or removing system libraries, the mksyscompat script should be run again, to update the list of available resources.


mksyscompat needs to know the list of directories where system libraries, modules, and other scripts are installed. mksyscompat reads the /etc/lpmsyscompat directory, if it exists. Each file in this directory is read. Each file may contain the following settings:

libdir directory

mksyscompat searches for all shared libraries and modules in directory, and adds them to the LPMtool resource database.

bindir directory

mksyscompat adds all individual files in directory to the resource database.

package name [ file ]

Explicitly list name as a literal resource. file is optional; if specified, name gets listed as a literal resource only if the file exists.

This is mainly needed to build software that explicitly lists a package name as a required resource for building. For example, a LPMtool specfile for software that uses OpenSSL may contain this:

BuildRequires: openssl-devel

Libraries and header files, that are needed to build software that uses OpenSSL, are typically installed by a package called openssl-devel, and this BuildRequires: directive normally insures that this package is present. Well, mksyscompat only knows what's been installed by LPMtool, and doesn't really know the names of all software packages that were installed by the system. One way around this specific situation is to put the following statement in some file in /etc/lpmsyscompat:

package openssl-devel /usr/include/openssl/ssl.h

Therefore, if /usr/include/openssl/ssl.h exists, mksyscompat lists openssl-devel as a resource.

Default resources

If the /etc/lpmsyscompat directory does not exist, mksyscompat falls back to the following, bare-bones configuration:

libdir /lib
libdir /usr/lib
libdir /usr/local/lib
libdir /usr/X11R6/lib
libdir /lib64
libdir /usr/lib64
libdir /usr/local/lib64
libdir /usr/X11R6/lib64
bindir /bin
bindir /usr/bin
bindir /usr/local/bin
bindir /etc/passwd
bindir /etc/group


/etc/lpmsyscompat is the default location of the mksyscompat configuration directory. A custom vesion of LPMtool may use a different configuration directory.


The above fallback configuration is used only if /etc/lpmsyscompat does not exist. After creating this directory, the default directories must be manually listed in /etc/lpmsyscompat.

/etc/lpmsyscompat must be a directory.


The last two lines in the fallback configuration deserve an extra explanation. Their intended effect is to list two files, /etc/passwd and /etc/group, as resources. This is almost always required, because packages that include files whose owning username or groupname is not root will always have these two dependencies listed as required resources. See Section 2.1, “Required resources: /etc/passwd, /etc/group in LPMtool's documentation for more information.

Using mksyscompat

The default LPMtool package installs the above bare-bones configuration file in /etc/lpmsyscompat. Run mksyscompat to get the initial resource list loaded. Attempt to run lpbuild to build a software package. If lpbuild refuses to build a package due to a missing dependency with a familiar name, after confirming that the required dependency is present, create a new file in /etc/lpmsyscompat, add whatever configuration directive are necessary to recognize the presence of the dependency (probably a package, but a bindir or libdir naming an entire directory could be the correct solution also). Run mksyscompat and try again.

When the software package is succesfully built, try to install it. If the installation fails due to an allegedly missing library or module, use the name of the missing dependency to find where the required shared library or module is installed, add the libdir setting, rerun mksyscompat, and try again.

Use the following rule of thumb: when the missing dependency is an absolute filename, such as /usr/gizmoApp/bin/gizmo, add a bindir /usr/gizmoApp/bin setting, to pick up all files from this directory. When the missing dependency appears to be a name of a library or a module, such as, find where this library is installed, it's probably /usr/gizmoApp/lib/ Add libdir /usr/gizmoApp/lib, rerun mksyscompat, and try again.