From owner-svn-ports-all@FreeBSD.ORG Thu Nov 14 23:31:10 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E422958; Thu, 14 Nov 2013 23:31:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6DA5F2756; Thu, 14 Nov 2013 23:31:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAENVAu0039371; Thu, 14 Nov 2013 23:31:10 GMT (envelope-from adamw@svn.freebsd.org) Received: (from adamw@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAENVAQK039370; Thu, 14 Nov 2013 23:31:10 GMT (envelope-from adamw@svn.freebsd.org) Message-Id: <201311142331.rAENVAQK039370@svn.freebsd.org> From: Adam Weinberger Date: Thu, 14 Nov 2013 23:31:10 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r333807 - head/textproc/multimarkdown X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2013 23:31:10 -0000 Author: adamw Date: Thu Nov 14 23:31:09 2013 New Revision: 333807 URL: http://svnweb.freebsd.org/changeset/ports/333807 Log: Add an include-able file to facilitate checking out sources from git. Useful especially for projects that don't have distfiles, or that use submodules that don't have distfiles. Added: head/textproc/multimarkdown/bsd.git-clone.mk (contents, props changed) Added: head/textproc/multimarkdown/bsd.git-clone.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/multimarkdown/bsd.git-clone.mk Thu Nov 14 23:31:09 2013 (r333807) @@ -0,0 +1,49 @@ +# Created by: Adam Weinberger +# $FreeBSD$ + +# if a github project, use: +# +#GITHUB_CREATOR= someuser + +# otherwise, use: +# +#GIT_URL= https://example.com/path/to/${GIT_PROJECT_NAME}.git + +#GIT_PROJECT_NAME defaults to ${PORTNAME} + +# if there are submodules to checkout, define: +#GIT_SUBMODULES= yes + + +GIT_PROJECT_NAME?= ${PORTNAME} +GIT_VERSION?= ${PORTVERSION} +WRKSRC?= ${WRKDIR}/${GIT_PROJECT_NAME} + +.if defined(GITHUB_CREATOR) +GIT_URL= https://github.com/${GITHUB_CREATOR}/${GIT_PROJECT_NAME}.git +.endif + +.if !defined(GITHUB_CREATOR) && !defined(GIT_URL) +.error You must define GITHUB_CREATOR or GIT_URL to use bsd.git-clone.mk +.endif + +FETCH_DEPENDS+= git:${PORTSDIR}/devel/git + +# will not clobber do-{fetch,extract} +do-fetch: git-fetch +do-extract: git-extract + +git-fetch: + @if [ ! -e ${WRKSRC}/.git/index ]; then \ + ${MKDIR} ${WRKDIR}; \ + cd ${WRKDIR} && git clone ${GIT_URL}; \ + cd ${WRKSRC} && git checkout ${GIT_VERSION}; \ + if [ -n "${GIT_SUBMODULES}" ]; then \ + cd ${WRKSRC} && git submodule init; \ + cd ${WRKSRC} && git submodule update; \ + fi \ + fi + +git-extract: +#normally do-extract starts with an rm -rf ${WRKSRC} + @${DO_NADA}