The GPL is not a per-file copyleft license, but per the whole package.
So the new file should be licensed under GPL as well. As the original license header does not specify a GPL version, you can choose any GPL version you like. If you want to learn more about why there are multiple versions of the GPL and how it works with upgrading license versions please see:
- Why should programs say “Version 3 of the GPL or any later version”? GPL FAQ
So after clarifying the license version you ask about the copyright statement and where to place your name. I am not your lawyer and speaking here as a software developer and it is not easy to fully answer that question for all angles it can have, so I try to outline my understand of the parts I see that play a role.
Per copyright you are bringing together multiple works by multiple authors. You are creating a combined work. For each work in the sense of copyright you have authors and copyright holders.
For the combined work then, you have this copyright then combined as well.
So for the single file, if you wrote it your very own, let's say it is 2012, as you are the author, you can write your own copyright header:
/**
* My Extension to some open source application
*
* Copyright 2012 by Tobias Eriksson <author@tobier.se>
*/
That would be perfectly okay for that file if it rests on your hard-drive. You then want to distribute it, so it is wise to make the license clear. Let's say you have chosen GPL-3.0+. Following the guidelines
- How to use GNU licenses for your own software GNU DOCS
and some comment/docblock tagging guidelines:
- Using the SPDX License List for Tagging and Linking Hakres' Tips
you might want to extend this with the license plate as in the following example:
/**
* My Extension to some open source application
*
* Copyright 2012 by Tobias Eriksson <author@tobier.se>
*
* This file is part of some open source application.
*
* Some open source application is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* Some open source application is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Foobar. If not, see <http://www.gnu.org/licenses/>.
*
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
*/
This license plate ensures that those who receive the file can see under which license this file is, which rights they have with the code. Also they can see the original author with your copyright statement. The most important part here in my eyes is to make clear: a) who is the author/copyright holder and b) what is the license. So that this information does not get lost, is visible. If you want to follow the recommendations that is up to you. To not cut your own author's rights, I highly suggest to at least leave credit for your name even per law this is not required (but you will have problems to document your authorship later on if you don't do that and somebody else puts her name in there).
So now you can suggest this file to be added upstream. This is the first time you will get in contact with the original authors of the software so far. They might have their own way of doing things, might want to prefer their own headers etc. pp.. So you leave the legal ground a bit and enter a social sphere, collaboration, working together.
You can ask beforehand how this is managed inside a project, generally there are multiple ways to do things, two common ones are:
- Manage Licensing and Copyright per-file
- Manage Licensing and Copyright centrally.
The per file approach is handy when projects start. The central approach is handy when projects grow larger.
The per-file approach is a bit outlined above and it requires to keep track of the changes in licensing and copyirght / authors information per each file.
In a central approach an accepted procedure is to have a so called AUTHORS (and probably additionally a CONTRIBUTORS) file listing the authors of the software and to have a COPYING file that contains the license (if it is a single one for the whole package, otherwise the main one plus the additional licenses).
It can also happen that you have both concepts intermixed, e.g. the whole package is under GPL but inside the codebase there is also code under MIT or BSD type of licenses. You should then keep the license information for those parts to allow to give back changes back to upstream for these parts. Also, authors who contribute to these parts should be made aware that they need to license their changes under MIT / BSD as well to preserve the licensing of that part. If you want to learn more about that and some details of how and where to document licensing, the following is a good read:
- Maintaining Permissive-Licensed Files in a GPL-Licensed Project: Guidelines for Developers SFLC Paper
The central approach then allows to reduce the copyright headers and license plates on top of each file:
/**
* Some open source application
*
* Copyright 2010, 2012 by it's authors.
* Some rights reserved. See COPYING, AUTHORS.
*/
If you are looking for compression of information and the authors are okay with not seeing their name in each file. You can not do that with superstars, true. So there might be a social ranking who's name comes first and such. However do not let yourself being fooled: If you are an author, you have the right to see your name. If somebody denies you that right you are being cheated. This also tells a lot about respect in a (free) software project as you can imagine.
Technically it is perfectly alright you add your copyright line on top, because it is you who made the latest changes. The license only tells that you need to preserve the original copyright, not that you need to put it on top:
/**
* Some open source application
*
* Copyright 2012 by Tobias Eriksson <author@tobier.se>
* Copyright 2010, 2011 by Scruffy H. Hacker <scruffy@foo.bar>
*
* Licensed under GNU General Public License 3.0 or later.
* Some rights reserved. See COPYING, AUTHORS.
*
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
*/
Might be a more common / real-live example of such a license/copyright header docblock. And remember to always treat other authors with the same amount of respect like you treat your own. That normally works best in collaborative projects, the legal side aside. You only need legals for the time when things are not inline any longer.
See as well:
- Automatically managing license/author/version header in source files
- LICENSE and AUTHORS Maintenance