.tito
.gitignore
LICENSE
README.md
all-packages.txt
already-migrated-packages.txt
eln-list.txt
eln-not-migrated.txt
eln-without-buildroot.txt
fedora-approved-licenses.txt
final_just_packages.txt
grammar-shortnames.lark
grammar.lark
ignore-packages.txt
license-fedora2spdx.asciidoc
license-rustyonly.txt
license-validate.1.asciidoc
license-validate.spec
not-migrated-packages.txt
package-license-rustonly.txt
packages-before-spdx-was-standard.txt
packages-for-conversion-Artistics.txt
packages-for-conversion-ERPL.txt
packages-for-conversion-EUDatagrid.txt
packages-for-conversion-EUPL.txt
packages-for-conversion-MPL.txt
packages-for-conversion-OSL.txt
packages-for-conversion-SPL.txt
packages-for-conversion-ZPL.txt
packages-for-conversion.txt
packages-has-not-been-migrated.txt
packages-with-git-up2date.txt
packages-without-spdx-final-maintainers.txt
packages-without-spdx-final.txt
packages-without-spdx-in-distgit-changelog.txt
packages-without-spdx-in-spec-changelog-grepped.txt
packages-without-spdx-in-spec-changelog.txt
rust-notvalid.txt
check-all-licenses
complete-check.sh
convert-all-licenses
convert-all-licenses-for-diff
convert-spec.py
create-grammar.py
download-all-fedora-licenses
fedpkg-clone-and-cd-package.sh
generate-done-list.sh
generate-shortnames.py
git-clone-package.sh
git-clone-packages.sh
ignore-packages.py
license-fedora2spdx.py
license-invalid-as-spdx.sh
license-validate.py
packages-before-spdx-was-standard.sh
packages-with-invalid-license.sh
packages-without-spdx-in-distgit-changelog.sh
packages-without-spdx-in-spec-changelog.sh
print-distgit-log.sh
print-spec-changelog.py
show-statistics.sh
update-eln-sheet.sh
validate-grammar.py
README.md

license-validate

Validate whether license is in approved set

This script checks whether string specified in SPEC file conforms to list of approved licenses.

E.g. MIT or GPLv1 is good license string, but BSD and GPL will fail to validate, because Fedora use GPLv1 short name for GPL.

This script does not check source files and does not check whether the license is actually correct. For this purpose you may use licensecheck.

Content:

  • fedora-approved-licenses.txt - contains list of licenses from Fedora Licensing:Main. This is manually synced with the wiki. The file can contain empty lines and comments.
  • grammar.lark - this file contains BNF grammar for Lark. It miss one line: license_item: "MIT"|"GPLv1"|...". This line is added there dynamically by create-grammar.py.
  • create-grammar.py - read grammar.lark and accepts filename as argument (usually approved-licenses.txt) and prints complete grammar.

Quickstart

dnf install license-validate
license-validate 'LGPL-2.1-or-later AND GPL-2.0-or-later'
license-fedora2spdx 'GPLv1'
# GPL-1.0-only

Run from checkout

./create-grammar.py fedora-approved-licenses.txt > full-grammar.lark
# optionally to test the grammar
./validate-grammar.py full-grammar.lark
./license-validate.py -v --file full-grammar.lark 'GPLv1 or MIT'

LICENSE

MIT