Drupal GPL Questions I'm planning a new project that will require a great deal of custom code that must remain proprietary to my client. I found the licensing FAQ http://drupal.org/licensing/faq to be unclear.  I know this is primarily a coder as opposed to legal Q&amp;A forum, but hopefully some experienced Drupal developers can shed more light on this issue.


What constitutes distribution?  For example, if the code is used on two unique domains owned by the same client, is that considered distribution?  Page 533, Chapter 24 of The Definitive Guide to Drupal 7 states "Modules built for ourselves or a single client are not considered distributed", but that isn't very clear.  
If a module has been distributed and you have a copy, are you obligated to give me a copy, or is it up to you?  (In other words, could I demand a copy from you?)
If custom javascript is called from a Drupal javascript object (such as Drupal.behaviors), is it considered GPL'd and distributed?  The licensing FAQ Answer #7 states "Drupal's JavaScript, including the copy of jQuery that is included with Drupal, is itself under the GPL as well, so any Javascript that interacts with Drupal's JavaScript in the browser must also be under the GPL or a GPL compatible license."  That's a major non-starter for this particular project.  The client obviously doesn't want competitors walking off with highly specialized javascript that took months to develop with no legal recourse.
What is the legal status of modules that are not for distribution?  Are they license-free, or are they automatically GPL'd even if not intended for distribution?  For practical purposes, in a module that is not for distribution, would the following language have any legal effect:  "This module is copyright Company XXX and is not intended for distribution.  This software is not licensed and you may not use this module for your own purposes."


Apologies if these questions aren't as precise as they could be; I'm obviously not a lawyer.  I really want to use Drupal for this project, but if I can't offer an assurance to the client that the custom code (module code and javascript) will remain proprietary it's a non-starter.
(Disclamer: As usual with legal questions, I am not a lawyer, only a lawyer can give you a definitive answer).

Every Drupal module that is written and every javascript code that directly interacts with Drupal (or any other GPL code, but note that jQuery is dual-licensed and also available under the MIT License, this is not relevant when used with Drupal, though), automatically falls under the GPL. That's why GPL is also called a viral license. Everything it "touches" is GPL'ed automatically.

If you give the source code to someone, then he has every right the GPL grants him, including giving the source code to anyone he wants to, modify it and so on. However, viewing a website alone does not distribute your PHP code. JavaScript is a tricky question, see for example https://softwareengineering.stackexchange.com/questions/125955/using-gpl-licensed-jquery-scripts-on-website-with-ads and http://www.gnu.org/philosophy/javascript-trap.html. As far as I understand these, you always distribute the JS code.

So, obfuscating the JavaScript without providing a way to get the unmodified source code or adding a statement like the one you suggested above is in fact a direct violation of the GPL and someone could attempt to sue you.

Also note that there is an extended version of the GPL, the Affero General Public License, which explicitly includes viewing of a website as distribution. CiviCRM for example uses that license, so if you are required to allow visitors access to your custom adjustments/extensions of your website, when using a software like that.

Given the way the Ajax system in Drupal works, most relevant things usually happen on the server side, so that is usually not a big problem. Also, most GPL related lawsuits are usually related to companies selling products which run GPL software (e.g. routers) which don't provide access to their customized source code. I've never heard of a lawsuit against a website violating the GPL, but that could just be ignorance on my side, don't count on that ;)