I am not sure about how to go along with the licenses. Let say I am writing a library and I want to make it freely available under either GPLv3 or Apache license (I do not really care). But, I reuse some code from another library released under GPLv2 license. By reusing I mean copy-pasting. However, I do not want to claim that the code I have copied was written by me. How should indicate that in my source I am reusing a code from another source. Is it enough to just copy a license header from the file the code was partially copied from and put that header my file?
Including the original copyright is the least you should do with all code you include in your code. The rest depends on the license. I believe that GPL (either v2 or v3) requires your entire code to be released under the same GPL license (I don't know about included libraries).
Attribution (mentioning where the code comes from) is basic courtesy, so I'd say adding a header to the file in question is the minimum required.
But note that most licenses do not allow you to publish the code under a different license. The GPL often does (many licenses have wording like "... under this or a later version of the GPL"), so putting GPL2 stuff under GPL3 in those circumstances would be OK. But you can't use something licensed under the GPL in software that's licensed under the Apache license, and vice versa.
You'd probably also need to include the original license file in any distribution.
Joined: Aug 13, 2009
Thank you for your replies. From your answers I may conclude that I should be fine if I release my source under GPLv3 and if I include an original copyright header in the source file, which includes the copied code.
Joined: Mar 22, 2005
I should be fine if I release my source under GPLv3 and if I include an original copyright header in the source file, which includes the copied code.
IF the original code was licensed under a variety of the GPL 2 which stated that it's fine to use a later license. As mentioned, many GPL-based instances do, but by no means all.
Joined: Aug 13, 2009
The header on the file I copy code from specifies the following:
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License.
So, if I go for GPLv2 and read its description I find the following paragraph:
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
May I conclude that using the later version of the GPL license, i.e. GPLv3, is still fine?