Subpackages

Some ports contain multiple wildly different packages. This isn’t like adding LDAP support to Apache or Motif support to Vim—those are changes to the existing package, not wildly different. Some ports create two completely different packages, such as a database client and the associated database server. I’ve drawn in OpenLDAP through this chapter’s examples, and both the OpenLDAP server and client come from the same port: databases/openldap. Other applications might have plug-ins for accessing several different database engines. These are called subpackages or multipackages.

Unlike flavors, OpenBSD provides all subpackages of a port. You can install both the server and client versions of OpenLDAP from official packages. When the port is built, all the subpackages are built. The package is split into subpackages at the package-bundling stage.

To see all the subpackages supported by a port, run the following command:

# cd /usr/ports/databases/openldap
# make show=MULTI_PACKAGES
-main -server

This port has two subpackages: openldap-main and openldap-server.

How can you learn what each subpackage includes? As with flavors, you can check its description file, which is pkg/DESCR. OpenLDAP includes pkg/DESCR-server and pkg/DESCR-main. Reading these shows that the main package is the client, as you would expect.

If you run make install in the port directory, you get the main version of the port—in this case, the OpenLDAP client. OpenLDAP clients outnumber the servers, so that’s also what you would expect. To build a different subpackage, set SUBPACKAGE in the environment on the command line, as you did for flavors.

# env SUBPACKAGE="-server" make package

This builds the -server version. Be sure to include the leading dash, as specifying a nonexistent subpackage makes the build fail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.121.101