pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mk/cvs-package: make case of using a single repository simpler



Module Name:	pkgsrc-wip
Committed By:	Roland Illig <rillig%NetBSD.org@localhost>
Pushed By:	rillig
Date:		Mon Feb 26 23:24:29 2018 +0000
Changeset:	b2b6945b04511395965272cc6e7c30dd5764baf2

Modified Files:
	mk/cvs-package.mk
	opentracker-cvs/Makefile

Log Message:
mk/cvs-package: make case of using a single repository simpler

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b2b6945b04511395965272cc6e7c30dd5764baf2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 mk/cvs-package.mk        | 26 ++++++++++++++++++++------
 opentracker-cvs/Makefile |  8 ++------
 2 files changed, 22 insertions(+), 12 deletions(-)

diffs:
diff --git a/mk/cvs-package.mk b/mk/cvs-package.mk
index 8f745bab03..cd9edad3f1 100644
--- a/mk/cvs-package.mk
+++ b/mk/cvs-package.mk
@@ -19,7 +19,7 @@
 #	The CVS module to check out. This typically corresponds to one
 #	of the directories below CVS_ROOT.
 #
-#	Default: ${PKGBASE}
+#	Default: ${DISTNAME} without the version number
 #
 # CVS_TAG (optional)
 #	The CVS tag that is checked out. If no tag is specified, the
@@ -31,6 +31,12 @@
 # CHECKOUT_DATE (optional)
 #	Date to check out in ISO format (YYYY-MM-DD).
 #
+# CVS_EXTRACTDIR (optional)
+#	The directory relative to WRKDIR where the files from the CVS
+#	repository are extracted.
+#
+#	Default: ${CVS_MODULE}
+#
 # If a package needs to checkout from more than one CVS repository, the
 # setup is a little more complicated, using parameterized variables as
 # variants of the above variables.
@@ -58,6 +64,12 @@
 #
 #	Default: ${CVS_TAG} (today at midnight)
 #
+# CVS_EXTRACTDIR.${id} (optional)
+#	The directory relative to WRKDIR where the files from the CVS
+#	repository are extracted.
+#
+#	Default: ${id}
+#
 # CVS_PROJECT
 #	The project name to be used in CVS_ROOT_SOURCEFORGE.
 #
@@ -132,8 +144,9 @@ CVS_PROJECT?=		${PKGBASE}
 
 # The common case of a single CVS repository.
 .if defined(CVS_ROOT)
+CVS_MODULE?=		${PKGBASE:S,-cvs$,,}
 CVS_REPOSITORIES+=	_default
-.  for varbase in CVS_ROOT CVS_MODULE CVS_TAG
+.  for varbase in CVS_ROOT CVS_MODULE CVS_TAG CVS_EXTRACTDIR
 .    if defined(${varbase})
 ${varbase}._default=	${${varbase}}
 .    endif
@@ -177,7 +190,8 @@ _CVS_DISTDIR=		${DISTDIR}/cvs-packages
 #
 
 .for repo in ${CVS_REPOSITORIES}
-CVS_MODULE.${repo}?=	${repo}
+CVS_MODULE.${repo}?=		${repo}
+CVS_EXTRACTDIR.${repo}?=	${CVS_MODULE.${repo}}
 
 # determine appropriate checkout date or tag
 .  if defined(CVS_TAG.${repo})
@@ -238,18 +252,18 @@ do-cvs-extract: .PHONY
 	${SETENV} ${_CVS_ENV}						\
 	  ${_CVS_CMD} ${_CVS_FLAGS} -d ${CVS_ROOT.${repo}:Q}		\
 	    checkout ${_CVS_CHECKOUT_FLAGS} ${_CVS_TAG_FLAG.${repo}}	\
-	      -d ${repo} ${CVS_MODULE.${repo}:Q};			\
+	      -d ${CVS_EXTRACTDIR.${repo}:Q} ${CVS_MODULE.${repo}:Q};	\
 	${_CVS_CREATE_CACHE.${repo}}
 .endfor
 
 # Debug info for show-all and show-all-cvs
 _VARGROUPS+=		cvs
-_PKG_VARS.cvs+=		CVS_ROOT CVS_MODULE CVS_TAG CHECKOUT_DATE CVS_REPOSITORIES
+_PKG_VARS.cvs+=		CVS_ROOT CVS_MODULE CVS_TAG CHECKOUT_DATE CVS_EXTRACTDIR CVS_REPOSITORIES
 _SYS_VARS.cvs+=		DISTFILES PKGNAME PKGREVISION
 _SYS_VARS.cvs+=		CVS_ROOT_GNU CVS_ROOT_NONGNU CVS_ROOT_SOURCEFORGE CVS_PROJECT
 _SYS_VARS.cvs+=		_CVS_DISTDIR _CVS_PKGVERSION
 .for repo in ${CVS_REPOSITORIES}
-.  for pkgvar in CVS_ROOT CVS_MODULE CVS_TAG
+.  for pkgvar in CVS_ROOT CVS_MODULE CVS_TAG CVS_EXTRACTDIR
 _PKG_VARS.cvs+=		${pkgvar}.${repo}
 .  endfor
 .  for sysvar in _CVS_DISTFILE
diff --git a/opentracker-cvs/Makefile b/opentracker-cvs/Makefile
index af6297f49d..a5c08fc905 100644
--- a/opentracker-cvs/Makefile
+++ b/opentracker-cvs/Makefile
@@ -1,7 +1,8 @@
 # $NetBSD: Makefile,v 1.4 2012/10/03 21:06:07 asau Exp $
 
-DISTNAME=		opentracker-0.0.${OPENTRACKER_PKG_VERSION}
+DISTNAME=		opentracker-0.0
 CATEGORIES=		net
+CVS_ROOT=		:pserver:anoncvs:@cvs.erdgeist.org:/home/cvsroot
 
 MAINTAINER=		pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=		http://erdgeist.org/arts/software/opentracker/
@@ -11,9 +12,6 @@ WRKSRC=			${WRKDIR}/opentracker
 
 CFLAGS+=		-I${BUILDLINK_PREFIX.libowfat}/include/libowfat
 
-CVS_REPOSITORIES=	opentracker
-CVS_ROOT.opentracker=	:pserver:anoncvs:@cvs.erdgeist.org:/home/cvsroot
-CVS_MODULE.opentracker=	opentracker
 
 INSTALLATION_DIRS=	bin share/doc/opentracker
 
@@ -23,8 +21,6 @@ do-install:
 
 .include "../../mk/bsd.prefs.mk"
 
-OPENTRACKER_PKG_VERSION!=	${DATE} +%Y%m%d
-
 .include "../../devel/libowfat/buildlink3.mk"
 .include "../../wip/mk/cvs-package.mk"
 .include "../../mk/bsd.pkg.mk"


Home | Main Index | Thread Index | Old Index