License for your next free software/open source project

You’re a budding developer. You’re writing a program. FSF has its lengthy explanations about many licenses, as does OSI. Yet, you want a short and concise answer.

Here’s an overview of some of the licenses I consider for my projects, their major differences, and why I pick each of them. I’ll also describe how to apply them.

Note: I Am Not A Lawyer, and applying these is at your own risk. Don’t apply them blindly, and talk to your employer; you might not be able to decide licensing for your own work. Also, don’t use these notes as info on what you may or may not do with code you know to be GPL’d, LGPL’d or BSD-licensed.  Read the licenses themselves; these are notes indended only to help in quick decision, not to explain the licenses in great detail.

This is also largely done from memory, without doing proper research right now; it should be pretty correct, though.

Corrections and questions? Put them in the comments section, please 🙂

GNU General Public License v2 – GPLv2

  • Allows licensees (your users) to modify the source code and redistribute it
  • Copyleft license – Requires distributors to ship modified source code along with the executable
  • If someone links with your GPL’d library, they must license their executable or library under GPL as well; this applies for both static and dynamic linking (making non-GPL’d Linux kernel modules illegal, according to many)

I typically pick GPLv2 for my bigger projects. It makes me feel “paid” for my work by forcing anyone who takes my work to actually contribute to the betterment of the world; thus, they contribute to the betterment of me.

Note that due to its “infectious” nature, it can only be linked with liberally-licensed code, with other GPLv2 code, and due to a special exception, with LGPLv2 code.

If you license as “GPLv2 or any later version”, user can consider the code to be GPLv3 as well. In that case, the user can link with GPLv3 libraries, in which case the code becomes GPLv3 licensed.

Short info on how to apply (for more info, read the last portion of the license itself):

  • when text program starts, or when about dialog is opened, print out something similar to:
Gnomovision version 69, Copyright (C) year  name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
  • on top of each source code file, add this:

Copyright (C)   
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  U
  • include “COPYING” file with the full license text
  • to avoid licensing under “later version”, simply delete relevant text from the source files; do not delete it from text of the license (text of the license itself is copyrighted by FSF)
  • if you want to add exceptions, add them on top of COPYING file; don’t add restrictions, but add permissions; make sure you don’t modify the license text itself since it’s copyrighted by FSF!

GNU General Public License v3 – GPLv3

  • Almost the same as GPLv2
  • Copyleft license
  • Adds protection againts “tivoization”: source code being available due to GPL provisions, but hardware actually locking the user out from deploying modified code
  • Adds some patent protection for users
  • Cannot be linked with GPLv2 code unless it’s “GPLv2 or later”-licensed

I commonly don’t pick GPLv3, since it adds protections I don’t really need, and tends to make you look radical. That would not be a bad thing if it didn’t also have the potential to turn away potential contributors, and if it didn’t have the potential to turn away corporate contributors who don’t want to be struck by the patent protection clauses. (Apple stopped contributing to GCC after 4.2, which was the last version licensed under GPLv2.)

I do like licensing stuff under “GPLv2 or later”, though.

To see how to apply this, Google it up or see the license text itself.

GNU Lesser General Public License v2.1 – LGPLv2.1

  • Almost the same as GPLv2
  • Copyleft license – Requires distributors to ship source code to modifications of the library (modified DLL)
  • Specifically allows dynamic linking (.so, .dll) with non-LGPL licensed code, but does not allow static linking (otherwise that code must be LGPL or GPL licensed as well)

While FSF advocates you don’t use LGPL, I still find it a nice license. Dynamic linking is permitted with closed source code, but the source code to libraries themselves must be published if they are modified and distributed.

It can also be applied to programs if you feel it could be componentized, and want to allow components to be linked with closed source programs.

Short info on how to apply (for more info, read the last portion of the license itself):

  • add this on top of each source file:

Copyright (C)   
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  U
  • include “COPYING” file with full license text

BSD-style license

  • Allows licensees (your users) to modify the source code and redistribute it
  • Liberal license – does not require distributors to ship the code, and does not require any particular license for the remaining code
  • A very basic license, that only serves to point out you don’t give any warranty; pretty much common sense, but a good idea to point out

There are a few variants of BSD-style license: 2-clause, 3-clause and 4-clause. Google them up, all variants are quite short, and not very hard to understand. License text itself is not copyrighted, but you will want to keep modifications as simple as possible (just your name).

To apply the license to your code, add text similar to this on top of each of your source code lines and to a file named COPYING — but please first Google up other variants of the license:

* Copyright (C)  .  All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1.  Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
* 2.  Redistributions in binary form must reproduce the above copyright
*     notice, this list of conditions and the following disclaimer in the
*     documentation and/or other materials provided with the distribution.
* 3.  Neither the name of  nor the names of
*     its contributors may be used to endorse or promote products derived
*     from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY  AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL  OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(This is an example of a 3-clause license.)

This is similar to an MIT-style license.

Your own license with custom provisions

Don’t do this. It won’t be OSI-approved, and people will have to study them in detail before deciding if they are free, and if they can be combined with other software such as GPL’d.

Public domain

This is not a license, this constitutes giving up any copyright (while above you retain it). It’s a bad idea since some jurisdictions don’t allow this anyway, so people over there don’t actually get any rights. In other jurisdictions worldwide, the way to release rights varies wildly. I have no idea what the variations are, and I don’t care to study it.

If you worry enough to want to learn at least a bit about licenses, then you probably don’t want to go public domain.


via blog.vucica.net

One thought on “License for your next free software/open source project

  1. EmP

    Nice overview. It figures that GPLv3 is not suited for my Zvjezdojedac project. Blah, at some point I'll have to pick appropriate one and add licence text on each source file.

    Reply

Leave a Reply

Your email address will not be published.

 

What is 12 + 3 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)

This site uses Akismet to reduce spam. Learn how your comment data is processed.