Open-source: licence header on each source file OR a single COPYING OR both? [closed]

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.


Solution 1:

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:

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