blob: bebc7db34f742d004460025d2928df0fae7146b8 [file] [log] [blame]
Don Newton379ae252019-04-01 12:17:06 -04001#!/usr/bin/env perl
2use v5.10;
3use strict;
4use warnings;
5use utf8;
6use open qw/:std :utf8/;
7use File::Find qw/find/;
8
9my @license_files;
10
11find(
12 sub {
13 return unless lc($_) eq 'license';
14 push @license_files, [ $File::Find::dir, $File::Find::name ];
15 },
16 'vendor'
17);
18
19print forked_licenses();
20
21for my $entry (sort { $a->[0] cmp $b->[0] } @license_files) {
22 ( my $package_name = $entry->[0] ) =~ s{vendor/}{};
23 my $license_text = do { local ( @ARGV, $/ ) = $entry->[1]; <> };
24 $license_text =~ s/ +$//mg;
25 say "" x 70;
26 say "-" x 70;
27 say "License notice for $package_name";
28 say "-" x 70;
29 say "";
30 print $license_text;
31}
32
33# These licenses are the originals for forked code; they must
34# be included along with license from the vendor directory
35sub forked_licenses {
36 return <<'HERE';
37---------------------------------------------------------------------
38License notice for gopkg.in/mgo.v2/bson
39---------------------------------------------------------------------
40
41BSON library for Go
42
43Copyright (c) 2010-2013 - Gustavo Niemeyer <gustavo@niemeyer.net>
44
45All rights reserved.
46
47Redistribution and use in source and binary forms, with or without
48modification, are permitted provided that the following conditions are met:
49
501. Redistributions of source code must retain the above copyright notice, this
51 list of conditions and the following disclaimer.
522. Redistributions in binary form must reproduce the above copyright notice,
53 this list of conditions and the following disclaimer in the documentation
54 and/or other materials provided with the distribution.
55
56THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
57ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
58WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
59DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
60ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
61(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
63ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
64(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
65SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66
67---------------------------------------------------------------------
68License notice for JSON and CSV code from github.com/golang/go
69---------------------------------------------------------------------
70
71Copyright (c) 2009 The Go Authors. All rights reserved.
72
73Redistribution and use in source and binary forms, with or without
74modification, are permitted provided that the following conditions are
75met:
76
77 * Redistributions of source code must retain the above copyright
78notice, this list of conditions and the following disclaimer.
79 * Redistributions in binary form must reproduce the above
80copyright notice, this list of conditions and the following disclaimer
81in the documentation and/or other materials provided with the
82distribution.
83 * Neither the name of Google Inc. nor the names of its
84contributors may be used to endorse or promote products derived from
85this software without specific prior written permission.
86
87THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
88"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
89LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
90A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
91OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
92SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
93LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
94DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
95THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
96(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
97OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
98HERE
99}