8

I have a code that I'd like to share, but I'd like to publish it using an open source license. But I don't know how you have to use that licenses.

How do you have to activate an open source license? Just including the text of the license in all files? What else do I have to do? Do I need to buy some right? Include a readme.txt in all the directories? I mean, what do I have to do if I want my code is protected by the legal test of a license?

The second question is what it is the better license for this conditions:

  • I don't care what people do with my code, educational purposes, to make money, I don't mind whatever they want to do with it.
  • But I want people don't delete my name from the code, and If they use my code force them to mention me. If they change my code and someone ask for those modifications, they give the code with the modifications.
  • But I don't want to force people to publish the code of they applications, even if they are using my code.

What is the best license to that purposes?

gnat
  • 21,442
  • 29
  • 112
  • 288
  • I think you need to be more clear about what you want. "If they change your code and someone ask for those modifications" - do you mean like in a web application, or in a desktop application, or both? This is actually relevant to the license, surprisingly enough! – Robin Green Apr 22 '11 at 12:06
  • thanks for the point, I've just clarified in later comments, I just want that if someone uses my code they are obliged to say in any place (about, web, etc) that the code is mine. But I don't mind if they don't want to turn their proyect in an open source project just because is using my code. –  Apr 22 '11 at 14:20
  • I think it is clear, you make a present (the code), and people can use that present as the like, they can use it even to make a profit, and you don't mind. But you want that people knows they are using your code, that is. –  Apr 22 '11 at 14:21
  • I've noticed many people here have actually suggested use of the 4-clause BSD. Technically, that license is not even open source according to the OSI. I don't agree with the GNU projects view on things, but I do think their [paper on the 4-clause BSD](http://www.gnu.org/philosophy/bsd.html) is worth a read. tl;dr - It leads to thousands of attribution sentences on advertisements for big projects, like Linux or BSD distros. – Nathan2055 Apr 24 '13 at 15:05

7 Answers7

13

Here's a handy guide:

https://i.stack.imgur.com/GvOBw.png

References to PDF and Graffle versions of above flowchart are available at Karl Fogel's blog.

gnat
  • 21,442
  • 29
  • 112
  • 288
RHPT
  • 1,001
  • 9
  • 11
  • 1
    [-1]. While I fully understand, that it primarily supposed to be funny rather that informative, I also believe, that it should not contain defects, that may mislead somebody in such a complicated thing as licensing; but it does contain ones. [See next comments] – Dmitry Alexandrov Sep 09 '14 at 16:07
  • 1
    ① The chart is titled ‘Which Open Source License?’ and infamous 4-clause BSD license is one of the options. But software under the 4-BSDL is *not* considered so called ‘open source’ by OSI. It is so called ‘free’ accordind to FSF, though, but still is highly [not recommended](http://www.gnu.org/philosophy/bsd.html). – Dmitry Alexandrov Sep 09 '14 at 16:07
  • 1
    ② ‘Creative Commons’ is not a license at all, it’s a foundation, which published a bunch of fundamentally different licenses, which varies form public domain dedication CC0 to ‘free advertising license’ CC-BY-NC-ND, most of them are non-free. – Dmitry Alexandrov Sep 09 '14 at 16:08
  • ③ While the background proposition that when you’re writing something for infrastructure (rather than standalone program) you should apply the license accepted in there, of course, is right, Perl and Mozilla software and *not* licensed just under Artistic and MPL respectively. Perl is under Artisic or GPLv1+, Mozilla software are under MPL or GPLv2 or LGPLv2.1, where ‘or’ means disjunction of restrictions; so by choosing only one license from the list you fails compatibility. – Dmitry Alexandrov Sep 09 '14 at 16:09
5

Use original 4-clause BSD license.

  • I don't care what people do with my code, educational purposes, to make money, I don't mind whatever they want to do with it.

  • But I don't want to force people to publish the code of they applications, even if they are using my code.

Like most open-source licenses, it allows user to modify and redistribute the source. It allows them to use it for any purpose.

  • But I want people don't delete my name from the code, and If they use my code force them to mention me.

Unlike most modern OSI approved licenses, this one has so called "advertising clause", meaning that authors of software using your library must mention that their product contains code developed by you.

Text of the clause:

"All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the <organization>. "

  • If they change my code and someone ask for those modifications, they give the code with the modifications.

That's kind of problematic. Only copy-left licenses require that. Using copy-left license is contradictory with the rest of your requirements.

vartec
  • 20,760
  • 1
  • 52
  • 98
  • 1
    The original 4-clause version is not listed by the Open Source Initiative as an Open Source License (see http://www.opensource.org/licenses/bsd-license). There's enough license proliferation and license incompatibilities around without bringing in old or variant licenses. – David Thornley Apr 25 '11 at 21:51
  • 1
    @David: of course it's not listed by the OSI, the advertisement clause is not compatible with OSI definition. – vartec Apr 26 '11 at 08:03
  • The old BSD license was discontinued because it forced to compile endless lists of names in the final copyright notice. The new BSD license just as suitable (and probably more so) in his case: the author's name must remain with the code itself. – Denis de Bernardy May 22 '11 at 14:44
  • 1
    OP says " If they change my code and someone ask for those modifications, they give the code with the modifications." BSD does not require that. It is not copy-left. LGPL might be better. – MarkJ May 01 '13 at 07:51
3

I am not a lawyer and the following is not legal advice, but what I've gathered about copyright law as a programmer.

If you author a piece of software, you have the copyright on it unless someone paid you to write it. You should state the copyright in the software or in a README, followed by the license terms or, if using a verbose license such as the GPL, a pointer to where the license can be found. If you now publish your software, it's covered by the license. You should inform the user of the license, e.g. in an installer or in the manual.

The kind of license you want sounds like a copyleft, but weaker than the GPL. Consider the GNU Lesser General Public License (LGPL).

Fred Foo
  • 1,316
  • 7
  • 12
  • I don't believe the (L)GPL has an attribution cause that would "force them (people using the code) to mention me (the original author)" like Pedro mentioned. –  Apr 22 '11 at 12:07
  • 2
    @danielkza: I believe you can't legally remove the copyright notice from a copyrighted piece of work, so the OP's name can't be removed. – Fred Foo Apr 22 '11 at 12:10
  • 1
    @larsmans: I believe he wants his name cited not in the code itself, but in the credits/about box/site footer/etc. I may have misinterpreted it though. –  Apr 22 '11 at 12:19
  • Thanks a lot for the answer. Very useful information. It is as I thought, but I was not sure. I'll see some open source projects to see how they include the legal text. –  Apr 22 '11 at 13:06
  • I think I'll read those two licenses, GPL and LGPL, to see what is the better for me. –  Apr 22 '11 at 13:06
  • @larsmans You are right, I'd like both things. That people can't remove my name from de code, but also what you say, I'd like they have to cite me somewhere (credits/about box/etc) telling they are using my code, even if I don't forsce them to publish their own source code. –  Apr 22 '11 at 13:11
  • Larsmans is right when it comes to copyright unless you are paid to do it you maintain the copyright in the US. However, for that to hold in the court of law of the United States you must register your copyright, which I belive is about $35 if you file online http://www.copyright.gov/docs/fees.html. That holds true for even open source software. If you look at Eclipse it has a copyright held by the Eclipse Foundation and Apache has copyrights held by the Apache Software Foundation. – Travis Pessetto Apr 25 '13 at 16:21
2

The Free Software Foundation has been very successful in pursuing litigation against people who have violated the terms of their open source license. I remember an article from ~2006 showing they were 4 for 4 at that time; more recently they have settled lawsuits against Cisco, Skype, and Verizon, all resulting in payments to the FSF. In general, however, the lawsuit begins only after repeated attempts to inform the defendant of their obligations has been made. So just to save time, require the user to click an 'accept' button in a standard license dialog, save the license terms file in its own 'license' folder, and you should be all set.

As far as the particular license to use, it sounds very much like you want the LGPL, which does everything you ask except possibly the attribution part--you might have to make that a separate stipulation.

Matt Phillips
  • 201
  • 2
  • 9
  • Thanks I'll read the LGPL text, but it is so so boring to read legal texts ;) –  Apr 22 '11 at 13:22
  • 1
    IIUC the LGPL is to be used instead of the GPL when you are more concerned about the proliferation of your library instead a competitors library, and aren't as concerned with the freedom angle in this case. For example, if you've written an image library to compete with other image libraries, the LGPL would let other people use your library easier than a [proprietary] competitors library. – Jeff Welling Apr 28 '11 at 20:55
2

I don't think there is a license that exactly matches your requirements. It sounds like you want some kind of mixture of the AGPL and the LGPL. But the FSF has not yet got around to creating such a license! You can see their official response here: https://stackoverflow.com/questions/3330792/why-isnt-there-a-lesser-affero-general-public-license/4419776#4419776

Robin Green
  • 1,233
  • 1
  • 9
  • 22
  • Thanks for the answer, I was guessing that there isn't any license, but at least I'm looking the best match. –  Apr 22 '11 at 13:12
  • There are some licenses that force people to publish their own code if they are using mine. That's to say, you have to turn your project into an open source project if you use some code with those licenses. I don't mind if they don't want to publish their code. My main concern is that at least people now they are using my code. That is enough for me. –  Apr 22 '11 at 13:13
  • I really don't think someone wants to use my code in their projects ;) Mainly because they are excercises that show how to make a three layer java aplication from scratch using TDD. I'd like to share that code and I'd like people use it to teach TDD, but I want they are obliged to say that the exercises an examples are mine. –  Apr 22 '11 at 13:20
1

How do you have to activate an open source license? Just including the text of the license in all files?

I don't know what the exact legal requirement is, but normal practice is to include a small header comment at the start of each file:

  • that states who owns the copyright, and
  • that states that the file is covered by such-and-such a license, telling the reader the name of the file that contains the text of the license, and telling them where to find the text if the file is missing.

What else do I have to do? Do I need to buy some right?

No.

Include a readme.txt in all the directories?

No. A single README file in the root of the directory tree is a good idea, but not mandatory.

I mean, what do I have to do if I want my code is protected by the legal test of a license?

To be absolutely sure, talk to a lawyer.


Concerning your licensing requirements.

(1) I don't care what people do with my code, educational purposes, to make money, I don't mind whatever they want to do with it.

That is kind of a non-requirement. Very few licenses forbid people from making money, use in education, etc.

However "do what they like with it" literally contradicts some of your other requirements.

(2) If they change my code and someone ask for those modifications, they give the code with the modifications.

The requirement that they provide the source code of any modifications that they make is present in GPL, LGPL, AGPL, but not in Apache, BSD, and other common licenses.

(3) But I want people don't delete my name from the code, and If they use my code force them to mention me.

Most licenses require attributions in the code to remain in the code.

However "force them to mention me" is difficult, and few if any licenses say that. Indeed the FSF position is that such a requirement makes your code non-free ...

(4) But I don't want to force people to publish the code of they applications, even if they are using my code.

Few licenses force people to publish the code of their application as a matter of course. Even the most radical of the GPL family allows you to use and modify software for purely private purposes.

However GPL et al do force people to publish the source if people distribute an application based on yours. (The precise conditions depend on the license. For example, LGPL allows people to link their code with yours without forcing them to publish theirs. On the other hand GPL requires them to publish their code in those circumstances, and AGPL extends this to other areas.)

Note also, that requirement (2) and (4) are literally contradictory.


In summary, you need to be able express your requirements for a license clearly. If you can't do that, then you've little chance in finding a license that matches your requirements.

Or maybe you should just talk to a lawyer. (He / she will obviously need to ask you a bunch of questions to elicit what your real requirements are.)

Stephen C
  • 25,180
  • 6
  • 64
  • 87
0

You can use whatever license you want (even make your own ) on the work which belongs to you (you have the copyright) this is usually done by including a copy of the license in the file COPYING along with the source code.

What you are looking for is XFree86 1.1 styled License (It which is a permissive non-copyleft license(no need to open the source if you use it but requires a acknowledgement) and satisfies all your requirements .

  1. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors", in the same place and form as other third-party acknowledgments. Alternately, this acknowledgment may appear in the software itself, in the same form and location as other such third-party acknowledgments .

You can replace the xfree86 name with your name and distribute it.

Lincity
  • 101
  • 2