AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

Need support for licensing #48

Closed Artoria2e5 closed 9 years ago

Artoria2e5 commented 9 years ago

Multiple PMs traditionally handles this in different ways.

A proposal with basic license text to be shipped with AOSC OS3, named by SPDX 2.0 https://spdx.org/licenses/ Licence code will be written in 16 hours.

Artoria2e5 commented 9 years ago

Autobuild Licensing (Draft)

Autobuild provides a scheme for handling SPDX-listed licenses. Licenses outside of the list will be put in the software packages doc directory.

Licenses are defined in an array $PKGLICENSE. The array contains one or more SPDX-compatible license strings.

Standards:

SPDX License Strings

A package named spdx-licenses should exist. It would be installed to /usr/share/spdx-licenses, with all the contents of http://git.spdx.org/license-list.git.

We will delete all the deprecated* files, as well as MAC-OS/Git Generated files. The *.xls files will also be deleted.

We are going to dump the table exceptions of spdx_licenselist_v2.1.ods to a text file. More specifically, We dump the exception text to exceptions/ExceptionIdentifier.txt.

Since exceptions are typically used with one or more specific licenses, we may add the last line as a shell pattern (to use with [[ == ]] and case) to check.

License Exception handling

if an exception comes with a ^Use With: line, more preferably in the last line, autobuild will treat the rest of this line as a shell glob and give a warning on mismatch.

Note: Some exceptions are just often used with a certain license, so we only throw warnings. (The real reason is I can't find a nice way to express ^Commonly used with. Wait, what did I say?)

Other Licenses

All explicitly defined other licenses will be ignored and autobuild will attempt to copy all the license text (that means @(COPYING|LICENSE)*) to the package's doc dir. The license should not be split.

If the PKGLICENSE value is left blank, autobuild will try to compare the license files found with those defined in spdx-licenses to find a match. If it fails, it falls back to the doc.

Package Managers

Basically the PKGLICENSE array will be dumped with abcommaprint, where AB_COMMA is ', '.

RPM has a license list and we will dump it there; for DPKG we have a Long-Description stuff.

Artoria2e5 commented 9 years ago

Edit: We use a much simpler method to deal with exceptions, by providing only a native list.