Case 1. When this is your own code:
In general, you only need to put Copyright notice in the work (here source code). The license doesn't require a mention.
For example, for Apache license doesn't need any such reference.
However, GPL specifically wants that you reference GPL License
word inside each source code.
the process involves adding two elements to each source file of your
program: a copyright notice (such as “Copyright 1999 Terry Jones”),
and a statement of copying permission, saying that the program is
distributed under the terms of the GNU General Public License
from: http://www.gnu.org/licenses/gpl-howto.html
In this case, to avoid the interpretation that the code is uncondtionally GPL'ed, it makes sense that you either specify additional clause like
"subject to terms and condition provided in LICENSE.txt"
Case 2: If you are modifying the other person code:
You cannot do -dual license, and also you cannot modify anything on the source that provides licensing information.
BTW: There is one simpler alternative that is obvious.
If you make identical copy of the code which has no mention of GPL at all and you use that copy for the Commercial or alternative license.
But this might just be too cumbersome.
In all cases, the README.md
should contain a a SPDX license identifier:
SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
You can do it like that:
## License
This work is dual-licensed under BSD and GPL 2.0 (or any later version).
You can choose between one of them if you use this work.
`SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later`
Note that BSD-3-Clause OR GPL-2.0-or-later
and BSD-3-Clause AND GPL-2.0-or-later
makes a big difference. The former means that the user can choose between both (which is the regular case!) and the second one denotes that the user has to comply to both licenses. See also multi licensing on Wikipedia.
SPDX Way
In a presentation of the SPDX creators, they propose to create a LICENSE
file containing a SPDX expression (slide 12).
Contents of LICENSE
:
BSD-3-Clause OR GPL-2.0-or-later
You could add two additional LICENSE files then: LICENSE.BSD-3-Clause
and LICENSE.GPL-2.0
.
Note that I am using the new (as of 2017-12-28) SPDX License List 3.0 here. The versions of 2017 had GPL-2.0
is identifier for GPL 2.0, but it was not clear whether that meant "GPL 2.0 only" or "GPL 2.0 or any later version".
Eclipse Foundation Way
See https://www.eclipse.org/projects/handbook/#legaldoc-license:
If the project code is distributed under multiple licenses then the text of those licenses must be included. The file should start with a short paragraph that describes how the licenses are combined. This statement should in most cases, be exactly the same as the license statement in the file copyright and license headers (see the example below).
Example License File (dual-licensed EPL-2.0 or Apache-2.0).
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0, or the Apache Software License
2.0 which is available at https://www.apache.org/licenses/LICENSE-2.0.
... Text of the Eclipse Public License 2.0 ...
... Text of the Apache Software License 2.0 ...
Best Answer
You don't need to put a GPL header in the source - you don't need to do anything. Although a copyright notice of your name and date in the file is useful and may be required in some areas.
I would probably include your name/email/website in the header and a note saying "see licence.txt for terms" then you don't have to worry about having different source files for GPL/Commercial.
The GPL is a distribution licence, when you distribute a copy of your project under GPL you include the GPL text file (and make the source available). When you distribute it yourself you include whatever commercial license file you wish.
The only complexity is if you accept fixes from GPL users - they own those fixes and you can only distribute them under GPL. Unless you can get the authors to assign the copyright to you.