From 02d9a1de9e840664e6516f6c11c82488cadda090 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 21 Aug 2022 08:27:01 +0200 Subject: [PATCH] Make reuse conformant (#5138) * Add .license files. * Add reuse test. * Update README. * Also remove .yaml changelog fragments. * Add changelog fragment. * Normalize licenses extra sanity test. * Declare REUSE conformance. * Update README.md --- .github/workflows/reuse.yml | 30 +++++++++++++++++++ .reuse/dep5 | 5 ++++ CHANGELOG.rst.license | 3 ++ README.md | 8 +++-- changelogs/changelog.yaml.license | 3 ++ changelogs/fragments/licenses-2.yml | 2 ++ tests/sanity/extra/aliases.json.license | 3 ++ tests/sanity/extra/botmeta.json.license | 3 ++ tests/sanity/extra/extra-docs.json.license | 3 ++ tests/sanity/extra/licenses.json.license | 3 ++ tests/sanity/extra/licenses.py | 11 +++---- tests/sanity/extra/licenses.py.license | 3 ++ .../extra/no-unwanted-files.json.license | 3 ++ tests/sanity/ignore-2.11.txt.license | 3 ++ tests/sanity/ignore-2.12.txt.license | 3 ++ tests/sanity/ignore-2.13.txt.license | 3 ++ tests/sanity/ignore-2.14.txt.license | 3 ++ 17 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/reuse.yml create mode 100644 .reuse/dep5 create mode 100644 CHANGELOG.rst.license create mode 100644 changelogs/changelog.yaml.license create mode 100644 changelogs/fragments/licenses-2.yml create mode 100644 tests/sanity/extra/aliases.json.license create mode 100644 tests/sanity/extra/botmeta.json.license create mode 100644 tests/sanity/extra/extra-docs.json.license create mode 100644 tests/sanity/extra/licenses.json.license create mode 100644 tests/sanity/extra/licenses.py.license create mode 100644 tests/sanity/extra/no-unwanted-files.json.license create mode 100644 tests/sanity/ignore-2.11.txt.license create mode 100644 tests/sanity/ignore-2.12.txt.license create mode 100644 tests/sanity/ignore-2.13.txt.license create mode 100644 tests/sanity/ignore-2.14.txt.license diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 0000000000..d2b0dc915f --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,30 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +name: Verify REUSE + +on: + push: + branches: [main] + pull_request: + branches: [main] + # Run CI once per day (at 07:30 UTC) + schedule: + - cron: '30 7 * * *' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + pip install reuse + + - name: Check REUSE compliance + run: | + reuse lint diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 0000000000..0c3745ebf8 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,5 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: changelogs/fragments/* +Copyright: Ansible Project +License: GPL-3.0-or-later diff --git a/CHANGELOG.rst.license b/CHANGELOG.rst.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/CHANGELOG.rst.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/README.md b/README.md index 92a4421393..d38a5653ec 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,10 @@ See [this issue](https://github.com/ansible-collections/community.general/issues ## Licensing -GNU General Public License v3.0 or later. +This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later. -See [COPYING](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text. +See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/main/COPYING) for the full text. + +Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/main/LICENSES/PSF-2.0.txt). + +All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `.reuse/dep5`. This conforms to the [REUSE specification](https://reuse.software/spec/). diff --git a/changelogs/changelog.yaml.license b/changelogs/changelog.yaml.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/changelogs/changelog.yaml.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/changelogs/fragments/licenses-2.yml b/changelogs/fragments/licenses-2.yml new file mode 100644 index 0000000000..1515dabfc5 --- /dev/null +++ b/changelogs/fragments/licenses-2.yml @@ -0,0 +1,2 @@ +minor_changes: + - "The collection repository conforms to the `REUSE specification `__ except for the changelog fragments (https://github.com/ansible-collections/community.general/pull/5138)." diff --git a/tests/sanity/extra/aliases.json.license b/tests/sanity/extra/aliases.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/aliases.json.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/extra/botmeta.json.license b/tests/sanity/extra/botmeta.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/botmeta.json.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/extra/extra-docs.json.license b/tests/sanity/extra/extra-docs.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/extra-docs.json.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/extra/licenses.json.license b/tests/sanity/extra/licenses.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/licenses.json.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/extra/licenses.py b/tests/sanity/extra/licenses.py index 7fdc21bcae..6227ee22f2 100755 --- a/tests/sanity/extra/licenses.py +++ b/tests/sanity/extra/licenses.py @@ -33,7 +33,8 @@ def find_licenses(filename, relax=False): has_copyright = True idx = line.find('SPDX-License-Identifier: ') if idx >= 0: - spdx_license_identifiers.append(line[idx + len('SPDX-License-Identifier: '):]) + lic_id = line[idx + len('SPDX-License-Identifier: '):] + spdx_license_identifiers.extend(lic_id.split(' OR ')) if 'GNU General Public License' in line: if 'v3.0+' in line: other_license_identifiers.append('GPL-3.0-or-later') @@ -67,18 +68,14 @@ def main(): no_comments_allowed = [ 'changelogs/fragments/*.yml', 'changelogs/fragments/*.yaml', - 'tests/sanity/extra/*.json', - 'tests/sanity/ignore-2.*.txt', - 'COPYING', ] # These files are completely ignored ignore_paths = [ - 'CHANGELOG.rst', - 'changelogs/changelog.yaml', - 'tests/sanity/extra/licenses.py', # The strings in find_licenses() confuse this code :-) '.ansible-test-timeout.json', + '.reuse/dep5', 'LICENSES/*.txt', + 'COPYING', ] no_comments_allowed = [fn for pattern in no_comments_allowed for fn in glob.glob(pattern)] diff --git a/tests/sanity/extra/licenses.py.license b/tests/sanity/extra/licenses.py.license new file mode 100644 index 0000000000..6c4958feba --- /dev/null +++ b/tests/sanity/extra/licenses.py.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: 2022, Felix Fontein diff --git a/tests/sanity/extra/no-unwanted-files.json.license b/tests/sanity/extra/no-unwanted-files.json.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/extra/no-unwanted-files.json.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/ignore-2.11.txt.license b/tests/sanity/ignore-2.11.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.11.txt.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/ignore-2.12.txt.license b/tests/sanity/ignore-2.12.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.12.txt.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/ignore-2.13.txt.license b/tests/sanity/ignore-2.13.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.13.txt.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project diff --git a/tests/sanity/ignore-2.14.txt.license b/tests/sanity/ignore-2.14.txt.license new file mode 100644 index 0000000000..edff8c7685 --- /dev/null +++ b/tests/sanity/ignore-2.14.txt.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project