Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spdx names to licenses #54

Closed
wants to merge 5 commits into from

Conversation

pablrod
Copy link
Contributor

@pablrod pablrod commented Jan 21, 2017

SPDX project defines a set of identifiers for licenses. This pull request just add a method to get that identifier.

In CPAN there is License::Syntax but doesn't offer an API to get the spdx name, nor the mapping between Software::License name. Although there is a file with a list of licenses and the spdx name and identifier.

@karenetheridge
Copy link
Member

Looks good to me. 👍

@Leont
Copy link
Member

Leont commented Jan 24, 2017

Sounds sensible enough to me. Probably we should use it if we ever create a Meta 3.0.

@dolmen
Copy link
Member

dolmen commented Feb 3, 2017

Here is some input data that could be used for a more extensive testsuite: https://github.com/OpenSourceOrg/licenses/blob/master/licenses/spdx/spdx.json (related to #52)

@pablrod
Copy link
Contributor Author

pablrod commented Feb 5, 2017 via email

@pablrod
Copy link
Contributor Author

pablrod commented Jul 30, 2017

I've extended the tests to cover all Software::License modules that have spdx name (c45950a).

I think it would be useful a method to get the license via spdx name, I mean:

my $license_object = Software::LicenseUtils->new_from_spdx_name( {
  spdx_name => 'MPL-2.0',
  holder => 'X. Ample'
}) ;

So I've added this method dc677bc

@dolmen is ok the testsuite?

@Leont
Copy link
Member

Leont commented Jul 31, 2017

I think it's more sensible to think in terms of spdx expressions than in names, especially because the most commonly used license is such an expression.

@pablrod
Copy link
Contributor Author

pablrod commented Jul 31, 2017

Thanks for your comment!

You're right, the term "name" is not a good option. I've looked up in The Software Package Data Exchange web, and they use the terms:

The GitHub repo spdx/license-list-data uses in JSON files the key 'licenseId' licenses.json

The term 'identifier' is consistent with the OpenSourceOrg/api. (and Perl client)

So I'm going to change the term "spdx_name" to "spdx_identifier".

Please let me know if there is something wrong with "spdx_identifier".

@Leont
Copy link
Member

Leont commented Aug 1, 2017

Please let me know if there is something wrong with "spdx_identifier".

I think that is useful for new_from_spdx_name, but it's not really useful for meta files. Those would need a spdx_expression that is implemented by all License types. E.g. the Perl license would return something like Artistic-1.0-Perl OR GPL-1.0+, for most other Licence types it would just return the spdx_identifier. Actually it may be useful for new_from_spdx_ too.

@pablrod
Copy link
Contributor Author

pablrod commented Aug 1, 2017

Oh good point! Then I'll change the spdx_name in individual license files to spdx_expression and implement it for all licenses.

Ok?

@Leont
Copy link
Member

Leont commented Mar 11, 2018

Ok?

That sounds good.

@pablrod
Copy link
Contributor Author

pablrod commented Jun 3, 2018

Now spdx_expression is implemented for all licenses. Also I've added a default in Software::License::spdx_expression that use the module name, for those modules out of this distribution (for example: Software::License::CCpack)

@Leont
Copy link
Member

Leont commented Jun 4, 2018

Also I've added a default in Software::License::spdx_expression that use the module name, for those modules out of this distribution (for example: Software::License::CCpack)

I think it's more helpful to not return anything than guess something that's almost but not quite correct. Eg for Software::License::CC_BY_4_0 the correct result would be CC-BY-4.0, not CC_BY_4_0. It's not that hard for CCPack and friends to add support for this.

@pablrod
Copy link
Contributor Author

pablrod commented Jun 10, 2018

Yes, I totally agree. I've changed that. Now the method spdx_expression in Software::License returns undef.

@Leont
Copy link
Member

Leont commented Nov 27, 2018

This is now part of Software-License 0.103014 :-)

@Leont Leont closed this Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants