56

Publishing an open-source project, is it enough to add a COPYING file to the package or do I need to copy and paste it on top of every project's source file?
On famous public repositories like github or Google code I've seen different mixed approaches so I would like to know how this aspect should be handled correctly.

systempuntoout
  • 71,966
  • 47
  • 171
  • 241
  • 11
    Not from a legal view, but from a developer's view: Having the license in every file is EXTREMELY ANNOYING. Especially if you want to search for e.g. a function/variable which is named like a word used in the license block.. – ThiefMaster Jun 16 '10 at 08:25
  • 1
    Usually people put it in a file named COPYING without any extensions. – ThiefMaster Jun 16 '10 at 19:55
  • 8
    +1 I'm so glad I've found this question. I was about to lose my mind researching about this. – helpermethod Aug 03 '12 at 14:59
  • This question appears to be off-topic because it is about licensing, not programming. – Bill the Lizard Aug 07 '13 at 17:09
  • 1
    This question is about liscencing a script which is something each programmer should know.... As its very pertinent question however with a lot of upvotes I don't see a point to deprive people of such a ressource. – TOPKAT Nov 24 '16 at 15:29

4 Answers4

52

Working for a company that takes copyrights very seriously, we are required to put copyright/licence messages in every single file, despite the fact it's not technically required under US law.

I suspect it's so that, if a file was somehow separated from the product as a whole, it would still be easily identifiable.

However, we don't maintain that message in every single file. We have scripts which automatically add in the copyright messages to every file that's released to the wild. That way you only have to change one file.

We also have scripts that check every single release file has the correct message.

However, in terms of licensing, the lack of an explicit licence means that standard copyright would apply so it may be that you're happy with the single LICENCE.txt file.

As always, my legal opinion is worth every cent you paid me for it (which is zero). I am not a lawyer, I am certainly not your lawyer.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
  • 24
    "my legal opinion is worth every cent you paid me for it (which is zero)" caustic but i loved it :) – systempuntoout Jun 16 '10 at 08:57
  • 2
    Actually, I didn't mean to be caustic, it's just drummed into us by the work lawyers that legal advice offered by non-legal bods is a _very_ serious offence. – paxdiablo Jun 16 '10 at 08:59
  • 10
    You'd better hope that stackoverflow votes don't qualify as legal tender. – intuited Jun 21 '10 at 18:49
  • my +1 was simply for the last line :) Well, I liked your answer overall but that last line was just killer :) – javatarz Aug 10 '13 at 22:06
  • 1
    "[...] legal advice offered by non-legal bods is a very serious offence [sic]". Haha. A likely story. – vhs May 26 '17 at 13:56
6

Each license creator has its own set of guidelines. Is it GPL? Then you may want to follow the GNU official guide, which you can find here (they require each file to be prefixed):

http://www.gnu.org/licenses/gpl-howto.html

Check out some resources too:

http://www.oss-watch.ac.uk/resources/opensourceyourcode.xml#body.1_div.3 http://producingoss.com/en/license-quickstart.html

corazza
  • 31,222
  • 37
  • 115
  • 186
Palantir
  • 23,820
  • 10
  • 76
  • 86
4

It depends on what license I'm using. For example, licenses like the GPL apply to the work as a whole, so I just put a COPYING file at the source root, and then make a note on each source file, as per the FSF's recommendations. On the other hand, if I release code under a BSD or MIT license (or something similar), I usually don't bother with a separate license file, and just put the license info in the source file itself (it seems likely that, with a BSD or MIT license, people would grab individual source files and use the code).

If you're asking on behalf of a "big, important" project, you'll want to consult with a lawyer.

mipadi
  • 398,885
  • 90
  • 523
  • 479
0

I'm working on KDE marble and in KDE we put license text in each file.

GG.
  • 2,835
  • 5
  • 27
  • 34
  • That's not true, I really doubt every file in Marble has the complete giant text of the GPL ;) What you have is a short header saying it's licensed under the GPL, and pointing at the full text elsewhere. – Nicolás May 11 '13 at 20:01