Add spdx short identifiers, use it as asdf :license.
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
This directory contains license templates.
|
||||||
|
|
||||||
|
Template arguments are designated with an identifier inside
|
||||||
|
~{{}}~. Possible identifiers are:
|
||||||
|
- ~current-year~
|
||||||
|
- ~project-author~
|
||||||
|
- ~project-name~
|
||||||
|
|
||||||
|
* license sources
|
||||||
|
|
||||||
|
- [[https://choosealicense.com/licenses/]]
|
||||||
|
|
||||||
|
** [[https://spdx.org/licenses/][spdx]]
|
||||||
|
|
||||||
|
- [[https://spdx.org/licenses/Apache-2.0.html][Apache-2.0]]
|
||||||
|
- [[https://spdx.org/licenses/BSD-2-Clause.html][BSD-2-Clause]]
|
||||||
|
- [[https://spdx.org/licenses/BSD-3-Clause.html][BSD-3-Clause]]
|
||||||
|
- [[https://spdx.org/licenses/GPL-3.0-or-later.html][GPL-3.0-or-later]]
|
||||||
|
- [[https://spdx.org/licenses/MIT.html][MIT]]
|
||||||
|
- [[https://spdx.org/licenses/Unlicense.html][Unlicense]]
|
||||||
+20
-8
@@ -11,7 +11,12 @@
|
|||||||
:accessor license-file-name
|
:accessor license-file-name
|
||||||
:initform *license-default-filename*)
|
:initform *license-default-filename*)
|
||||||
(writer :initform nil
|
(writer :initform nil
|
||||||
:accessor license-writer)))
|
:accessor license-writer)
|
||||||
|
(spdx-short :initarg :license-spdx-short
|
||||||
|
:initform nil
|
||||||
|
:accessor license-spdx-short
|
||||||
|
:type (or string null)
|
||||||
|
:documentation "SPDX short identifier for the license. See at https://spdx.org/licenses/")))
|
||||||
|
|
||||||
(defun get-license (key)
|
(defun get-license (key)
|
||||||
(gethash key *licenses*))
|
(gethash key *licenses*))
|
||||||
@@ -28,10 +33,11 @@
|
|||||||
(setf (gethash key *notices*) value)))
|
(setf (gethash key *notices*) value)))
|
||||||
|
|
||||||
(eval-always
|
(eval-always
|
||||||
(defmacro deflicense (keys template-name &key file-name notice-name)
|
(defmacro deflicense (keys template-name &key file-name notice-name spdx)
|
||||||
(let ((sym (gensym "LICENSE")))
|
(let ((sym (gensym "LICENSE")))
|
||||||
`(progn (let ((,sym (make-instance '<license>
|
`(progn (let ((,sym (make-instance '<license>
|
||||||
:license-template-name ,template-name
|
:license-template-name ,template-name
|
||||||
|
:license-spdx-short ,spdx
|
||||||
,@(unless (null file-name)
|
,@(unless (null file-name)
|
||||||
`(:license-file-name ,file-name)))))
|
`(:license-file-name ,file-name)))))
|
||||||
,@(loop for key in (uiop:ensure-list keys)
|
,@(loop for key in (uiop:ensure-list keys)
|
||||||
@@ -43,21 +49,27 @@
|
|||||||
,@(loop for key in (uiop:ensure-list keys)
|
,@(loop for key in (uiop:ensure-list keys)
|
||||||
collect `(set-notice ,key ,sym)))))))))
|
collect `(set-notice ,key ,sym)))))))))
|
||||||
|
|
||||||
(deflicense :mit "mit.txt")
|
(deflicense :mit "mit.txt"
|
||||||
|
:spdx "MIT")
|
||||||
|
|
||||||
(deflicense :gpl3+ "gpl-3.0-or-later.txt"
|
(deflicense :gpl3+ "gpl-3.0-or-later.txt"
|
||||||
:file-name "COPYING"
|
:file-name "COPYING"
|
||||||
:notice-name "gpl-3.0-or-later-notice.txt")
|
:notice-name "gpl-3.0-or-later-notice.txt"
|
||||||
|
:spdx "GPL-3.0-or-later")
|
||||||
|
|
||||||
(deflicense :apache2 "apache-2.0.txt"
|
(deflicense :apache2 "apache-2.0.txt"
|
||||||
:notice-name "apache-2.0-notice.txt")
|
:notice-name "apache-2.0-notice.txt"
|
||||||
|
:spdx "Apache-2.0")
|
||||||
|
|
||||||
(deflicense :unlicense "unlicense.txt"
|
(deflicense :unlicense "unlicense.txt"
|
||||||
:file-name "UNLICENSE")
|
:file-name "UNLICENSE"
|
||||||
|
:spdx "Unlicense")
|
||||||
|
|
||||||
(deflicense :bsd2 "bsd-2-clause.txt")
|
(deflicense :bsd2 "bsd-2-clause.txt"
|
||||||
|
:spdx "BSD-2-Clause")
|
||||||
|
|
||||||
(deflicense :bsd3 "bsd-3-clause.txt")
|
(deflicense :bsd3 "bsd-3-clause.txt"
|
||||||
|
:spdx "BSD-3-Clause")
|
||||||
|
|
||||||
(defmethod license-find-template ((license <license>))
|
(defmethod license-find-template ((license <license>))
|
||||||
(with-slots (template-name) license
|
(with-slots (template-name) license
|
||||||
|
|||||||
+2
-1
@@ -42,7 +42,8 @@
|
|||||||
(format stream "defsystem ~S" name)
|
(format stream "defsystem ~S" name)
|
||||||
(format stream "~& :author ~S" author)
|
(format stream "~& :author ~S" author)
|
||||||
(format stream "~& :description ~S" description)
|
(format stream "~& :description ~S" description)
|
||||||
(format stream "~& :license ~S" license)
|
(let ((l (get-license license)))
|
||||||
|
(format stream "~& :license ~S" (license-spdx-short l)))
|
||||||
(format stream "~& :version ~S" version)
|
(format stream "~& :version ~S" version)
|
||||||
(unless (null pathname)
|
(unless (null pathname)
|
||||||
(format stream "~& :pathname ~S" pathname))
|
(format stream "~& :pathname ~S" pathname))
|
||||||
|
|||||||
Reference in New Issue
Block a user