Skip to content

How to satisfy both CRAN and Github license file naming requirements

An answer to this question on Stack Overflow.

Question

(NOTE: This question includes the word "license". But let's be clear: this question is not asking for licensing advice. It is asking how to simultaneously satisfy the file naming requirements of "software tools commonly used by programmers": Github and CRAN. This question could just as easily be about README files. The mere use of the word "license" seems to make folks trigger happy with their close votes.)

I have an R package who's code I'd like to keep on Github.

In accordance with R's requirements (see here for a note about template licenses), I have in my DESCRIPTION file the line:

License: MIT + file LICENCE

And my LICENCE file contains the MIT template, as required:

YEAR: 2017
COPYRIGHT HOLDER: Don Quixote

Github used to figure out licensing only by looking at the LICENSE file, which allowed me to keep the MIT text in LICENSE so that Github would detect it and the CRAN template in LICENCE so that CRAN would detect it. This approach used .Rbuildignore to hide the Github LICENSE from CRAN.

But now, a darkness has fallen on the land: Github looks at both LICENSE and LICENCE. Finding them different, it abandons its attempt to determine the project's license.

As a result, it does not seem possible to use the MIT license, or other templated licenses, in a way which satisfies both CRAN and Github.

Renaming my CRAN license template file from LICENCE to LICENCE.template would fix the issue, but then CRAN complains about a non-standard file.

I could omit a the CRAN license template file from the git repo, but then I'm not sacrificing version control for expediency.

Is there a workaround?

Answer

My current approach, based on Thomas's comment is as follows:

  • The file LICENCE contains the MIT template license, per CRAN's requirements. It is now listed in .gitignore, so that it doesn't mess with Github.

  • The file LICENSE contains the actual MIT license, per Github's requirements. It is not listed in .Rbuildignore, so that it doesn't mess with CRAN.

Of course, this is not an ideal solution because now neither CRAN nor Github is accurately archiving the whole code base. In particular, if the code is acquired from Github it is not in a state where it would be permissible to upload it to CRAN. If the code's acquired from CRAN, it would merely be non-cooperative to post it on Github (since Github would not deduce the license).