svn commit: r333807 - head/textproc/multimarkdown

Adam Weinberger adamw at FreeBSD.org
Thu Nov 14 23:31:10 UTC 2013


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 at 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}


More information about the svn-ports-head mailing list