svn commit: r354350 - head/Mk/Uses
Dag-Erling Smørgrav
des at FreeBSD.org
Sat May 17 18:09:15 UTC 2014
Author: des
Date: Sat May 17 18:09:14 2014
New Revision: 354350
URL: http://svnweb.freebsd.org/changeset/ports/354350
QAT: https://qat.redports.org/buildarchive/r354350/
Log:
Add support for inserting CPE URIs as package annotations.
To enable this for a particular port, add "cpe" to the USES list and
optionally define CPE_VENDOR, CPE_PRODUCT etc. if the defaults are not
correct (they should be in most cases).
Approved by: portmgr (bdrewery)
Added:
head/Mk/Uses/cpe.mk (contents, props changed)
Added: head/Mk/Uses/cpe.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/Mk/Uses/cpe.mk Sat May 17 18:09:14 2014 (r354350)
@@ -0,0 +1,55 @@
+# $FreeBSD$
+#
+# Include CPE URI in package manifest.
+#
+# http://scap.nist.gov/specifications/cpe/
+#
+# The URI is constructed as follows:
+#
+# cpe:/part:vendor:product:version:update:edition:lang
+#
+# Trailing colons are ommitted.
+#
+# CPE_PART Defaults to (and should always be) "a" for "application"
+# CPE_VENDOR Defaults to same as ${CPE_PRODUCT} (below)
+# CPE_PRODUCT Defaults to ${PORTNAME}
+# CPE_VERSION Defaults to ${PORTVERSION}
+# CPE_UPDATE Defaults to empty
+# CPE_EDITION Defaults to ~~~freebsd~~, see below
+# CPE_LANG Defaults to empty
+#
+# Originally, EDITION was an arbitrary string. In later revisions of
+# the CPE specification, it is composed of five tilde-separated fields
+# with a leading tilde to distinguish the new syntax from the old.
+# The five fields are:
+#
+# CPE_LEGACY_EDITION Defaults to empty
+# CPE_SW_EDITION Defaults to empty
+# CPE_TARGET_SW Defaults to "freebsd"
+# CPE_TARGET_HW Defaults to empty (subject to future change)
+# CPE_OTHER Defaults to empty
+#
+# MAINTAINER: ports-secteam at freebsd.org
+
+.if !defined(_INCLUDE_USES_CPE_MK)
+_INCLUDE_USES_CPE_MK= yes
+
+CPE_PART ?= a
+CPE_PRODUCT ?= ${PORTNAME}
+CPE_VENDOR ?= ${CPE_PRODUCT}
+CPE_VERSION ?= ${PORTVERSION}
+CPE_UPDATE ?=
+CPE_LEGACY_EDITION ?=
+CPE_SW_EDITION ?=
+CPE_TARGET_SW ?= freebsd
+CPE_TARGET_HW ?=
+CPE_OTHER ?=
+CPE_EDITION ?= ~${CPE_LEGACY_EDITION}~${CPE_SW_EDITION}~${CPE_TARGET_SW}~${CPE_TARGET_HW}~${CPE_OTHER}
+CPE_LANG ?=
+_CPE_URI = cpe:/${CPE_PART}:${CPE_VENDOR}:${CPE_PRODUCT}:${CPE_VERSION}:${CPE_UPDATE}:${CPE_EDITION}:${CPE_LANG}
+CPE_URI ?= ${_CPE_URI:C/:+$//}
+
+PKG_NOTES += cpe
+PKG_NOTE_cpe = ${CPE_URI}
+
+.endif
More information about the svn-ports-head
mailing list