public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/maven/
@ 2020-08-05 14:31 Miroslav Šulc
  0 siblings, 0 replies; 3+ messages in thread
From: Miroslav Šulc @ 2020-08-05 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     1c7018663e04e676f4ff74a9604913a81ddbfbf4
Author:     zongyu <zzy2529420793 <AT> gmail <DOT> com>
AuthorDate: Sat Aug  1 09:04:07 2020 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Sat Aug  1 15:17:55 2020 +0000
URL:        https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1c701866

Use Set instead of List for storing Licenses, update license map

Signed-off-by: zongyu <zzy2529420793 <AT> gmail.com>

 .../gentoo/java/ebuilder/maven/MavenLicenses.java  |   3 +-
 .../gentoo/java/ebuilder/maven/MavenProject.java   |  12 +-
 src/main/resources/licenseMap.properties           | 152 ++++++++++++++++++++-
 3 files changed, 161 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java
index e2db62c..f2f4f9a 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java
@@ -51,7 +51,8 @@ public class MavenLicenses {
          * @return license identifier that works with Portage
          */
         public String getEquivalentLicense(String licenseName) {
-            final String portageLicense = licenseMap.get(licenseName);
+            final String portageLicense =
+                    licenseMap.get(licenseName.toLowerCase());
 
             if (portageLicense == null) {
                 return "!!!equivalentPortageLicenseName-not-found!!!";

diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java
index fa4958d..2fd88de 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java
@@ -4,7 +4,9 @@ import java.io.PrintWriter;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * Contains information about maven project collected from pom.xml.
@@ -44,7 +46,7 @@ public class MavenProject {
     /**
      * Lisences.
      */
-    private List<String> licenses = new ArrayList<>(10);
+    private Set<String> licenses = new HashSet<>(10);
     /**
      * Homepage URL.
      */
@@ -113,8 +115,12 @@ public class MavenProject {
      *
      * @param license {@link #licenses}
      */
-    public void addLicense(final String license) {
-        licenses.add(license);
+    public void addLicense(final String portageLicenses) {
+        final String[] parts = portageLicenses.split(":");
+
+        for (String eachLicense: parts) {
+            licenses.add(eachLicense);
+        }
     }
 
     /**

diff --git a/src/main/resources/licenseMap.properties b/src/main/resources/licenseMap.properties
index fe9262a..5cd2e5d 100644
--- a/src/main/resources/licenseMap.properties
+++ b/src/main/resources/licenseMap.properties
@@ -1,2 +1,150 @@
-#Fri Jul 31 23:28:29 CST 2020
-Apache\ License,\ Version\ 2.0=Apache-2.0
+#Sat Aug 01 15:44:04 CST 2020
+# A properties file that maps license name of pom.xml to
+#   portage compatible names.
+#
+# If the name indicates multiple licenses, please record
+#   the license like:
+#@CODE
+#       name\ from\ pom.xml=GPL-2:MIT:BSD
+#@CODE
+#
+# If it indicates multiple choices of licenses, please
+#   record the license like:
+#@CODE
+#       name\ from\ pom.xml=||\ (\ GPL-2\ MIT\ )
+#@CODE
+#
+# according to dev-java/bcpkix::gentoo
+bouncy\ castle\ licence=BSD
+# according to dev-lang/scala::gentoo
+bsd-like=BSD
+#
+3-clause\ bsd\ license=BSD
+apache\ 2=Apache-2.0
+apache\ 2.0=Apache-2.0
+apache-2.0=Apache-2.0
+apache\ 2.0\ license=Apache-2.0
+apache\ license=Apache
+apache\ license\ 2=Apache-2.0
+apache\ license\ 2.0=Apache-2.0
+apache\ license,\ 2.0=Apache-2.0
+apache\ license\ v2.0=Apache-2.0
+apache\ license\ version\ 2=Apache-2.0
+apache\ license,\ version\ 2.0=Apache-2.0
+apache\ license\ version\ 2.0=Apache-2.0
+apache\ license,\ version\ 2.0=Apache-2.0
+apache\ public\ license\ 2.0=Apache-2.0
+apache\ software\ license,\ version\ 1.1=Apache-1.1
+apache\ software\ license\ -\ version\ 2.0=Apache-2.0
+apache\ v2=Apache-2.0
+asf\ 2.0=Apache-2.0
+asl=Apache-2.0
+asl\ 2.0=Apache-2.0
+asl,\ version\ 2=Apache-2.0
+bsd=BSD-1
+bsd\ 2-clause=BSD-2
+bsd-2-clause=BSD-2
+bsd\ 2-clause\ license=BSD-2
+bsd\ 3-clause=BSD
+bsd-3-clause=BSD
+bsd\ licence=BSD-1
+bsd\ license=BSD-1
+bsd\ style=BSD
+cc0=CC0-1.0
+cddl\ 1.0=CDDL
+cddl\ 1.1=CDDL-1.1
+cddl+gpl\ license=CDDL:GPL-1
+cddl/gplv2+ce=||\ (\ CDDL\ GPL-2-with-classpath-exception\ )
+cddl\ +\ gplv2\ with\ classpath\ exception=CDDL:GPL-2-with-classpath-exception
+cddl\ license=CDDL
+cddl\ v1.1\ /\ gpl\ v2\ dual\ license=CDDL-1.1:GPL-2
+common\ development\ and\ distribution\ license=CDDL
+common\ development\ and\ distribution\ license\ (cddl)\ plus\ gpl=CDDL:GPL
+common\ development\ and\ distribution\ license\ (cddl)\ v1.0=CDDL
+common\ development\ and\ distribution\ license\ (cddl)\ version\ 1.0=CDDL
+common\ public\ license\ -\ v\ 1.0=CPL-1.0
+common\ public\ license\ version\ 1.0=CPL-1.0
+dual\ license\ consisting\ of\ the\ cddl\ v1.1\ and\ gpl\ v2=CDDL-1.1:GPL-2
+eclipse\ distribution\ license\ (edl),\ version\ 1.0=EPL-1.0
+eclipse\ distribution\ license\ -\ v\ 1.0=EPL-1.0
+eclipse\ distribution\ license\ v.\ 1.0=EPL-1.0
+eclipse\ public\ license=EPL-1.0
+eclipse\ public\ license\ 1.0=EPL-1.0
+eclipse\ public\ license\ 2.0=EPL-2.0
+eclipse\ public\ license\ (epl),\ version\ 1.0=EPL-1.0
+eclipse\ public\ license\ -\ v\ 1.0=EPL-1.0
+eclipse\ public\ license\ v1.0=EPL-1.0
+eclipse\ public\ license\ -\ v\ 2.0=EPL-2.0
+eclipse\ public\ license\ v.\ 2.0=EPL-2.0
+eclipse\ public\ license\ v2.0=EPL-2.0
+eclipse\ public\ license\ -\ version\ 1.0=EPL-1.0
+eclipse\ public\ license,\ version\ 1.0=EPL-1.0
+eclipse\ public\ license\ -\ version\ 2.0=EPL-2.0
+eclipse\ public\ license,\ version\ 2.0=EPL-2.0
+edl\ 1.0=EPL-1.0
+epl=EPL-1.0
+epl\ 2.0=EPL-2.0
+epl-2.0=EPL-2.0
+gnu\ general\ public\ library=GPL-1
+gnu\ general\ public\ license,\ version\ 2=GPL-2
+gnu\ general\ public\ license\ version\ 2=GPL-2
+gnu\ general\ public\ license,\ version\ 2\ with\ the\ classpath\ exception=GPL-2-with-classpath-exception
+gnu\ general\ public\ license,\ version\ 2,\ with\ the\ classpath\ exception=GPL-2-with-classpath-exception
+gnu\ general\ public\ license,\ version\ 2\ with\ the\ gnu\ classpath\ exception=GPL-2-with-classpath-exception
+gnu\ lesser\ general\ public\ licence=LGPL-3
+gnu\ lesser\ general\ public\ license=LGPL-3
+gnu\ lesser\ general\ public\ license\ as\ published\ by\ the\ free\ software\ foundation;\ either\ version\ 2.1\ of\ the\ license,\ or\ (at\ your\ option)\ any\ later\ version.=LGPL-2.1
+gnu\ lesser\ general\ public\ license\ (lgpl)=LGPL-3
+gnu\ lesser\ general\ public\ license\ (lgpl),\ version\ 2.1=LGPL-2.1
+gnu\ lesser\ general\ public\ license\ v2.1=LGPL-2.1
+gnu\ lesser\ general\ public\ license\ version\ 2.1=LGPL-2.1
+gnu\ lesser\ general\ public\ license,\ version\ 2.1=LGPL-2.1
+gnu\ lesser\ public\ license=LGPL-3
+gnu\ lgplv3=LGPL-3
+gnu\ library\ general\ public\ license\ v2.1\ or\ later=LGPL-2.1
+go\ license=BSD
+gpl-2.0=GPL-2
+gpl-2.0-with-classpath-exception=GPL-2-with-classpath-exception
+gpl2\ w/\ cpe=GPL-2-with-classpath-exception
+gpl\ 3=GPL-3
+gpl\ v2=GPL-2
+gpl\ v2\ with\ classpath\ exception=GPL-2-with-classpath-exception
+hsqldb\ license=BSD
+indiana\ university\ extreme!\ lab\ software\ license=Indiana-University-Extreme-Lab
+indiana\ university\ extreme!\ lab\ software\ license\ 1.1.1=Indiana-University-Extreme-Lab
+indiana\ university\ extreme!\ lab\ software\ license,\ vesion\ 1.1.1=Indiana-University-Extreme-Lab
+jquery\ license=MIT:CC0
+lgpl=LGPL-3
+lgpl\ 2.1=LGPL-2.1
+lgpl-2.1=LGPL-2.1
+lgpl\ 3=LGPL-3
+lgplv2.1=LGPL-2.1
+lgpl,\ version\ 2.1=LGPL-2.1
+mit\ license=MIT
+modified\ bsd=BSD
+mozilla\ public\ license\ 1.1\ (mpl\ 1.1)=MPL-1.1
+mozilla\ public\ license\ version\ 2.0=MPL-2.0
+mpl\ 1.1=MPL-1.1
+mpl\ 2.0\ or\ epl\ 1.0=||\ (\ MPL-1.1\ EPL-1.0\ )
+new\ bsd\ license=BSD
+provided\ without\ support\ or\ warranty=JSON
+public\ domain=public-domain
+public\ domain,\ per\ creative\ commons\ cc0=public-domain
+public\ domain,\ sun\ microsoystems=public-domain
+revised\ bsd=BSD
+similar\ to\ apache\ license\ but\ with\ the\ acknowledgment\ clause\ removed=Apache-2.0
+spec\ evaluation\ license=Apache-2.0
+spec\ implementation\ license=Apache-2.0
+the\ apache\ license,\ version\ 2.0=Apache-2.0
+the\ apache\ software\ license,\ version\ 2.0=Apache-2.0
+the\ bsd\ 2-clause\ license=BSD-2
+the\ bsd\ 3-clause\ license=BSD
+the\ bsd\ license=BSD
+the\ gnu\ general\ public\ license\ (gpl),\ version\ 2,\ with\ classpath\ exception=GPL-2-with-classpath-exception
+the\ gnu\ lesser\ general\ public\ license,\ version\ 2.1=LGPL-2.1
+the\ go\ license=BSD
+the\ json\ license=JSON
+the\ mit\ license=MIT
+the\ new\ bsd\ license=BSD
+universal\ permissive\ license,\ version\ 1.0=UPL-1.0
+w3c\ license=W3C


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/maven/
@ 2020-08-05 14:31 Miroslav Šulc
  0 siblings, 0 replies; 3+ messages in thread
From: Miroslav Šulc @ 2020-08-05 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     1198ae64e71b5d8dab832c78ab16a103512eaf58
Author:     zongyu <zzy2529420793 <AT> gmail <DOT> com>
AuthorDate: Sun Aug  2 09:13:54 2020 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 02:28:40 2020 +0000
URL:        https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1198ae64

reformat the license/name string

Signed-off-by: zongyu <zzy2529420793 <AT> gmail.com>

 src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java | 4 +++-
 src/main/resources/licenseMap.properties                      | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java
index 8c64e37..d487024 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenParser.java
@@ -627,7 +627,9 @@ public class MavenParser {
                     case "name":
                         mavenProject.addLicense(
                                 mavenLicenses.getEquivalentLicense(
-                                reader.getElementText()));
+                                reader.getElementText().
+                                        trim().
+                                        replaceAll("[\n ]+", " ")));
                         break;
                     default:
                         consumeElement(reader);

diff --git a/src/main/resources/licenseMap.properties b/src/main/resources/licenseMap.properties
index 5cd2e5d..a2fdbc6 100644
--- a/src/main/resources/licenseMap.properties
+++ b/src/main/resources/licenseMap.properties
@@ -59,7 +59,7 @@ cddl\ +\ gplv2\ with\ classpath\ exception=CDDL:GPL-2-with-classpath-exception
 cddl\ license=CDDL
 cddl\ v1.1\ /\ gpl\ v2\ dual\ license=CDDL-1.1:GPL-2
 common\ development\ and\ distribution\ license=CDDL
-common\ development\ and\ distribution\ license\ (cddl)\ plus\ gpl=CDDL:GPL
+common\ development\ and\ distribution\ license\ (cddl)\ plus\ gpl=CDDL:GPL-1
 common\ development\ and\ distribution\ license\ (cddl)\ v1.0=CDDL
 common\ development\ and\ distribution\ license\ (cddl)\ version\ 1.0=CDDL
 common\ public\ license\ -\ v\ 1.0=CPL-1.0
@@ -113,7 +113,8 @@ hsqldb\ license=BSD
 indiana\ university\ extreme!\ lab\ software\ license=Indiana-University-Extreme-Lab
 indiana\ university\ extreme!\ lab\ software\ license\ 1.1.1=Indiana-University-Extreme-Lab
 indiana\ university\ extreme!\ lab\ software\ license,\ vesion\ 1.1.1=Indiana-University-Extreme-Lab
-jquery\ license=MIT:CC0
+jquery\ license=MIT:CC0-1.0
+jsr-000107\ jcache\ 2.9\ public\ review\ -\ updated\ specification\ license=Apache-2.0
 lgpl=LGPL-3
 lgpl\ 2.1=LGPL-2.1
 lgpl-2.1=LGPL-2.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/maven/
@ 2020-08-05 14:31 Miroslav Šulc
  0 siblings, 0 replies; 3+ messages in thread
From: Miroslav Šulc @ 2020-08-05 14:31 UTC (permalink / raw
  To: gentoo-commits

commit:     1a0861fce9d1eed817114871b073edf1f527e21d
Author:     zongyu <zzy2529420793 <AT> gmail <DOT> com>
AuthorDate: Sat Aug  1 09:16:04 2020 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Sat Aug  1 15:25:32 2020 +0000
URL:        https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1a0861fc

update usage.txt, fix Copyright statement of Gentoo

Signed-off-by: zongyu <zzy2529420793 <AT> gmail.com>

 src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java | 2 +-
 src/main/resources/usage.txt                                    | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
index 3b5c3d6..8fceec6 100644
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenEbuilder.java
@@ -598,7 +598,7 @@ public class MavenEbuilder {
      * @param writer ebuild writer
      */
     private void writeHeader(final PrintWriter writer) {
-        writer.printf("# Copyright 1999-%d Gentoo Foundation\n",
+        writer.printf("# Copyright 1999-%d Gentoo Authors\n",
                 LocalDate.now().getYear());
         writer.println("# Distributed under the terms of the GNU General "
                 + "Public License v2");

diff --git a/src/main/resources/usage.txt b/src/main/resources/usage.txt
index 725643c..78ab745 100644
--- a/src/main/resources/usage.txt
+++ b/src/main/resources/usage.txt
@@ -2,13 +2,16 @@ Usage: java-ebuilder <args>
 
 Generating ebuild:
 --download-uri|-u <uri>            uri that goes to SRC_URI
+--binjar-uri <uri>                 uri that goes to binary jar
 --dump-projects|-d                 outputs information about parsed projects
                                    (useful for debugging)
 --ebuild|-e <file>                 path to ebuild that should be created
 --force-min-java-version <version> force minimum JDK/JRE version in dependencies
+--from-maven-central               make java-ebuilder inherit java-pkg-maven.eclass
 --generate-ebuild|-g               generates ebuild from pom.xml
 --keywords|-k <keywords>           arch keywords
---license|-l <license>             license name
+--license|-l <license>             license name, if it is not specified,
+                                   java-ebuilder will determine LICENSE from pom.xml
 --pom|-p <file>                    path to pom.xml that should be parsed,
                                    the path must be relative to workdir (can be
                                    specified multiple times)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-05 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-05 14:31 [gentoo-commits] proj/java-ebuilder:master commit in: src/main/resources/, src/main/java/org/gentoo/java/ebuilder/maven/ Miroslav Šulc
  -- strict thread matches above, loose matches on Subject: below --
2020-08-05 14:31 Miroslav Šulc
2020-08-05 14:31 Miroslav Šulc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox