/usr/Makefile: Add pkgsrc-create-shallow option
[dragonfly.git] / etc / Makefile.usr
1 # Makefile.usr - installed as /usr/Makefile
2 #
3 # Provides simple targets to download and maintain /usr/src, /usr/pkgsrc etc.
4
5 GITHOST?=git.dragonflybsd.org
6
7 help all:
8         @echo "HELP:"
9         @echo ""
10 .if exists(${.CURDIR}/pkgsrc/.git)
11 .if exists(${.CURDIR}/pkgsrc/Makefile)
12         @echo "    make pkgsrc-update          - update your pkgsrc repo from the net"
13 .else
14         @echo "    make pkgsrc-checkout        - initial checkout of your pre-packaged"
15         @echo "                                  pkgsrc repo."
16         @echo "    make pkgsrc-update          - update your pkgsrc repo from the net"
17         @echo "                                  after the initial checkout."
18 .endif
19 .else
20         @echo "    make pkgsrc-create          - fetch initial pkgsrc repo from the net"
21         @echo "    make pkgsrc-create-shallow  - fetch initial history-free pkgsrc repo"
22         @echo "    make pkgsrc-create-repo     - fetch pkgsrc repo only, no checkout"
23         @echo "    make pkgsrc-update          - update your pkgsrc repo from the net"
24 .endif
25         @echo ""
26 .if exists(${.CURDIR}/src/.git)
27 .if exists(${.CURDIR}/src/Makefile)
28         @echo "    make src-update             - update your src repo from the net"
29 .else
30         @echo "    make src-checkout           - initial checkout of your pre-packaged src repo"
31         @echo "    make src-update             - update your src repo from the net"
32         @echo "                                  after the initial checkout."
33 .endif
34 .else
35         @echo "    make src-create             - fetch initial src repo from the net"
36         @echo "    make src-create-shallow     - fetch initial history-free src repo"
37         @echo "    make src-create-repo        - fetch src repo only, no checkout"
38         @echo "    make src-update             - update your src repo from the net"
39 .endif
40         @echo ""
41 .if exists(${.CURDIR}/src-sys.tar.bz2)
42         @echo "    make release-sys-extract - extract the pre-packaged sys-only sources"
43 .endif
44         @echo ""
45         @echo "If automating please feel free to run git pull's from cron."
46         @echo "We prefer once a day but you can run them more often if you"
47         @echo "desire."
48         @echo ""
49         @echo "If you have a repo previously maintained via CVS you should"
50         @echo "rm -rf it (save any local modifications) and then use the"
51         @echo "make src-create and/or make pkgsrc-create to set up the initial"
52         @echo "git repo."
53
54 # NOTE: Adding the git gc --aggressive helps nrelease builds by significantly
55 #       reducing the disk space required.
56 #
57 pkgsrc-create-repo:
58         @echo "If problems occur you may have to rm -rf pkgsrc and try again."
59         @echo ""
60         mkdir -p ${.CURDIR}/pkgsrc
61         cd ${.CURDIR}/pkgsrc && git init
62         cd ${.CURDIR}/pkgsrc && \
63                 git remote add origin git://${GITHOST}/pkgsrcv2.git
64         cd ${.CURDIR}/pkgsrc && git fetch origin
65         cd ${.CURDIR}/pkgsrc && git branch master origin/master
66         cd ${.CURDIR}/pkgsrc && git branch pkgsrc-2012Q3 origin/pkgsrc-2012Q3
67         cd ${.CURDIR}/pkgsrc && git gc --aggressive
68
69 pkgsrc-create: pkgsrc-create-repo
70         cd ${.CURDIR}/pkgsrc && git checkout pkgsrc-2012Q3
71         cd ${.CURDIR}/pkgsrc && git pull
72
73 pkgsrc-create-shallow:
74         @echo "If problems occur you may have to rm -rf pkgsrc and try again."
75         @echo ""
76         mkdir -p ${.CURDIR}/pkgsrc
77         cd ${.CURDIR}/pkgsrc && git init
78         cd ${.CURDIR}/pkgsrc && \
79                 git remote add origin git://${GITHOST}/pkgsrcv2.git
80         cd ${.CURDIR}/pkgsrc && git fetch --depth=1 origin
81         cd ${.CURDIR}/pkgsrc && git branch master origin/master
82         cd ${.CURDIR}/pkgsrc && git checkout master
83         cd ${.CURDIR}/pkgsrc && git pull
84
85 pkgsrc-checkout:
86         cd ${.CURDIR}/pkgsrc && git checkout pkgsrc-2012Q3
87
88 pkgsrc-update:
89         cd ${.CURDIR}/pkgsrc && git pull
90
91 # NOTE: Adding the git gc --aggressive helps nrelease builds by significantly
92 #       reducing the disk space required.
93 #
94 src-create-repo:
95         @echo "If problems occur you may have to rm -rf src and try again."
96         @echo ""
97         mkdir -p ${.CURDIR}/src
98         cd ${.CURDIR}/src && git init
99         cd ${.CURDIR}/src && \
100                 git remote add origin git://${GITHOST}/dragonfly.git
101         cd ${.CURDIR}/src && git fetch origin
102         cd ${.CURDIR}/src && git branch master origin/master
103         cd ${.CURDIR}/src && git branch DragonFly_RELEASE_3_2 origin/DragonFly_RELEASE_3_2
104         cd ${.CURDIR}/src && git gc --aggressive
105
106 src-create: src-create-repo
107         cd ${.CURDIR}/src && git checkout DragonFly_RELEASE_3_2
108         cd ${.CURDIR}/src && git pull
109
110 src-create-shallow:
111         @echo "If problems occur you may have to rm -rf src and try again."
112         @echo ""
113         mkdir -p ${.CURDIR}/src
114         cd ${.CURDIR}/src && git init
115         cd ${.CURDIR}/src && \
116             git remote add origin git://${GITHOST}/dragonfly.git
117         cd ${.CURDIR}/src && git fetch --depth=1 origin
118         cd ${.CURDIR}/src && git branch master origin/master
119         cd ${.CURDIR}/src && git branch DragonFly_RELEASE_3_2 origin/DragonFly_RELEASE_3_2
120         cd ${.CURDIR}/src && git checkout DragonFly_RELEASE_3_2
121         cd ${.CURDIR}/src && git pull
122
123 src-checkout:
124         cd ${.CURDIR}/src && git checkout DragonFly_RELEASE_3_2
125
126 src-update:
127         cd ${.CURDIR}/src && git pull
128
129 release-sys-extract:
130         cd ${.CURDIR} && tar xvpjf src-sys.tar.bz2
131