From 6d6ff3cfc10de1fc6e64cd5087c5e3386f236736 Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Mon, 31 Dec 2018 16:17:38 -0800 Subject: [PATCH] legal: include LICENSEs for data files We depend upon data files from golang arch sub-repo and the Opcodes XML database (behind PeachPy). This change includes their LICENSE files. Updates #22 --- internal/data/LICENSE | 52 +++++++++++++++++++++++++++++ internal/data/README.md | 61 ++++++++++++++++++++++++++++++++++ internal/data/dl.sh | 72 +++++++++++++++++++++++++++++++++++++++++ script/data | 14 -------- 4 files changed, 185 insertions(+), 14 deletions(-) create mode 100644 internal/data/LICENSE create mode 100644 internal/data/README.md create mode 100755 internal/data/dl.sh delete mode 100755 script/data diff --git a/internal/data/LICENSE b/internal/data/LICENSE new file mode 100644 index 0000000..baf24bb --- /dev/null +++ b/internal/data/LICENSE @@ -0,0 +1,52 @@ +----------------------------------------------------------------------------- +golang/arch license +----------------------------------------------------------------------------- + +Copyright (c) 2015 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +----------------------------------------------------------------------------- +Maratyszcza/Opcodes license +----------------------------------------------------------------------------- + +======================================= +Opcodes Database license (2-clause BSD) +======================================= + +Copyright (c) 2017 Facebook Inc. +Copyright (c) 2014-2017, Georgia Institute of Technology +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/internal/data/README.md b/internal/data/README.md new file mode 100644 index 0000000..340483b --- /dev/null +++ b/internal/data/README.md @@ -0,0 +1,61 @@ +# data +Underlying data files for instruction database. + +## golang/arch +Files downloaded: + +* https://raw.githubusercontent.com/golang/arch/5a4828bb704534b8a2fa09c791c67d0fb372f472/x86/x86.v0.2.csv +* https://raw.githubusercontent.com/golang/arch/5a4828bb704534b8a2fa09c791c67d0fb372f472/LICENSE +### License +``` +Copyright (c) 2015 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` +## Maratyszcza/Opcodes +Files downloaded: + +* https://raw.githubusercontent.com/Maratyszcza/Opcodes/6e2b0cd9f1403ecaf164dea7019dd54db5aea252/opcodes/x86_64.xml +* https://raw.githubusercontent.com/Maratyszcza/Opcodes/6e2b0cd9f1403ecaf164dea7019dd54db5aea252/license.rst +### License +``` +======================================= +Opcodes Database license (2-clause BSD) +======================================= + +Copyright (c) 2017 Facebook Inc. +Copyright (c) 2014-2017, Georgia Institute of Technology +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` diff --git a/internal/data/dl.sh b/internal/data/dl.sh new file mode 100755 index 0000000..6ae6c44 --- /dev/null +++ b/internal/data/dl.sh @@ -0,0 +1,72 @@ +#!/bin/bash -ex + +datadir=$(dirname "${BASH_SOURCE[0]}") + +dl() { + url=$1 + name=$(basename ${url}) + + mkdir -p ${datadir} + curl --output ${datadir}/${name} ${url} + + echo "* ${url}" +} + +hdr() { + echo "-----------------------------------------------------------------------------" + echo $1 + echo "-----------------------------------------------------------------------------" +} + +addlicense() { + repo=$1 + file=$2 + + tmp=$(mktemp) + mv ${file} ${tmp} + + # append to LICENSE file + { + hdr "${repo} license" + echo + cat ${tmp} + echo + } >> ${datadir}/LICENSE + + # include in readme + echo "### License" + echo '```' + cat ${tmp} + echo '```' + + rm ${tmp} +} + +{ + echo '# data' + echo 'Underlying data files for instruction database.' + echo + + # golang/arch x86 csv + repo='golang/arch' + sha='5a4828bb704534b8a2fa09c791c67d0fb372f472' + + echo "## ${repo}" + echo 'Files downloaded:' + echo + dl https://raw.githubusercontent.com/${repo}/${sha}/x86/x86.v0.2.csv + dl https://raw.githubusercontent.com/${repo}/${sha}/LICENSE + addlicense ${repo} ${datadir}/LICENSE + + # opcodes + repo='Maratyszcza/Opcodes' + sha='6e2b0cd9f1403ecaf164dea7019dd54db5aea252' + + echo "## ${repo}" + echo 'Files downloaded:' + echo + dl https://raw.githubusercontent.com/${repo}/${sha}/opcodes/x86_64.xml + dl https://raw.githubusercontent.com/${repo}/${sha}/license.rst + addlicense ${repo} ${datadir}/license.rst + +} > ${datadir}/README.md \ No newline at end of file diff --git a/script/data b/script/data deleted file mode 100755 index efe1b0b..0000000 --- a/script/data +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -ex - -datadir="internal/data" - -dl() { - url=$1 - name=$(basename ${url}) - - mkdir -p ${datadir} - curl --output ${datadir}/${name} ${url} -} - -dl https://raw.githubusercontent.com/golang/arch/master/x86/x86.v0.2.csv -dl https://raw.githubusercontent.com/Maratyszcza/Opcodes/master/opcodes/x86_64.xml