views:

299

answers:

4

I want to reuse some code licensed under a BSD license but I don't know how to make it clear what I wrote, what I have reused and what I have modified.

Say the project I want to reuse code from has the following directory structure:

project/
|-- LICENSE.txt
|-- module1/
|   |-- file1.c
|   |-- file2.c
|   `-- file3.c
|-- module2/
`-- module3/

and the contents of LICENSE.txt is a BSD license, i.e. its contents are:

Copyright (c) <year>, <copyright holder>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
[...]

(See wikipedia for a template of the full text.)

Also, the copyright is only stated in the LICENSE.txt file and not in every individual source code file.

If I now copy everything under project/module1/ to my own project:

my_project/
|-- module1/
|   |-- file1.c
|   |-- file2.c
|   `-- file3.c
|-- my_file1.c
|-- my_file2.c
|-- my_source_code1/
`-- my_source_code2/

How should I state that I am not the copyright holder of the files under module1? Would it be enough to copy the original LICENSE.txt, with the original copyright holder in it's header, to the module1 subdirectory? Or should I add a copyright header to each individual file?

What if I modify any of the files under module1? Should I then somehow add myself as an additional copyright holder for the files I modified?

Note: I am perfectly fine with using the same (or a compatible) license for the code I wrote.

+1  A: 

I like to have the license referenced inside a comment in the source code - it is easier that way as people are more likely to open a source file and play around than examine the directory structure first. A simple comment stating that the code is copyrighted to X and is licensed by Y just helps to direct someone to the appropriate license file.

Jeff Yates
So, even though the original files I am reusing did not have a comment stating the copyright, you would add one? And in case I modify a file, you would add a comment stating that the file has been modified by me?
davitenio
+1  A: 

Copy LICENSE.txt in your module1 dir, and mention in your docs (README, LICENSE, etc.) that you use this part of the project. BSD style license is very liberal: as long as you give due credit and respect its requirements (this usually involves providing the unmodified license and copyright notices), you can do whatever you want with the code.

If you modify any file, a good practice is to mention it in the file header, around your changes, and in your global docs. If the modified files had no copyright notice, just add one describing your changes. That way users can known which files were modified, who did it, why and how.

It's that simple: do it in a very descriptive way. There is no formal procedure to follow, contrary to GPL style licenses. This is more documentation than legal work.

fbonnet
And if I modify any of the files in module1? Would you mention that explicitly somewhere?
davitenio
If the code I am reusing was GPL licensed there would be a formal procedure? Can you give any pointers to that procedure or explain it yourself?
davitenio
The comment field is too short to describe the legal obligations that the GPL puts on the users, I suggest you read the Wikipedia page: http://en.wikipedia.org/wiki/Gpl .For example, you can't distribute in sole binary form, and must publish all your changes as GPL'd sources.
fbonnet
+1  A: 

You don't want to take any chances here of misinterpretation of copyright. So, I would go as far as the following structure:

my_project/
|-- the_other_project
|    |-- LICENSE.txt
|    |-- module1/
|    |   |-- file1.c
|    |   |-- file2.c
|    |   `-- file3.c
|-- my_file1.c
|-- my_file2.c
|-- my_source_code1/
`-- my_source_code2/

In addition to this:

  • each file should have a header mentionning the Copyright, owner and license
  • mention in your own license that you are using portions of code of another project
  • if you modify code in the other projects, add your copyright and name in the source files of the project.

That's if you are not doing too many modifications to the other source code. If you are rewriting everything, simply mention in your license the origin of the other code.

Bluebird75
A: 

I just found Maintaining Permissive-Licensed Files in a GPL-Licensed Project: Guidelines for Developers, published by the Software Freedom Law Center. Although it talks specifically about incorporating BSD style licenses (they call them permissive) into GPL licensed code, I think the recommendation in section 2.1, Including unmodified permissive-licensed files, would be a good general recommendation. I quote:

If the external project uses the single COPYRIGHT file method, the developer should copy the names of all the copyright holders from that file and place them, along with any copyright, permission, and warranty disclaimer notices required by the permissive license, at the top of the incorporated source file.

In case you modify the included files and your project is GPL, there are two relevant sections in the mentioned document:

The case were you modify the included files and your project is not GPL is obviously not addressed by the document. But from what I have gathered from the other answers I would say, as long as the license you use for your project is not viral, that the proper thing to do would be to just add yourself as a copyright holder to the copyright header of the file you modified and mention somewhere in your docs the origin of the included code.

davitenio