diff --git a/Cabal/doc/developing-packages.rst b/Cabal/doc/developing-packages.rst index 737b6187fb96dec189868901934932a3b4c1d84e..b89efd5ad2ef6ccf233c95cc138d1348902fc349 100644 --- a/Cabal/doc/developing-packages.rst +++ b/Cabal/doc/developing-packages.rst @@ -915,14 +915,79 @@ describe the package as a whole: For most packages, the build type ``Simple`` is sufficient. -.. pkg-field:: license: identifier +.. pkg-field:: license: SPDX expression + + :default: ``NONE`` + + The type of license under which this package is distributed. + + Starting with ``cabal-version: 2.2`` the ``license`` field takes a + (case-sensitive) SPDX expression such as + + .. code-block:: cabal + + license: Apache-2.0 AND (MIT OR GPL-2.0-or-later) + + See `SPDX IDs: How to use <https://spdx.org/ids-how>`__ for more + examples of SPDX expressions. + + The version of the + `list of SPDX license identifiers <https://spdx.org/licenses/>`__ + is a function of the :pkg-field:`cabal-version` value as defined + in the following table: + + +--------------------------+--------------------+ + | Cabal specification | SPDX license list | + | version | version | + | | | + +==========================+====================+ + | ``cabal-version: 2.2`` | ``3.0 2017-12-28`` | + +--------------------------+--------------------+ + | ``cabal-version: 2.4`` | ``3.2 2018-07-10`` | + +--------------------------+--------------------+ + + **Pre-SPDX Legacy Identifiers** + + The license identifier in the table below are defined for + ``cabal-version: 2.0`` and previous versions of the Cabal + specification. + + +--------------------------+-----------------+ + | :pkg-field:`license` | Note | + | identifier | | + | | | + +==========================+=================+ + | ``GPL`` | | + | ``GPL-2`` | | + | ``GPL-3`` | | + +--------------------------+-----------------+ + | ``LGPL`` | | + | ``LGPL-2.1`` | | + | ``LGPL-3`` | | + +--------------------------+-----------------+ + | ``AGPL`` | since 1.18 | + | ``AGPL-3`` | | + +--------------------------+-----------------+ + | ``BSD2`` | since 1.20 | + +--------------------------+-----------------+ + | ``BSD3`` | | + +--------------------------+-----------------+ + | ``MIT`` | | + +--------------------------+-----------------+ + | ``ISC`` | since 1.22 | + +--------------------------+-----------------+ + | ``MPL-2.0`` | since 1.20 | + +--------------------------+-----------------+ + | ``Apache`` | | + | ``Apache-2.0`` | | + +--------------------------+-----------------+ + | ``PublicDomain`` | | + +--------------------------+-----------------+ + | ``AllRightsReserved`` | | + +--------------------------+-----------------+ + | ``OtherLicense`` | | + +--------------------------+-----------------+ - :default: ``AllRightsReserved`` - - The type of license under which this package is distributed. License - names are the constants of the - `License <../release/cabal-latest/doc/API/Cabal/Distribution-License.html#t:License>`__ - type. .. pkg-field:: license-file: filename diff --git a/Cabal/doc/file-format-changelog.rst b/Cabal/doc/file-format-changelog.rst index ff9aa574b4967d204b32881cbe38a561b16d6032..e5eaa66d4dbf5abb9f4170ed14d2e2bf3a713c1e 100644 --- a/Cabal/doc/file-format-changelog.rst +++ b/Cabal/doc/file-format-changelog.rst @@ -1,7 +1,7 @@ .. _spec-history: ================================================== - Package description format specification history + Package Description Format Specification History ================================================== :ref:`pkg-desc` need to specify the version of the @@ -67,7 +67,7 @@ relative to the respective preceding *published* version. "build-type:" for "Simple"/"Custom" automatically. * :pkg-field:`license` field syntax changed to require SPDX - expression syntax. + expression syntax (using SPDX license list version ``3.0 2017-12-28``). * Allow redundant leading or trailing commas in package fields (which require commas) such as :pkg-field:`build-depends`.