There are two choices while writing on this topic. One is to write a detailed and accurate port. The other is to write a short post. I preferred the second approach and had added appropriate links to dig further.
- Target Audience?
- Someone who is planning to use FOSS, free and open-source code, as a building block for their software development.
- Someone who wants to contribute to FOSS
- Someone who wants to release source code of their project in public
A few theoretical questions** (can be skipped)
What’s free software? As defined by Free Software Foundation, it’s software whose licensing conditions promise following four freedoms
- Freedom 0: freedom to run the program for any purpose. Eg. Software restricted for educational use hinders this freedom like those distributed under Microsoft Academic Alliance
- Freedom 1: freedom to study how the program works, and change it to make it do what you wish. Eg. Software whose licensing terms forbids reverse engineering curtails this freedom
- Freedom 2: freedom to redistribute copies. Eg. Software like WinXP whose licensing terms forbids the copying of software and using it on multiple systems curtails this freedom.
- Freedom 3: freedom to improve the program, and release your improvements and modified versions to the public. Eg. Freeware which can be downloaded for free of cost but modifying them and then distributing modified copy is a violation of license agreement, hence, violating the copyright law.
What’s open-source software? Quite literally, it implies that the source code of the software is available. But, OSI has a stricter definition. There are minor differences in the free and open-source movement. For example, if a hardware lock preventing the execution of a modified software is considered a violation of user’s freedom. But it is believed that it does not violate the definition of being open-source. A detailed article here.
What is FOSS (free and open-source software)? Though the open-source software is a subset of free software, the word FOSS (which is identical to Free) is used to refer to software which is both free and open-source. So, from a developer’s perspective, it is the same as Free software.
But I thought free software has zero price? Zero price is not central to the philosophy of free software; it’s just the outcome of Freedom 2 and economics of demand-supply. It must be noted that there is zero price software which does not adhere to above freedom; they are called freeware.
So, free software is more about “freedom” rather than “free (zero-price) stuff”? Yes
Now, the practical part
- What are the major free software licenses?
- GPL
- LGPL
- Apache
- BSD
- MIT
- Affero GPL Full drafts of these can be found here; I will highlight the important points below.
- What about creative commons? Do NOT use creative commons for code licensing. Creative Commons license is meant for artwork excluding software code. Therefore, it can still apply to images/text/videos which are a part of the software. For software code, use one of the above licenses instead.
- What about the Mozilla Public License (or any other license not in the above list)? I might write about them once, I have read them and understood them.
GPL
What is GPL (GNU General Public License)? Any software released under GPL implies that it,
- The software guarantees all four freedom above. There is a minor issue read the next question for that.
- Software code will be provided (on request or with the executable) in usable, unobfuscated format. There was a debate on Slashdot about whether providing the right build environment is necessary and I think the answer is yes since not providing it violates Freedom 3)
- A work derived from GPL-licensed work must be licensed again under GPL. Any “patchwork” to original code is derived work; this includes WordPress themes. A work statically linked to a GPL licensed library will be considered derived work and hence must be distributed under GPL license. A work dynamically linked to a GPL licensed library is a grey area. FSF believes it’s derived work. Novell lawyer Matt Asay believes it is not. A work which includes GPL licensed header files containing only macro definitions and no inline code is not considered a derived work. See discussion on the android-platforms group.
What if the company releases source-code (due to GPL license) and then locks down its hardware from running modified code? This is called TiVoization since a consumer electronics TiVo did this. GPLv3 includes a specific clause which implies that hardware lock, e.g., encryption keys/checksum matching cannot be applied to the products. More discussion here. Industrial products like cardiac pacemaker are an exception for safety reasons.
Are there any other significant changes in GPLv3? Yes, Microsoft claimed that GNU/Linux violates its patents. Further, Microsoft and Novell made a deal with a controversial conclusion that Novell customers are protected from patent infringement by Microsoft. So, all others GNU/Linux users who are not Novell customers are not. GPLv3 prevents such future deals in two ways
- It dictates that anyone who distributes GPL v3-licensed code and provides a patent license to some group of recipients must automatically extend that license to all recipients. (So, non-Novell customers are protected as well).
- It includes a stipulation that an entity, like Novell, cannot distribute covered code if the entity enters into a deal with another software distributor that involves them paying that software distributor to not sue your customers. In this case, the ‘payment’ would be in the form of an undertaking not to litigate.
What if I initially released my project under GPL and now wish to move to non-GPL license? You own right to modify license for “your” code. But any patches supplied by any 3rd party are still under GPL, so, you need their permission before releasing their patches as a part of your non-GPL code. Also, the previous version of your code is still available to 3rd parties, and they can fork and develop that.
LGPL
- What is LGPL (GNU Lesser General Public License)?
- It is more permissive that GNU GPL in the sense that an LGPL licensed library can be dynamically linked to by a non-LGPL(read proprietary) code.
- Any derived work must still be released with the clause that “modification and reverse engineer is allowed for personal use and debugging.” Some people confuse LGPL as library GPL, which is a license for open-sourcing their libraries. This assumption arises from its former name, Library GPL. GNU website states that if your library is similar in functionality to other proprietary libraries use LGPL, but if your library offers something unique use GPL.
- Can I write GPL code which uses LGPL library? Yes
- Can I write GPL code derived from LGPL library? Yes
Permissive Licenses
What is BSD license? There are various versions of this license. The fundamental crux of all these is “any code released under this license can be used in any manner after providing accreditation to the original author of the code”. Contrast this with GPL, no release of source code for the derived work is necessary, no prevention of TiVoization and, it is silent about the issue of software patents. Due to the permissive nature of this license, the BSD based code is heavily used by major companies.
Can a BSD licensed code be used to write proprietary (closed-source) software? Yes
Can a BSD licensed code be used to write GPL licensed software? Yes. Do note that for the reverse case, everything has to be distributed under GPL and not BSD.
What is the MIT license? Same as 2-clause BSD license(FreeBSD license).
What is Apache license? Apache is similar to FreeBSD license except that it is,
- Legally more elaborate and,
- explicitly grants patent rights were necessary to operate, modify and, distribute the software.
Can an Apache-licensed code be mixed with GPL licensed code? Not with GPLv2 but Yes with GPLv3 because of the patent clause. GPLv2 does not allow any additional restrictions while GPLv3 allows a patent retaliation clause. I know its all confusing, but that’s how it is. Further reading here.
Finally
Can you summarize this? Use GPL if you wish to restrict the use of your work and thus, ensuring more freedom for users of derived work. Use LGPL if you are developing a library which replicates functionalities of a closed-source library. Use Apache/BSD/MIT if you wish to allow more extensive use of your work (but less freedom for users of derived work) Apache has a distinct advantage of being more legally explicit than BSD/MIT and patent indemnification clause. But as mentioned in the previous question, the same patent clause renders Apache incompatible with GPLv2. BSD/MIT have an advantage over Apache of being compatible with GPL. BSD/MIT licensed code can be included in GPL-licensed project. Also, they are easy to comprehend for a software developer without a lawyer — further reading here and here.
What is Affero GPL? It is useful for remotely executed applications like web applications which interact with their users over the network, and binaries are not distributed. Consider a simple example. Bob releases a web CMS under GPL, John modifies it and uses it for its website, John is under no obligation to release source-code of his website. If Bob releases his CMS under Affero GPL, then John would have to provide a download button on his website for downloading the source code.
What is dual-licensing (or more generically, multi-licensing)? Since all licenses are not compatible with each other, project owners can release their code under multiple-licenses simultaneously. Hence, the one who wants to use the code can choose the license as per his/her needs. E.g., jquery is dual-licensed under MIT and GPL)
What is copyright? Creator of creative work, including artwork and software, has certain rights automatically granted to him/her due creation. These rights include the ability to sell his right to someone, sell copies of work while still retaining rights, allow someone to create derivative work for royalty, and impose further restrictions. More details here. All the licenses mentioned here are copyright licenses.
What is copyleft? Copyleft is a category of copyright licenses which allow someone to create derivative work and distribute copies of the work while imposing restrictions on how derivative work can be re-distributed/re-used. Eg. If someone is stating that derivative work is allowed, then they cannot restrict the distribution of the derivative work. GPL and LGPL (both described below) are examples of strong and weak “copyleft” licenses, respectively. BSD and Apache are examples of non-copyleft free software licenses. The two questions on copyright and copyleft tare added in response to suggestion. More details here
Disclaimer:
- I am not a lawyer. This blog post is based on my understanding of the major open-source licenses and might have errors/omissions. In case, you might spot an error/omissions, please mention that in comments and I will correct that.