Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is there a way I can make the license I use for an open-source software package be valid for all contents of the package without having to write it into every single file?

I often saw a LICENSE file, but does this file (with the license in it) makes all contents of the package (i.e. the current directory and all sub-directories) use this license?

share|improve this question
2  
Your best option is to write a script that traverses all directories and prefixes the files with the license (for example all files that match *.c or *.h) –  Shahbaz May 28 '12 at 17:05
add comment

2 Answers

Judging by what I've seen in many other projects, you don't need to include the entire text of your license in every file. You should, however, include your copyright notice and a reference to your license in every file. I've often seen statements along the lines of:

©2012 Joe Cool. See the license terms in the file 'license.txt' which should
have been included with this distribution. A copy of the license is also
available at <http://joecoolswebsite.com/license.txt>.
share|improve this answer
add comment

The legal assumption is that every file is copyrighted. You can just describe in your license what's covered. Anyone who doesn't read the license but just the sourcefile will have a subset of the rights that you granted (Open Source doesn't take away legal rights). Everyone who does read the license knows what's covered, and can exercise all the rights that you have granted.

However, good Open Source licenses (such as the GPL) provide you with guidance how to apply the license. In particular, the GPL suggests adding to every source file a small reference to the actual license.

share|improve this answer
    
I'm going to upvote this answer while resisting the urge to begin the age-old debate as to whether copyleft is "good" open source ;-P –  TehShrike May 28 '12 at 22:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.