2006-04-25 02:21:12 +02:00
|
|
|
# $Id: cvs-package.mk,v 1.13 2006/04/25 00:21:12 rillig Exp $
|
2004-11-10 08:14:33 +01:00
|
|
|
|
2006-01-30 03:34:18 +01:00
|
|
|
# This file provides simple access to CVS repositories, so that packages
|
|
|
|
# can be created from CVS instead of from released tarballs.
|
2004-11-10 08:14:33 +01:00
|
|
|
#
|
|
|
|
# A package using this file shall define the following variables:
|
|
|
|
#
|
2006-03-12 16:37:29 +01:00
|
|
|
# CVS_REPOSITORIES
|
|
|
|
# A list of unique identifiers /id/ for which appropriate
|
|
|
|
# CVS_ROOT and CVS_MODULE must be defined.
|
2004-11-10 08:14:33 +01:00
|
|
|
#
|
2006-03-12 16:37:29 +01:00
|
|
|
# CVS_ROOT.${id}
|
|
|
|
# The CVSROOT for the CVS repository, including anoncvs
|
|
|
|
# password, if applicable.
|
|
|
|
#
|
|
|
|
# CVS_MODULE.${id}
|
|
|
|
# The CVS module to check out.
|
|
|
|
#
|
|
|
|
# It may define the following variables:
|
|
|
|
#
|
|
|
|
# CVS_TAG
|
|
|
|
# The CVS tag to check out (default: HEAD).
|
|
|
|
#
|
|
|
|
# CVS_TAG.${id}
|
|
|
|
# Overridable CVS tag for a repository.
|
|
|
|
#
|
|
|
|
# This file defines the following variables:
|
|
|
|
#
|
|
|
|
# CVS_ROOT_GNU
|
|
|
|
# CVS_ROOT_NONGNU
|
|
|
|
# CVS_ROOT_SOURCEFORGE
|
|
|
|
# Common CVS repository locations for use in the CVS_ROOT
|
|
|
|
# variables.
|
2004-11-10 08:14:33 +01:00
|
|
|
|
|
|
|
.if !defined(_PKG_MK_CVS_PACKAGE_MK)
|
|
|
|
_PKG_MK_CVS_PACKAGE_MK= # defined
|
|
|
|
|
2005-05-14 01:18:38 +02:00
|
|
|
#
|
|
|
|
# defaults for user-visible input variables
|
|
|
|
#
|
|
|
|
|
|
|
|
DISTFILES?= # empty
|
|
|
|
|
2006-04-25 02:21:12 +02:00
|
|
|
#
|
|
|
|
# definition of user-visible output variables
|
|
|
|
#
|
|
|
|
|
|
|
|
# commonly used repositories
|
|
|
|
CVS_ROOT_GNU= :pserver:anonymous@cvs.savannah.gnu.org:/sources
|
|
|
|
CVS_ROOT_NONGNU= ${CVS_ROOT_GNU}
|
|
|
|
CVS_ROOT_SOURCEFORGE= :pserver:anonymous:@cvs.sourceforge.net:/cvsroot
|
|
|
|
|
|
|
|
#
|
|
|
|
# End of the interface part. Start of the implementation part.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Input validation
|
|
|
|
#
|
|
|
|
|
2006-03-12 16:37:29 +01:00
|
|
|
.if !defined(CVS_REPOSITORIES)
|
|
|
|
PKG_FAIL_REASON+= "[cvs-package.mk] CVS_REPOSITORIES must be set."
|
|
|
|
CVS_REPOSITORIES?= # none
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.for _repo_ in ${CVS_REPOSITORIES}
|
|
|
|
. if !defined(CVS_ROOT.${_repo_})
|
|
|
|
PKG_FAIL_REASON+= "[cvs-package.mk] CVS_ROOT."${_repo_:Q}" must be set."
|
|
|
|
. endif
|
|
|
|
. if !defined(CVS_MODULE.${_repo_})
|
|
|
|
PKG_FAIL_REASON+= "[cvs-package.mk] CVS_MODULE."${_repo_:Q}" must be set."
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2005-05-14 01:18:38 +02:00
|
|
|
#
|
2006-01-30 03:34:18 +01:00
|
|
|
# Internal variables
|
2005-05-14 01:18:38 +02:00
|
|
|
#
|
|
|
|
|
2004-11-10 08:14:33 +01:00
|
|
|
_CVS_RSH= ssh
|
|
|
|
_CVS_CMD= cvs
|
2006-01-30 03:34:18 +01:00
|
|
|
_CVS_ENV= # empty
|
|
|
|
_CVS_ENV+= CVS_PASSFILE=${_CVS_PASSFILE:Q}
|
2005-05-14 01:18:38 +02:00
|
|
|
_CVS_ENV+= CVS_RSH=${_CVS_RSH:Q}
|
2004-11-10 08:14:33 +01:00
|
|
|
_CVS_FLAGS= -Q
|
2006-04-25 02:21:12 +02:00
|
|
|
_CVS_CHECKOUT_FLAGS= -P
|
2005-05-14 01:18:38 +02:00
|
|
|
_CVS_PASSFILE= ${WRKDIR}/.cvs_passwords
|
2006-04-25 02:21:12 +02:00
|
|
|
_CVS_TODAY_CMD= date -u +'%Y-%m-%d'
|
|
|
|
_CVS_TODAY= ${_CVS_TODAY_CMD:sh}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generation of repository-specific variables
|
|
|
|
#
|
|
|
|
|
|
|
|
.for _repo_ in ${CVS_REPOSITORIES}
|
|
|
|
. if defined(CVS_TAG.${_repo_})
|
|
|
|
_CVS_TAG_FLAG.${_repo_}= -r${CVS_TAG.${_repo_}}
|
|
|
|
_CVS_TAG.${_repo_}= ${CVS_TAG.${_repo_}}
|
|
|
|
. elif defined(CVS_TAG)
|
|
|
|
_CVS_TAG_FLAG.${_repo_}= -r${CVS_TAG}
|
|
|
|
_CVS_TAG.${_repo_}= ${CVS_TAG}
|
|
|
|
. else
|
|
|
|
_CVS_TAG_FLAG.${_repo_}= -D${_CVS_TODAY}T00:00+0
|
|
|
|
_CVS_TAG.${_repo_}= ${_CVS_TODAY:Q}
|
|
|
|
. endif
|
|
|
|
_CVS_DISTFILE.${_repo_}= ${PKGBASE}-cvs-${_CVS_TAG.${_repo_}}.tar.gz
|
|
|
|
.endfor
|
2006-01-30 02:18:15 +01:00
|
|
|
|
|
|
|
pre-extract: do-cvs-extract
|
|
|
|
|
|
|
|
.PHONY: do-cvs-extract
|
|
|
|
do-cvs-extract:
|
|
|
|
.for _repo_ in ${CVS_REPOSITORIES}
|
2005-12-19 08:56:14 +01:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}set -e; \
|
2004-11-10 08:14:33 +01:00
|
|
|
cd ${WRKDIR}; \
|
2006-04-25 02:21:12 +02:00
|
|
|
if ${TEST} -f ${DISTDIR}/${_CVS_DISTFILE.${_repo_}:Q}; then \
|
|
|
|
${STEP_MSG} "Extracting cached CVS archive "${_CVS_DISTFILE.${_repo_}:Q}".";\
|
|
|
|
else \
|
2006-01-30 02:18:15 +01:00
|
|
|
case ${CVS_ROOT.${_repo_}:Q} in \
|
2004-11-10 08:14:33 +01:00
|
|
|
:pserver:*) \
|
2006-01-30 03:34:18 +01:00
|
|
|
if ${TEST} ! -f ${_CVS_PASSFILE:Q}; then \
|
|
|
|
${TOUCH} ${_CVS_PASSFILE:Q}; \
|
2004-11-10 08:14:33 +01:00
|
|
|
fi; \
|
2006-04-25 02:21:12 +02:00
|
|
|
${STEP_MSG} "Logging in to "${CVS_ROOT.${_repo_}:Q}"."; \
|
2006-01-30 02:18:15 +01:00
|
|
|
${SETENV} ${_CVS_ENV} ${_CVS_CMD} ${_CVS_FLAGS} \
|
|
|
|
-d ${CVS_ROOT.${_repo_}:Q} login \
|
|
|
|
;; \
|
2004-11-10 08:14:33 +01:00
|
|
|
*) ;; \
|
|
|
|
esac; \
|
2006-04-25 02:21:12 +02:00
|
|
|
${STEP_MSG} "Downloading "${CVS_MODULE.${_repo_}:Q}" from "${CVS_ROOT.${_repo_}:Q}"."; \
|
2006-01-30 03:34:18 +01:00
|
|
|
${SETENV} ${_CVS_ENV} \
|
2006-04-25 02:21:12 +02:00
|
|
|
${_CVS_CMD} ${_CVS_FLAGS} -d ${CVS_ROOT.${_repo_}:Q} \
|
|
|
|
checkout ${_CVS_CHECKOUT_FLAGS} ${_CVS_TAG_FLAG.${_repo_}:Q} \
|
|
|
|
-d ${_repo_:Q} ${CVS_MODULE.${_repo_}:Q}; \
|
|
|
|
${STEP_MSG} "Creating cached CVS archive "${_CVS_DISTFILE.${_repo_}:Q}"."; \
|
|
|
|
${PAX} -w -z -f ${DISTDIR}/${_CVS_DISTFILE.${_repo_}:Q} ${_repo_:Q}; \
|
|
|
|
fi
|
2006-01-30 02:18:15 +01:00
|
|
|
.endfor
|
2004-11-10 08:14:33 +01:00
|
|
|
|
|
|
|
.endif
|