Date: Thu, 14 Nov 2013 23:31:10 +0000 (UTC) From: Adam Weinberger <adamw@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r333807 - head/textproc/multimarkdown Message-ID: <201311142331.rAENVAQK039370@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <adamw@FreeBSD.org> +# $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}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311142331.rAENVAQK039370>