xref: /dragonfly/etc/Makefile.usr (revision ab709bfb)
1# Makefile.pkgsrc - installed as /usr/pkgsrc/Makefile
2#
3# Provides simple targets to download and maintain /usr/pkgsrc.
4#
5# $DragonFly: src/etc/Makefile.usr,v 1.8 2008/09/03 10:38:55 hasso Exp $
6
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
11
12help all:
13	@echo "Extract /usr/pkgsrc from pkgsrc-all.tgz"
14	@echo "    make release-pkgsrc-extract"
15	@echo "Or, install or update /usr/pkgsrc using NetBSDs anoncvs"
16	@echo "    make pkgsrc-checkout"
17	@echo "    make pkgsrc-update"
18	@echo ""
19	@echo "These targets download/update the DragonFly git repository into"
20	@echo "/usr/src"
21	@echo "    make git-clone"
22	@echo "    make git-update"
23	@echo ""
24	@echo "Install or update /usr/pkgsrc/wip using NetBSD.se anoncvs"
25	@echo "    make pkgsrc-wip-checkout"
26	@echo "    make pkgsrc-wip-update"
27	@echo ""
28	@echo "Extract kernel sources from src-sys.tgz in this directory"
29	@echo "    make release-sys-extract"
30	@echo "Extract full DragonFly sources from src-all.tgz in this directory"
31	@echo "    make release-src-extract"
32	@echo ""
33	@echo "If automating please restrict updates from the NetBSD anoncvs"
34	@echo "server to no more than once a week and run gits no more often"
35	@echo "than daily."
36
37pkgsrc-checkout:
38	cd ${.CURDIR}; \
39	cvs -d ${CVSROOT_PKGSRC} checkout -P pkgsrc
40
41pkgsrc-update:
42	cd ${.CURDIR}; \
43	cvs -d ${CVSROOT_PKGSRC} update -Pd pkgsrc
44
45pkgsrc-wip-checkout:
46	cd ${.CURDIR}; \
47	mkdir -p pkgsrc/wip; \
48	cd pkgsrc; \
49	cvs -d ${CVSROOT_PKGSRC_WIP} checkout -P wip
50
51pkgsrc-wip-update:
52	cd ${.CURDIR}/pkgsrc; \
53	cvs -d ${CVSROOT_PKGSRC_WIP} update -Pd wip
54
55release-pkgsrc-extract:
56	cd ${.CURDIR}; \
57	mkdir -p pkgsrc; \
58	cd pkgsrc; \
59	tar xvpzf ${.CURDIR}/pkgsrc-all.tgz
60
61release-src-extract:
62	cd ${.CURDIR}; \
63	tar xvpzf src-all.tgz
64
65release-sys-extract:
66	cd ${.CURDIR}; \
67	tar xvpzf src-sys.tgz
68
69git-clone:
70	@if [ -z "`which git`" ]; then \
71		echo "Please install devel/scmgit from pkgsrc"; \
72		exit 1; \
73	fi
74	git clone -n ${GIT_DRAGONFLY} ${.CURDIR}/src
75	if [ "${GIT_BRANCH}" != master ]; then \
76		git --git-dir=${.CURDIR}/src/.git branch --track -l -f ${GIT_BRANCH} origin/${GIT_BRANCH}; \
77	fi
78	cd ${.CURDIR}/src && git checkout ${GIT_BRANCH}
79
80git-update:
81	@if [ -z "`which git`" ]; then \
82		echo "Please install devel/scmgit from pkgsrc"; \
83		exit 1; \
84	fi
85	cd ${.CURDIR}/src && git pull
86