ed33b09f42611cb1467c4cbb07759ea4568f30bc
[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-repo  - fetch pkgsrc repo only, no checkout"
22         @echo "    make pkgsrc-update       - update your pkgsrc repo from the net"
23 .endif
24         @echo ""
25 .if exists(${.CURDIR}/src/.git)
26 .if exists(${.CURDIR}/src/Makefile)
27         @echo "    make src-update          - update your src repo from the net"
28 .else
29         @echo "    make src-checkout        - initial checkout of your pre-packaged src repo"
30         @echo "    make src-update          - update your src repo from the net"
31         @echo "                               after the initial checkout."
32 .endif
33 .else
34         @echo "    make src-create          - fetch initial src repo from the net"
35         @echo "    make src-create-shallow  - fetch initial history-free src repo"
36         @echo "    make src-create-repo     - fetch src repo only, no checkout"
37         @echo "    make src-update          - update your src repo from the net"
38 .endif
39         @echo ""
40 .if exists(${.CURDIR}/src-sys.tar.bz2)
41         @echo "    make release-sys-extract - extract the pre-packaged sys-only sources"
42 .endif
43         @echo ""
44         @echo "If automating please feel free to run git pull's from cron."
45         @echo "We prefer once a day but you can run them more often if you"
46         @echo "desire."
47         @echo ""
48         @echo "If you have a repo previously maintained via CVS you should"
49         @echo "rm -rf it (save any local modifications) and then use the"
50         @echo "make src-create and/or make pkgsrc-create to set up the initial"
51         @echo "git repo."
52
53 pkgsrc-create-repo:
54         @echo "If problems occur you may have to rm -rf pkgsrc and try again."
55         @echo ""
56         mkdir -p ${.CURDIR}/pkgsrc
57         cd ${.CURDIR}/pkgsrc && git init
58         cd ${.CURDIR}/pkgsrc && \
59                 git remote add origin git://${GITHOST}/pkgsrcv2.git
60         cd ${.CURDIR}/pkgsrc && git fetch origin
61         cd ${.CURDIR}/pkgsrc && git branch master origin/master
62
63 pkgsrc-create: pkgsrc-create-repo
64         cd ${.CURDIR}/pkgsrc && git checkout master
65         cd ${.CURDIR}/pkgsrc && git pull
66
67 pkgsrc-checkout:
68         cd ${.CURDIR}/pkgsrc && git checkout master
69
70 pkgsrc-update:
71         cd ${.CURDIR}/pkgsrc && git pull
72
73 src-create-repo:
74         @echo "If problems occur you may have to rm -rf src and try again."
75         @echo ""
76         mkdir -p ${.CURDIR}/src
77         cd ${.CURDIR}/src && git init
78         cd ${.CURDIR}/src && \
79                 git remote add origin git://${GITHOST}/dragonfly.git
80         cd ${.CURDIR}/src && git fetch origin
81         cd ${.CURDIR}/src && git branch master origin/master
82
83 src-create: src-create-repo
84         cd ${.CURDIR}/src && git checkout master
85         cd ${.CURDIR}/src && git pull
86
87 src-create-shallow:
88         @echo "If problems occur you may have to rm -rf src and try again."
89         @echo ""
90         mkdir -p ${.CURDIR}/src
91         cd ${.CURDIR}/src && git init
92         cd ${.CURDIR}/src && \
93             git remote add origin git://${GITHOST}/dragonfly.git
94         cd ${.CURDIR}/src && git fetch --depth=1 origin
95         cd ${.CURDIR}/src && git branch master origin/master
96         cd ${.CURDIR}/src && git checkout master
97         cd ${.CURDIR}/src && git pull
98
99 src-checkout:
100         cd ${.CURDIR}/src && git checkout master
101
102 src-update:
103         cd ${.CURDIR}/src && git pull
104
105 release-sys-extract:
106         cd ${.CURDIR} && tar xvpjf src-sys.tar.bz2
107