Allow mirror override, restructure git commands to allow other branches.
[dragonfly.git] / etc / Makefile.usr
CommitLineData
809ae383
MD
1# Makefile.pkgsrc - installed as /usr/pkgsrc/Makefile
2#
3# Provides simple targets to download and maintain /usr/pkgsrc.
4#
919067aa 5# $DragonFly: src/etc/Makefile.usr,v 1.8 2008/09/03 10:38:55 hasso Exp $
809ae383 6
f0f0aece
SS
7CVSROOT_PKGSRC?= anoncvs@anoncvs.NetBSD.org:/cvsroot
8CVSROOT_PKGSRC_WIP?= anoncvs@anoncvs.NetBSD.se:/cvsroot
9GIT_DRAGONFLY?= git://chlamydia.fs.ei.tum.de/dragonfly.git
10GIT_BRANCH?= master
1c864d80 11
809ae383
MD
12all:
13 @echo "Install or update /usr/pkgsrc using NetBSDs anoncvs"
14 @echo " make pkgsrc-checkout"
15 @echo " make pkgsrc-update"
16 @echo ""
aee3a86e
MS
17 @echo "These targets download/update the DragonFly git repository into"
18 @echo "/usr/src."
19 @echo " make git-clone"
20 @echo " make git-update"
809ae383 21 @echo ""
f03b7956
MS
22 @echo "Install or update /usr/pkgsrc/wip using NetBSD.se anoncvs"
23 @echo " make pkgsrc-wip-checkout"
24 @echo " make pkgsrc-wip-update"
25 @echo ""
809ae383
MD
26 @echo "Extract kernel sources from src-sys.tar.bz2 in this directory."
27 @echo " make release-sys-extract"
28 @echo ""
29 @echo "If automating please restrict updates from the NetBSD anoncvs"
aee3a86e 30 @echo "server to no more than once a week and run gits no more often"
0e87bc32 31 @echo "than daily."
809ae383
MD
32
33pkgsrc-checkout:
34 cd ${.CURDIR}; \
1c864d80 35 cvs -d ${CVSROOT_PKGSRC} checkout -P pkgsrc
809ae383
MD
36
37pkgsrc-update:
38 cd ${.CURDIR}; \
1c864d80 39 cvs -d ${CVSROOT_PKGSRC} update -Pd pkgsrc
809ae383 40
f03b7956
MS
41pkgsrc-wip-checkout:
42 cd ${.CURDIR}; \
43 mkdir -p pkgsrc/wip; \
44 cd pkgsrc; \
1c864d80 45 cvs -d ${CVSROOT_PKGSRC_WIP} checkout -P wip
f03b7956
MS
46
47pkgsrc-wip-update:
48 cd ${.CURDIR}/pkgsrc; \
1c864d80 49 cvs -d ${CVSROOT_PKGSRC_WIP} update -Pd wip
f03b7956 50
809ae383
MD
51release-sys-extract:
52 bunzip2 < src-sys.tar.bz2 | tar xvpf -
53
aee3a86e 54git-clone:
f0f0aece 55 @if [ -z "`which git`" ]; then \
aee3a86e
MS
56 echo "Please install devel/scmgit from pkgsrc"; \
57 exit 1; \
f0f0aece
SS
58 fi
59 git clone -n ${GIT_DRAGONFLY} ${.CURDIR}/src
60 if [ "${GIT_BRANCH}" != master ]; then \
61 git --git-dir=${.CURDIR}/src/.git branch --track -l -f ${GIT_BRANCH} origin/${GIT_BRANCH}; \
62 fi
63 cd ${.CURDIR}/src && git checkout ${GIT_BRANCH}
809ae383 64
aee3a86e 65git-update:
f0f0aece 66 @if [ -z "`which git`" ]; then \
aee3a86e
MS
67 echo "Please install devel/scmgit from pkgsrc"; \
68 exit 1; \
f0f0aece
SS
69 fi
70 cd ${.CURDIR}/src && git pull