Open-source: licence header on each source file OR a single COPYING OR both?
LicensingLicensing Problem Overview
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.
Licensing Solutions
Solution 1 - Licensing
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.
Solution 2 - Licensing
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
Solution 3 - Licensing
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.
Solution 4 - Licensing
I'm working on KDE marble and in KDE we put license text in each file.