Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including code in open source projects [closed]

Tags:

open-source

I have an open source project under Apache License 2.0. Normally, I would just include the License Terms and Conditions comment at the top of each code file.

What about code that I copied from someone's blog, or website? Is putting a link referring to the site enough? And I still leave the License Terms and Conditions there even though the code was written by someone else?

What's the proper way of doing this?

like image 921
sean Avatar asked Jul 27 '09 06:07

sean


People also ask

Can I use code in open source project?

You can use open source code in proprietary software. But you should be aware of what open source licensing applies. For instance, some licenses allow you to sell your software. But your code must be open sourced under the same license.

Can you make an open source project closed source?

Yes, it is possible to make an open source project into a closed source project. The copyright holder can change the license of a project at any time, or cease to distribute source code of new releases. New releases can therefore be made closed source.

Can you see closed source code?

With closed source software (also known as proprietary software), the public is not given access to the source code, so they can't see or modify it in any way.

Can I reuse open source code?

For digital services, open source code is most reusable when the package supports the same business process or can addresses a software problem that is the same regardless of business-process.


4 Answers

You can't relicense code that isn't yours as you don't own the copyright. If the code is already under a license you must use that, and provide that license as part of your package.

If the code isn't under a license then personally I'd look for an alternative piece of code which is licensed under the Apache license, obviously retaining the copyright statement in the code, and note the source and copyright it in the documentation for your project.

If you can't do that why not email the code author asking if they'd state a license for it? If they choose a license different to yours then you should make it clear that piece of code is under a different license in both the code itself and your documentation.

(Of course I am not a lawyer, nor do I play one on TV, and as licensing is a legal agreement you should consult one rather than take advice from random strangers on the internet)

like image 126
blowdart Avatar answered Sep 29 '22 20:09

blowdart


Don't copy a code from a blog unless it is explicitely Public Domain or under a compatible license.

If it is under compatible license you just mention it at the license header at the top of the relevant file. (and also include a clause into your about dialog) This last bit might not be required by certain licenses, but is still a good way to say thanks.

like image 45
EFraim Avatar answered Sep 29 '22 20:09

EFraim


What about code that I copied from someone's blog, or website? Is putting a link referring to the site enough?

IANAL, but you can not go about altering peoples license without getting permission from them. If the code you copied from the blog is under a conflicting license to Apache you can not include it in your project. There is a fair use argument, but its pretty slippery (Eg. I just copied something so small that it really needs no attribution).

So, I would recommend you read all the fine print on the blog you copied the sample from, and if you have any doubts shoot off an email to the author explaining what you are doing. In general people are fine with a hyperlink to their blog post in the source, but every person is allowed to license their IP under whatever license they choose.

like image 37
Sam Saffron Avatar answered Sep 29 '22 20:09

Sam Saffron


I see this as a serious problem, in that anything that is out there without an explicit license may as well not be out there. For example, I can't find any mention of what license is required on http://snippets.dzone.com/. I come across this site frequently in searches. They claim to be a "public source code repository", but what's "public" mean?

Similarly on gist.github.com, though there people seem to be a bit better about putting an explicit license in their files.

You, as a user of these sites with a piece of code you'd like to use in front of you, can't solve this problem. In an ideal world, the developer submitting something would include an explicit license, but that seems unlikely. The best we can reasonably hope for is for these kinds of sites to force users to choose a license when pasting anything.

In most cases, these snippets aren't significant enough to have any commercial value or to warrant any restrictive licensing, but without an affirmative action on the part of the person submitting, it remains theirs, with all rights reserved other than those that have been explicitly granted to others.

like image 25
Kevin Peterson Avatar answered Sep 29 '22 19:09

Kevin Peterson