I'm developing a project which I'm about to release under the GNU GPL 3+ license. It does, however, contain a number of public domain subroutines.

Question: How do I go about placing a GPL license notice in the file containing those subroutines, i.e. I understand there should be a copyright line at the beginning which allows me to license things, but I don't (nobody does?) own a copyright on the public domain part. Does it mean that I should just include the PD part 'as is' without any license notice or is it possible to specifically license the PD code under GPL? The latter would imply that I own the copyright which I don't. How to approach this and fully comply with this official GPL guideline?

Every file of my project contains the GPL preamble; do I leave it out entirely in the PD file or attribute it somehow?


Question: How do I go about placing a GPL license notice in the file containing those [public domain] subroutines

If the file only contains public domain code, then you should not add a GPL license notice nor a copyright line in the file. Instead, you should put a notice in the file that the contents are in the public domain.
This does not conflict with the FSF guideline for applying the GPL license, because that guideline is for applying the GPL license to your own code, and by your own admission that public domain code is not written by you.

If the file also contains code written by you (and which should be licensed under the GPL), then just add the copyright line and GPL license notice as you do for other files written entirely by you. If you want to be nice, you can add an additional notice that parts of the file (and optionally which parts) were released into the public domain, but that is not a requirement.

In any case, you should make it clear in the top-level documentation of your project that the project as a whole is under the GPL license.

| improve this answer | |
  • I can't entirely agree with this. I agree that placing a copyright notice in PD files would be inappropriate. But the GPL suggests that the entire corresponding source for the work should be under GPL, and as soon as anyone else tries to redistribute, it may have to be. I see no problem with placing everything under GPL, and definite benefits to so doing. – MadHatter Oct 9 at 7:23
  • @MadHatter, I believe that slapping the GPL license notice on unmodified third-party code is at least immoral and with most copyright licenses even illegal. In that way, I see no difference between linking a library into a GPL project and copying entire files into a GPL project without modification. – Bart van Ingen Schenau Oct 9 at 8:52
  • Thank you all for your insights. I'd like my project to be free software with all of its implications, i.e. carrying the four freedoms as defined by FSF. Now, I've done some research by looking into the source codes of several GNU packages. Massive grep-ing gave me some files that were in public domain and it seems that they only contained the PD notice, and author, but no copyright line and no GPL notice at all. The whole package is clearly GPLv3 (it comes from GNU). Seems consistent with the answer, so I'll mark it as accepted. Nevertheless, any further comments are appreciated.Thank you! – user162404 Oct 10 at 19:39
  • +1: Blindly slapping a GPL header on non-GPL code is misleading at best. At worst, it makes things needlessly difficult for anyone working on a permissively-licensed project. – Kevin Oct 14 at 18:46

I'm sorry to disagree publicly, but Bart's answer, while excellent in many respects, seems wrong in one: you may (and in my opinion should) put a GPL header in the files you acquired under PD but are now redistributing as part of your project. If you choose not to, you will need to make it clear that they are public domain, by adding a comparable "public domain" header if it is not already clearly there. And please don't mix PD and GPL code inside a single file.

Let me take that in parts: firstly, the idea that you may include the PD content under the GPL's conditions. Some call this re-licensing of someone else's content, and think it's never permissible. I take a more nuanced view and say it's permissible, unless the terms under which you received that content forbid it (as they often do). In this case, you received the public domain content under the most elastic terms imaginable, and you are perfectly within your rights to add conditions to its onward distribution. Anyone who wants to use the original files without those conditions can get them from somewhere other than the inside of your project.

GPLv3 s5c obliges downstream recipients to distribute the entire package under GPLv3. But it adds that they may (though they are not obliged to) pass on additional permissions if they have received them. Since PD gives the same rights as GPLv3 but with less conditions attached, it seems to me that PD status is an additional permission within the meaning of the clause. Distributing this content under PD is permitted, but not compulsory.

Why would I advocate changing the status? Simplicity. It's permitted, and it brings everything under a single licence. That in turn encourages reuse by making the licensing decision as to reuse as simple as possible. But if you decide not to do that, it's very important that you clarify the status of each non-GPLv3 file by clearly indicating that it's in the public domain.

| improve this answer | |
  • GNU Emacs is under the GPLv3 license and contains files under PD. Are you claiming that GNU Emacs cannot be distributed? – Bart van Ingen Schenau Oct 11 at 12:39
  • The emacs tarball is more than the source for the emacs binary, and can therefore be under more than one licence. The contents of src include a GPLv3 licence declaration, and nothing in there appears to be under any other licence. Some additional lisp, doc, and admin files are indeed PD, but that's not relevant to this question. This question isn't about distributing some PD files alongside a binary, but as part of the corresponding source for a GPLv3 binary. – MadHatter Oct 11 at 13:38
  • In the comment thread on my answer, the OP referred to a PD file in the ` src` folder of the git repository. It is a C source code file and thus likely to be distributed as part of the binary and not alongside it. – Bart van Ingen Schenau Oct 11 at 19:51
  • 1
    @BartvanIngenSchenau I have no idea how my big grep missed the files in src; I'm sorry, and thank you for picking me up on it. Serve me right for citing s5c selectively. I have changed my answer to reflect the lawfulness of this approach, though I still recommend bringing it all under GPLv3. I hope that satisfies your objections. – MadHatter Oct 12 at 5:44
  • 1
    I don't see anything in your answer that I would classify as a factual error. Our disagreement now seems to boil down to the question if you should add the GPL license notice to a file with PD code or not. That is a question of beliefs where it is pointless to argue that one is better than the other. – Bart van Ingen Schenau Oct 12 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.