diff options
author | Remi Collet <remi@remirepo.net> | 2022-04-20 15:50:24 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2022-04-20 15:50:24 +0200 |
commit | 2d5383ea147530fb42f371226b90e4fdb5eb692b (patch) | |
tree | b56740e643d40587061e3d60da7945f34fb5b0b6 | |
parent | 8290b52748f2c395a22997d16c88df67dad659ac (diff) |
sort bundled libraries list by license
-rw-r--r-- | roundcubemail-bundled.php | 29 | ||||
-rw-r--r-- | roundcubemail.spec | 54 |
2 files changed, 54 insertions, 29 deletions
diff --git a/roundcubemail-bundled.php b/roundcubemail-bundled.php index 2acae7b..c963e9e 100644 --- a/roundcubemail-bundled.php +++ b/roundcubemail-bundled.php @@ -16,24 +16,33 @@ if (!is_array($pkgs)) { exit(3); } -$lic = []; if (isset($pkgs['packages'])) { - foreach($pkgs['packages'] as $pkg) { - printf("Provides: bundled(php-%s) = %s\n", str_replace(['/', '_'], ['-', '-'], $pkg['name']), $pkg['version']); - $lic = array_merge($lic, $pkg['license']); + $res = []; + foreach($pkgs["packages"] as $pkg) { + $lic = implode(" and ", $pkg["license"]); + if (!isset($res[$lic])) $res[$lic] = []; + $res[$lic][] = sprintf("Provides: bundled(php-%s) = %s", str_replace(["/", "_"], ["-", "-"], $pkg["name"]), $pkg["version"]); + } + ksort($res); + foreach($res as $lic => $lib) { + sort($lib); + printf("# License %s\n%s\n", $lic, implode("\n", $lib)); } } else if (isset($pkgs['dependencies'])) { + $res = []; foreach($pkgs['dependencies'] as $pkg) { $n = strtolower($pkg['name'] ?? $pkg['lib']); $n = str_replace('.js', '', $n); - printf("Provides: bundled(js-%s) = %s\n", $n, $pkg['version']); - if (isset($pkg['license'])) { - $lic[] = $pkg['license']; - } + $lic = ($pkg['license'] ?? "Unkown"); + if (!isset($res[$lic])) $res[$lic] = []; + $res[$lic][] = sprintf("Provides: bundled(js-%s) = %s", $n, $pkg['version']); + } + ksort($res); + foreach($res as $lic => $lib) { + sort($lib); + printf("# License %s\n%s\n", $lic, implode("\n", $lib)); } } else { echo "unkown content\n"; exit(4); } -sort($lic); -printf("\nLicense: %s\n", implode(' and ', array_unique($lic))); diff --git a/roundcubemail.spec b/roundcubemail.spec index 5adcddc..13c89ad 100644 --- a/roundcubemail.spec +++ b/roundcubemail.spec @@ -127,41 +127,57 @@ Suggests: php-pam # Bundled JS libraries # see https://github.com/roundcube/roundcubemail/blob/master/jsdeps.json -Provides: bundled(js-jquery) = 3.5.1 -Provides: bundled(js-jstimezonedetect) = 1.0.7 +# License Apache-2.0 +Provides: bundled(js-lessjs) = 3.13.0 +# License GPLv3 Provides: bundled(js-publickey) = 0e011cb1 -Provides: bundled(js-tinymce) = 5.8.2 -Provides: bundled(js-tinymce-langs) = 5.8.2 +# License LGPL Provides: bundled(js-openpgp) = 5.0.0 -Provides: bundled(js-codemirror) = 5.58.3 +Provides: bundled(js-tinymce) = 5.8.2 +# License MIT Provides: bundled(js-bootstrap) = 4.5.3 -Provides: bundled(js-lessjs) = 3.13.0 +Provides: bundled(js-codemirror) = 5.58.3 +Provides: bundled(js-jquery) = 3.5.1 +Provides: bundled(js-jstimezonedetect) = 1.0.7 +# License Unkown +Provides: bundled(js-tinymce-langs) = 5.8.2 + # Bundled PHP libraries # see vendor/composer/installed.json +# License BSD +Provides: bundled(php-pear-auth-sasl) = v1.1.0 +# License BSD-2-Clause +Provides: bundled(php-bacon-bacon-qr-code) = 2.0.6 Provides: bundled(php-dasprid-enum) = 1.0.3 +Provides: bundled(php-pear-console-getopt) = v1.4.3 +Provides: bundled(php-pear-net-sieve) = 1.4.5 +Provides: bundled(php-pear-net-smtp) = 1.10.0 +Provides: bundled(php-pear-pear-exception) = v1.0.2 +# License BSD-3-Clause +Provides: bundled(php-pear-mail-mime) = 1.10.11 +Provides: bundled(php-pear-pear-core-minimal) = v1.10.11 +# License GPL-2.0 +Provides: bundled(php-roundcube-rtf-html-php) = v2.1 +# License GPL-3.0+ +Provides: bundled(php-kolab-net-ldap3) = v1.1.3 +Provides: bundled(php-roundcube-plugin-installer) = 0.3.1 +# License LGPL-2.1 +Provides: bundled(php-pear-crypt-gpg) = v1.6.7 +# License LGPL-3.0 +Provides: bundled(php-pear-net-ldap2) = v2.2.0 +# License MIT Provides: bundled(php-guzzlehttp-guzzle) = 7.4.1 Provides: bundled(php-guzzlehttp-promises) = 1.5.1 Provides: bundled(php-guzzlehttp-psr7) = 2.1.0 -Provides: bundled(php-kolab-net-ldap3) = v1.1.3 Provides: bundled(php-masterminds-html5) = 2.7.5 -Provides: bundled(php-pear-auth-sasl) = v1.1.0 Provides: bundled(php-pear-console-commandline) = v1.2.4 -Provides: bundled(php-pear-console-getopt) = v1.4.3 -Provides: bundled(php-pear-crypt-gpg) = v1.6.7 -Provides: bundled(php-pear-mail-mime) = 1.10.11 -Provides: bundled(php-pear-net-ldap2) = v2.2.0 -Provides: bundled(php-pear-net-sieve) = 1.4.5 -Provides: bundled(php-pear-net-smtp) = 1.10.0 -Provides: bundled(php-pear-net-socket) = v1.2.2 -Provides: bundled(php-pear-pear-core-minimal) = v1.10.11 -Provides: bundled(php-pear-pear-exception) = v1.0.2 Provides: bundled(php-psr-http-client) = 1.0.1 Provides: bundled(php-psr-http-factory) = 1.0.1 Provides: bundled(php-psr-http-message) = 1.0.1 Provides: bundled(php-ralouphie-getallheaders) = 3.0.3 -Provides: bundled(php-roundcube-plugin-installer) = 0.3.1 -Provides: bundled(php-roundcube-rtf-html-php) = v2.1 Provides: bundled(php-symfony-deprecation-contracts) = v2.2.0 +# License PHP License +Provides: bundled(php-pear-net-socket) = v1.2.2 %description |