pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/mk
Module Name: pkgsrc
Committed By: wiz
Date: Mon Jan 2 21:17:53 UTC 2023
Modified Files:
pkgsrc/mk: bsd.pkg.mk
Added Files:
pkgsrc/mk/misc: cpe.mk
Log Message:
mk: add cpe.mk for defining CPE_URI values for packages by default
Mostly from tm@, thanks!
To generate a diff of this commit:
cvs rdiff -u -r1.2045 -r1.2046 pkgsrc/mk/bsd.pkg.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/mk/misc/cpe.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/mk/bsd.pkg.mk
diff -u pkgsrc/mk/bsd.pkg.mk:1.2045 pkgsrc/mk/bsd.pkg.mk:1.2046
--- pkgsrc/mk/bsd.pkg.mk:1.2045 Wed Nov 23 13:30:38 2022
+++ pkgsrc/mk/bsd.pkg.mk Mon Jan 2 21:17:52 2023
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.2045 2022/11/23 13:30:38 jperkin Exp $
+# $NetBSD: bsd.pkg.mk,v 1.2046 2023/01/02 21:17:52 wiz Exp $
#
# This file is in the public domain.
#
@@ -843,3 +843,4 @@ ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR}
.endif
.include "misc/warnings.mk"
.include "misc/can-be-built-here.mk"
+.include "misc/cpe.mk"
Added files:
Index: pkgsrc/mk/misc/cpe.mk
diff -u /dev/null pkgsrc/mk/misc/cpe.mk:1.1
--- /dev/null Mon Jan 2 21:17:53 2023
+++ pkgsrc/mk/misc/cpe.mk Mon Jan 2 21:17:53 2023
@@ -0,0 +1,100 @@
+# $NetBSD: cpe.mk,v 1.1 2023/01/02 21:17:53 wiz Exp $
+# Derived from: FreeBSD MK/Uses/cpe.mk (3e1b730be0f27, 2014-07-26)
+#
+# This Makefile fragment includes CPE information into packages based on the
+# CPE 2.3 formatting string. Additional information could be found on the
+# official NIST documentation:
+#
+# https://csrc.nist.gov/projects/security-content-automation-protocol/specifications/cpe
+#
+# User-settable variables:
+#
+# (none)
+#
+# Package-settable variables:
+#
+# CPE_PART
+# This is sometimes referred as "type" of CPE. Character describing the
+# type. Could be "a" for application, "h" for hardware and "o" for
+# operating system.
+# Default: "a"
+#
+# CPE_VENDOR
+# Should describe or identify the organisation that created the product.
+# Default: ${CPE_PRODUCT} (below)
+#
+# CPE_PRODUCT
+# Name of the system/package or component. Should not contains any
+# special characters. On applications CPE_VENDOR and CPE_PRODUCT may be
+# identical.
+# Default: ${PKGBASE}
+#
+# CPE_VERSION
+# The version of the system/package or component.
+# Default: ${PKGVERSION_NOREV}
+#
+# CPE_UPDATE
+# Used for updates, service pack information or sometimes minor versions.
+# Most often left blank.
+# Default: empty
+#
+# CPE_EDITION
+# Further granularity describing the build of the system/package or
+# component, beyond version.
+# Default: empty
+#
+# CPE_LANG
+# A valid language tag as defined by IETF RFC 4646. Not relevant for
+# pkgsrc at the moment.
+# Default: empty
+#
+# CPE_SW_EDITION
+# Characterise how the product is tailored to a particular market or
+# class of end users.
+# Default: empty
+#
+# CPE_TARGET_SW
+# Describe the software computing environment within which the product
+# operates.
+# Default: operating system (${OPSYS}) and version (${OS_VERSION})
+#
+# CPE_TARGET_HW
+# Instruction set architecture (e.g. x86) on which the product being
+# described or identified by the WFN operates.
+# Default: x86 for i386, x64 for amd64, otherwise ${MACHINE_ARCH}
+#
+# CPE_OTHER
+# Any other general descriptive or identifying information. Used for
+# PKGREVISION in pkgsrc.
+# Default: ${PKGREVISION} if exists
+#
+#
+# Variables defined by this file:
+#
+# CPE_URI
+# The CPE URI uniquely identifies a device or program by its vendor,
+# product name, version, revision. Based on the above variables.
+#
+# Keywords: cpe
+
+.if !defined(CPE_MK)
+CPE_MK= # defined
+
+CPE_PART?= a
+CPE_PRODUCT?= ${PKGBASE:Q}
+CPE_VENDOR?= ${CPE_PRODUCT}
+CPE_VERSION?= ${PKGVERSION_NOREV}
+CPE_UPDATE?=
+CPE_EDITION?=
+CPE_LANG?=
+CPE_SW_EDITION?=
+CPE_TARGET_SW?= ${OPSYS:tl}${OS_VERSION:C/\..*//}
+CPE_TARGET_HW?= ${MACHINE_ARCH:S/i386/x86/:S/amd64/x64/}
+CPE_OTHER?= ${PKGREVISION}
+
+_CPE_STR= cpe:2.3:${CPE_PART}:${CPE_VENDOR}:${CPE_PRODUCT}:${CPE_VERSION}:${CPE_UPDATE}:${CPE_EDITION}:${CPE_LANG}:${CPE_SW_EDITION}:${CPE_TARGET_SW}:${CPE_TARGET_HW}:${CPE_OTHER}
+
+CPE_URI?= ${_CPE_STR:C/:+$//}
+
+BUILD_DEFS+= CPE_URI
+.endif
Home |
Main Index |
Thread Index |
Old Index