From 67506288cbf05d199fa81ce669dc354b06ae07dc Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Thu, 6 Oct 2022 19:50:22 +0200
Subject: [PATCH] chore add licenses

---
 Makefile       | 15 +++++++++++++++
 api.go         |  3 +++
 api_test.go    |  3 +++
 header.go      |  3 +++
 parser.go      |  3 +++
 parser_test.go |  3 +++
 spec.go        |  3 +++
 spec_test.go   |  3 +++
 8 files changed, 36 insertions(+)

diff --git a/Makefile b/Makefile
index e4f9d61..61f670d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,7 @@
+## Copyright 2022 schukai GmbH. All rights reserved.
+## Use of this source code is governed by a AGPL-3.0
+## license that can be found in the LICENSE file.
+
 PROJECT_ROOT:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
 THIS_MAKEFILE:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
 THIS_MAKEFILE_PATH:=$(PROJECT_ROOT)$(THIS_MAKEFILE) 
@@ -137,5 +141,16 @@ endif
 fetch-licenses:
 	go-licenses save $(GO_CURRENT_MODULE) --ignore gitlab.schukai.com --force --save_path $(PROJECT_ROOT)licenses/ ; cd -
 
+# https://spdx.github.io/spdx-spec/v2.3/SPDX-license-list/
+ADDLICENSE_BIN ?= addlicense
+ifeq ($(shell command -v $(ADDLICENSE_BIN) 2> /dev/null),)
+	$(shell go install github.com/google/addlicense@latest)
+	EXECUTABLES = $(EXECUTABLES:-) $(ADDLICENSE_BIN);
+endif
+
+.PHONY: add-licenses
+## Add license headers to all go files
+add-licenses:
+	addlicense -c "schukai GmbH" -s -l "AGPL-3.0-or-later" ./*.go
 
 
diff --git a/api.go b/api.go
index fa394b2..75c82eb 100644
--- a/api.go
+++ b/api.go
@@ -1,3 +1,6 @@
+// Copyright 2022 schukai GmbH
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
 package negotiation
 
 import (
diff --git a/api_test.go b/api_test.go
index c59933e..107d563 100644
--- a/api_test.go
+++ b/api_test.go
@@ -1,3 +1,6 @@
+// Copyright 2022 schukai GmbH
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
 package negotiation
 
 import (
diff --git a/header.go b/header.go
index 69bb5b0..bd624d3 100644
--- a/header.go
+++ b/header.go
@@ -1,3 +1,6 @@
+// Copyright 2022 schukai GmbH
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
 package negotiation
 
 const (
diff --git a/parser.go b/parser.go
index 9c52871..752004d 100644
--- a/parser.go
+++ b/parser.go
@@ -1,3 +1,6 @@
+// Copyright 2022 schukai GmbH
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
 package negotiation
 
 import (
diff --git a/parser_test.go b/parser_test.go
index 5725b37..82a2743 100644
--- a/parser_test.go
+++ b/parser_test.go
@@ -1,3 +1,6 @@
+// Copyright 2022 schukai GmbH
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
 package negotiation
 
 import (
diff --git a/spec.go b/spec.go
index c4633ec..7d554d2 100644
--- a/spec.go
+++ b/spec.go
@@ -1,3 +1,6 @@
+// Copyright 2022 schukai GmbH
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
 package negotiation
 
 import "strings"
diff --git a/spec_test.go b/spec_test.go
index d66e628..93d412a 100644
--- a/spec_test.go
+++ b/spec_test.go
@@ -1,3 +1,6 @@
+// Copyright 2022 schukai GmbH
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
 package negotiation
 
 import (
-- 
GitLab