pkgname=licenses pkgver=3.26.0 pkgrel=1 pkgdesc="A set of common license files" arch=('x86_64') url="https://www.archlinux.org" license=('LicenseRef-None)') makedepends=('jq') source=(https://github.com/spdx/license-list-data/archive/v${pkgver}/${pkgname%s}-list-data-${pkgver}.tar.gz) sha256sums=(71eb720dffab6a8fd7a0d61f38bf6e8b4ce72cf05e6d21e7be34b8a47a16cd62) prepare() { cd ${pkgname%s}-list-data-${pkgver} local license touch known_spdx_license_exceptions.txt known_spdx_license_identifiers.txt # create list of known, non-deprecated SPDX license identifiers for license in $(jq -r '.licenses[] | select(.isDeprecatedLicenseId == false) | .licenseId' json/licenses.json); do printf "%s\n" "$license" >> known_spdx_license_identifiers.txt done # create list of known SPDX exception identifiers for license in $(jq -r '.exceptions[] | .licenseExceptionId' json/exceptions.json); do printf "%s\n" "$license" >> known_spdx_license_exceptions.txt done } package() { cd ${pkgname%s}-list-data-${pkgver} local license local standard_licenses=( AGPL-3.0-only AGPL-3.0-or-later Apache-2.0 Artistic-1.0-Perl Artistic-2.0 BSL-1.0 CC0-1.0 CC-BY-1.0 CC-BY-2.0 CC-BY-2.5 CC-BY-3.0-AT CC-BY-3.0 CC-BY-3.0-US CC-BY-4.0 CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5 CC-BY-NC-3.0 CC-BY-NC-4.0 CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0 CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0-IGO CC-BY-NC-ND-3.0 CC-BY-NC-ND-4.0 CC-BY-NC-SA-1.0 CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0 CC-BY-NC-SA-4.0 CC-BY-ND-1.0 CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0 CC-BY-ND-4.0 CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.0-UK CC-BY-SA-2.1-JP CC-BY-SA-2.5 CC-BY-SA-3.0-AT CC-BY-SA-3.0 CC-BY-SA-4.0 CC-PDDC CDDL-1.0 CDDL-1.1 CPL-1.0 EPL-1.0 EPL-2.0 FSFAP GFDL-1.1-invariants-only GFDL-1.1-invariants-or-later GFDL-1.1-no-invariants-only GFDL-1.1-no-invariants-or-later GFDL-1.1-only GFDL-1.1-or-later GFDL-1.2-invariants-only GFDL-1.2-invariants-or-later GFDL-1.2-no-invariants-only GFDL-1.2-no-invariants-or-later GFDL-1.2-only GFDL-1.2-or-later GFDL-1.3-invariants-only GFDL-1.3-invariants-or-later GFDL-1.3-no-invariants-only GFDL-1.3-no-invariants-or-later GFDL-1.3-only GFDL-1.3-or-later GPL-1.0-only GPL-1.0-or-later GPL-2.0-only GPL-2.0-or-later GPL-3.0-only GPL-3.0-or-later GPL-CC-1.0 LGPL-2.0-only LGPL-2.0-or-later LGPL-2.1-only LGPL-2.1-or-later LGPL-3.0-only LGPL-3.0-or-later LGPLLR LPPL-1.0 LPPL-1.1 LPPL-1.2 LPPL-1.3a LPPL-1.3c MPL-1.0 MPL-1.1 MPL-2.0 PHP-3.01 PHP-3.0 PSF-2.0 Ruby Unlicense WTFPL W3C ZPL-1.1 ZPL-2.0 ZPL-2.1 ) local standard_exceptions=( GPL-3.0-linking-exception GPL-3.0-linking-source-exception LGPL-3.0-linking-exception LLGPL Linux-syscall-note MPL-2.0-no-copyleft-exception ) for license in ${standard_licenses[@]}; do install -vDm 644 text/${license}.txt -t ${pkgdir}/usr/share/licenses/spdx/ done for license in ${standard_exceptions[@]}; do install -vDm 644 text/${license}.txt -t ${pkgdir}/usr/share/licenses/spdx/exceptions/ done install -vDm 644 known_spdx_license_identifiers.txt -t ${pkgdir}/usr/share/licenses/ install -vDm 644 known_spdx_license_exceptions.txt -t ${pkgdir}/usr/share/licenses/ }