When I’m releasing a program, I like to license it under the GPL or LGPL. I also want to stay compliant with that license. I’m not good at reading legal documents, and the GPL3 is about 10 pages long. How do I avoid GPL violations in my code?
Did you write the code?
Then the GPL is working for you – you don’t need to do anything to bide by it, the people you distribute the code to are bound by it. Remember the GPL doesn’t apply to you for your own code – you are still free to do anything else you want with it. You can even sell it alongside the GPL version.
If you used other GPL code in your app then you just abide by the same license. You include the same gpl.txt file and make your source available (put it github etc)
edit: to add luis’ point. If you accept contributions from anyone else then the GPL would apply to you – unless you had them give you extra permissions
1
Does your code use any tools, APIs or other code that you didn’t write? What are the licenses of those bits of code? Are they GPL compatible? You understand, of course, that using the GPL means that no-one can distribute closed-source code with your code because doing so forces that code to become GPL.
Did anyone else contribute to your code? Do you have contributors agreements with them?
If you wrote the entire code, then you own it, and you can release it under GPL- the question “How do I avoid GPL violations in my code” does not really apply here.
If you used code from other open source projects in your code, you can still release your code under GPL as long as you identify what pieces come from where, and satisfy the license obligations coming from the other open source projects. Check the licenses of the code you have used to see what their obligations are (eg you may have to add their license.txt into your package).
If you used code from non-open source projects in your code, then you need to contact the owners (copyright or license holders) of those proprietary projects and get their permission.