How to apply an open source license to your project

Last modified by Administrator on 2023/02/17 01:52

DRAFT – How to apply an open source license to your project

General notes

There is no strict set of rules on how to apply an open source license to your work, but the established practices and licenses text allow to detach a few patterns. What matters is that you make sure the applicable license text is unambiguously known to your users and co-developers.

Many developers prefer an explicit approach with the following steps:

  • include the text of the license in the project's root directory. The text is commonly expected in a file called LICENSE or COPYING, or small variations of these names.
  • add headers with copyright and/or license details to files: copyright holder, year, name and version of the license, and canonical or local location of the license. The headers can be more extensive than just these items, but at least these are commonly present.
  • inform about the license in your project's readme and on your project's website, if any. This is not part of applying a license in itself, but it helps people to figure out easily and quickly, what license they will likely find when they download your software. It may also matter for potential contributors.

License text

You can find the canonical license text on the site of the license steward, or on opensource.org site. Inclusion of the text of the license in a LICENSE or COPYING file in your project will make sure the package is licensed such that every user downloading it or receiving it from someone will be able to read in plain text what are the conditions under which they have received the code.

Copyright and license headers

Some licenses text, or published FAQs from license stewards, usually recommend to add copyright and license information to file headers extensively. If you're not sure, it's always better to follow the recommendations and be inclusive about it.

In a published guide (please see the referenced guides below), Software Freedom Law Center points out that maximal inclusion of copyright information and boilerplate license texts in file headers is not necessary for the work to be licensed correctly. Some developers prefer to simplify file headers, for aesthetic, size or other reasons, and therefore might choose to not include 10-15 lines boilerplate text.

When you identify copyright holders, you can use individual names, project name, or in some cases the name of organization behind the project. You can use pen names as well as real names. The most common approaches involve the use of project name, with or without further qualifiers.

A general, simple pattern for copyright and license headers will look like this:

/**
 * Copyright (c) <year> <name of copyright holders>
 * Licensed under <name and version of license>
 * <URL of canonical license text or file>
 */

Particular licenses instructions

Several open source licenses have instructions on how to apply them, in the text of the license, in an appendix. Check the license you want to use, and if it has such instructions, just follow them. For example:

Apache 2.0 license: "APPENDIX: How to apply the Apache License to your work"

GPL-3.0 license: "How to Apply These Terms to Your New Programs"

The license stewards may also maintain a FAQ to assist projects, such as for MPL 2.0, "I want to use Mozilla Public License. What do I have to do?".

Third party software licenses

If your project includes third-party packages, such as an open source library your code uses, you must respect their terms when you license your project and distribute other software with it. Being compliant with open source licenses is usually very easy, but make sure to exercise diligence to familiarize yourself with their terms and follow them in your specific case. If you still have questions, the project's website or their mailing lists are good places to get answers.

General guides on how to apply a license

Karl Fogel's book Producing Open Source Software contains a concise guide on How to Apply a License to Your Software.

The Software Freedom Law Center maintains a guide on Managing Copyright Information within open source projects.

Ian Taylor's short guide on licensing answers the essential questions you have when you license your project.

Disclaimer

Please note that OSI is not a legal services organization and none of this content is legal advice.

Tags:
    

Submit feedback regarding this wiki to webmaster@opensource.org

This wiki is licensed under a Creative Commons 2.0 license
XWiki 14.10.13 - Documentation