ports/67171: [PATCH] bsd.port.mk: new variable DISTVERSION
Oliver Eikemeier
eikemeier at fillmore-labs.com
Tue May 25 11:20:53 UTC 2004
>Number: 67171
>Category: ports
>Synopsis: [PATCH] bsd.port.mk: new variable DISTVERSION
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue May 25 04:20:26 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator: Oliver Eikemeier
>Release: FreeBSD 4.10-STABLE i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 4.10-STABLE
>Description:
It seems to be a FAQ how to make a vendor version number conforming
to the FreeBSD version numbering system. This patch introduces a new
variable DISTVERSION, that can be set instead of PORTVERSION and is
automagically converted in a conforming PORTVERSION. A colon quotes
the following character, which is useful to avoid automatically
inserted dots, e.g. 10beta3 would be interpreted as 10.b3, whereas
10:brelease3 is 10b3.
>How-To-Repeat:
DISTVERSION => PORTVERSION
10Alpha3 -> 10.a3
3Beta7-pre2 -> 3.b7.p2
8:f_17 -> 8f.17
>Fix:
Since no current port sets DISTVERSION without setting DISTNAME, this
change should be unobtrusive.
Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.488
diff -u -r1.488 bsd.port.mk
--- bsd.port.mk 19 Apr 2004 23:39:52 -0000 1.488
+++ bsd.port.mk 25 May 2004 10:47:01 -0000
@@ -53,7 +53,7 @@
# These variables are used to identify your port.
#
# PORTNAME - Name of software. Mandatory.
-# PORTVERSION - Version of software. Mandatory.
+# PORTVERSION - Version of software. Mandatory when no DISTVERSION is given.
# PORTREVISION - Version of port. Optional. Commonly used to indicate
# that an update has happened that affects the port
# framework itself, but not the distributed software
@@ -72,9 +72,10 @@
# UNIQUENAME - A name for your port that is globally unique. By default,
# this is set to ${LATEST_LINK} when LATEST_LINK is set,
# and to ${PKGNAMEPREFIX}${PORTNAME} otherwise.
+# DISTVERSION - Vendor version of the distribution (default: ${PORTVERSION})
# DISTNAME - Name of port or distribution used in generating
# WRKSRC and DISTFILES below (default:
-# ${PORTNAME}-${PORTVERSION}).
+# ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX})
# CATEGORIES - A list of descriptive categories into which this port falls.
# Mandatory.
#
@@ -958,7 +959,7 @@
.endif
# check for old, crufty, makefile types, part 1:
-.if !defined(PORTNAME) || !defined(PORTVERSION) || defined(PKGNAME)
+.if !defined(PORTNAME) || !( defined(PORTVERSION) || defined (DISTVERSION) ) || defined(PKGNAME)
check-makefile::
@${ECHO_CMD} "Makefile error: you need to define PORTNAME and PORTVERSION instead of PKGNAME."
@${ECHO_CMD} "(This port is too old for your bsd.port.mk, please update it to match"
@@ -970,6 +971,9 @@
.if ${PORTVERSION:M*[-_,]*}x != x
BROKEN= "PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','"
.endif
+DISTVERSION?= ${PORTVERSION:S/:/::/g}
+.elif defined(DISTVERSION)
+PORTVERSION= ${DISTVERSION:L:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
.endif
PORTREVISION?= 0
@@ -987,7 +991,7 @@
.if !defined(PKGNAME)
PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
.endif
-DISTNAME?= ${PORTNAME}-${PORTVERSION}
+DISTNAME?= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
# These need to be absolute since we don't know how deep in the ports
# tree we are and thus can't go relative. They can, of course, be overridden
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list