Licenses

From Gentoo Linux Wiki

Jump to: navigation, search

As of Portage 2.1.7, the ability to manage the licenses of installed software is available. This document explains how to specify the allowed licenses and find out information on them.

Contents

[edit] Global: make.conf

The list of allowed licenses can be set through 2 methods. On a global basis, licenses can be managed via the ACCEPT_LICENSE option in /etc/make.conf.

The default value for ACCEPT_LICENSE is:

ACCEPT_LICENSE="* -@EULA"

This allows all licenses, except those in the EULA license group. License groups are discussed below in the Getting License Information section.

You can check the current setting for your system by running:

emerge --info -v | grep LICENSE

[edit] Per Package: package.license

Licenses can also be managed on a per package basis using /etc/portage/package.license, which does not exist by default. The format of this file is similar to package.keywords or package.use. It contains a package specification followed by a list of allowed licenses.

For example, to allow the dlj-1.1 license for dev-java/sun-jdk, add the following to package.license:

dev-java/sun-jdk dlj-1.1

[edit] Getting License Information

The list of licenses for packages in the official tree can be found in the licenses/ subdirectory of the official tree. By default this is /usr/portage/licenses/.

The list of license groups (which can be specified using the @ prefix, similar to the specification of package sets) are defined in /usr/portage/profiles/license_groups.

You can find out the license that a given package is under using a package search via emerge or eix. Web based interfaces such as packages.gentoo.org and gentoo-portage.com also show the license.

For example:
emerge --search sun-jdk

Shows:

*  dev-java/sun-jdk
      Latest version available: 1.6.0.17
      Latest version installed: 1.6.0.17
      Size of files: 159,892 kB
      Homepage:      http://java.sun.com/javase/6/
      Description:   Sun's Java SE Development Kit
      License:       dlj-1.1

[edit] Common Setups

To accept only free software licenses, you can set the following in your make.conf:

ACCEPT_LICENSE="-* @FREE"

License group "@FREE" expands to licenses approved by the Free Software Foundation or by the Open Source Initiative, and some other free licenses. See /usr/portage/profiles/license_groups for details.

[edit] See Also

Personal tools