aclements / libelfin

C++11 ELF/DWARF parser
MIT License
317 stars 99 forks source link

Add copyright / license statements to the source files #9

Closed petterreinholdtsen closed 8 years ago

petterreinholdtsen commented 8 years ago

Would you be willing to add copyright / license statements to the source files? It would make it easier for packages reviewing the license status of the package and make it easier to make the package available in Debian.

It could look something like the comment below:

/*
 * Copyright (c) 2012-2016 Austin T Clements
 * All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

This would allow the tools used in Debian to check copyright status to work well with the code. The copyright year should be adjusted to reflect the modifications done to individual files.

petterreinholdtsen commented 8 years ago

I've requested a Debian package in http://bugs.debian.org/834123 .

aclements commented 8 years ago

I'm happy to make the tools happy, but is this really necessary given the top-level LICENSE file? Is there at least something shorter I could add to the source files rather than duplicating the full license text all over the place?

petterreinholdtsen commented 8 years ago

[Austin Clements]

I'm happy to make the tools happy, but is this really necessary given the top-level LICENSE file?

It make the tools in Debian happier at least. And in some jurisdictions it help legally too.

Is there at least something shorter I could add to the source files rather than duplicating the full license text all over the place?

My goal with the suggested header is to make sure the automated tools recognize the licenses. I'm not sure how short it can be, but I believe the one I sent will work. See <URL: http://people.skolelinux.org/pere/blog/Creating__updating_and_checking_debian_copyright_semi_automatically.html > for some ideas what I am talking about.

Happy hacking Petter Reinholdtsen

aclements commented 8 years ago

I looked through the DFSG and talked to some Debian maintainers I know and none of them thought it was necessary to duplicate the license in each source file. Unfortunately, I couldn't find any documentation at all on the expectations of these automated tools you mentioned.

How about if I add something like the following to each source file:

// Copyright (c) 2013 Austin T. Clements. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
petterreinholdtsen commented 8 years ago

[Austin Clements]

I looked through the DFSG and talked to some Debian maintainers I know and none of them thought it was necessary to duplicate the license in each source file. Unfortunately, I couldn't find any documentation at all on the expectations of these automated tools you mentioned.

I do not know their expectations either, I have just some experience on what is working. :)

Note, I talk about what make life as a debian package maintainer easier, not what is 'necessary' for some legal or prcedural definition of 'necessary'. It would make license review easier and increase the chance of getting the package accepted into the archive without imposing extra work on the ftpmasters and the package maintainer.

How about if I add something like the following to each source file:

// Copyright (c) 2013 Austin T. Clements. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.

I believe the tools are looking for fragments of license text, and doubt it will make the tools recognize the license.

Happy hacking Petter Reinholdtsen

aclements commented 8 years ago

@petterreinholdtsen, I added the smaller copyright header I proposed. Please try that with the FTP masters. If they reject it, let me know and we can do something more onerous.

petterreinholdtsen commented 8 years ago

[Austin Clements]

@petterreinholdtsen, I added the smaller copyright header I proposed. Please try that with the FTP masters. If they reject it, let me know and we can do something more onerous.

The header is not recognized by 'debmake -cc' at least, which outputs this by the latest version of the code from git:

Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: package Source: url://example.com

Files: dwarf/abbrev.cc dwarf/attrs.cc dwarf/cursor.cc dwarf/data.hh dwarf/die.cc dwarf/die_str_map.cc dwarf/dwarf++.hh dwarf/dwarf.cc dwarf/elf.cc dwarf/expr.cc dwarf/internal.hh dwarf/line.cc dwarf/rangelist.cc dwarf/small_vector.hh dwarf/value.cc elf/common.hh elf/data.hh elf/elf++.hh elf/elf.cc elf/enum-print.py elf/mmap_loader.cc elf/to_hex.hh Copyright: 2013 Austin T. Clements. License: UNKNOWN Use of this source code is governed by an MIT license that can be found in the LICENSE file.

Files: .dir-locals.el Makefile README.md dwarf/.gitignore dwarf/Doxyfile dwarf/Makefile elf/.gitignore elf/Makefile examples/.gitignore examples/Makefile examples/dump-lines.cc examples/dump-sections.cc examples/dump-segments.cc examples/dump-syms.cc examples/dump-tree.cc examples/find-pc.cc Copyright: NO_COPYRIGHT_NOR_LICENSE License: NO_COPYRIGHT_NOR_LICENSE

When using the header I proposed in elf/common.hh, the copyright is correctly classified and I end up with this output:

Files: elf/common.hh Copyright: 2013 Austin T. Clements. License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You would make my life as Debian packager a lot easier if you include the license in each file, as it allow automated tools like debmake to track copyright status for each file automatically, and I get a way to automaticlly discover changes.

Happy hacking Petter Reinholdtsen