Oops, remove '*'.
[dragonfly.git] / nrelease / Makefile
CommitLineData
bfe20b28 1# $DragonFly: src/nrelease/Makefile,v 1.90 2008/09/01 21:20:30 swildner Exp $
6ca9a59c 2#
5b22b655 3
9b29c40a
MD
4#########################################################################
5# ENHANCEMENTS #
6#########################################################################
7
8# These targets are now obsolete and should not be used
9#
10installer_release: warning release
11installer_quickrel: warning quickrel
12installer_realquickrel: warning realquickrel
13installer_fetch: warning fetch
cc224c64 14
bce110a5 15.if make(installer_release) || make(installer_quickrel) || make(installer_realquickrel) || make(installer_fetch)
cc224c64
JS
16WITH_INSTALLER=
17.endif
18
9b29c40a
MD
19# New method e.g. 'make installer fetch'. A series of enhancement
20# targes may be specified which set make variables which enhance
21# the build in various ways.
22#
3f279b9e 23gui installer:
9b29c40a
MD
24
25warning:
26 @echo "WARNING: The installer_* targets are now obsolete, please"
27 @echo "use 'make installer blah' instead of 'make installer_blah'"
28 @echo ""
29 @echo "will continue in 10 seconds"
30 @sleep 10
31
3f279b9e
SW
32.if make(gui)
33WITH_GUI=
34.endif
9b29c40a
MD
35.if make(installer)
36WITH_INSTALLER=
37.endif
38
39#########################################################################
40# SETUP #
41#########################################################################
42
6ca9a59c 43ISODIR ?= /usr/release
5ec00f8a 44ISOROOT ?= ${ISODIR}/root
6ca9a59c 45OBJSYS= ${.OBJDIR}/../sys
bfe20b28
SW
46
47.if make(gui)
48KERNCONF ?= DFLYLIVE VKERNEL DFLYLIVE-SMP DFLYLIVE-SMP-NOAPIC
49.else
1d3eb8c5 50KERNCONF ?= GENERIC VKERNEL
bfe20b28 51.endif
6ca9a59c 52
cc224c64 53PKGSRC_PREFIX?= /usr/pkg
bce110a5 54PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add
95b64753 55PKGBIN_PKG_DELETE?= ${PKGSRC_PREFIX}/sbin/pkg_delete
c791834f 56PKGBIN_PKG_ADMIN?= ${PKGSRC_PREFIX}/sbin/pkg_admin
bce110a5
MD
57PKGBIN_MKISOFS?= ${PKGSRC_PREFIX}/bin/mkisofs
58PKGSRC_PKG_PATH?= ${ISODIR}/packages
59PKGSRC_DB?= /var/db/pkg
356095db 60PKGSRC_BOOTSTRAP_URL?= http://pkgbox.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.12.0-RELEASE-BUILD
cc224c64 61
2157278d 62ENVCMD?= env
cc224c64 63TAR?= tar
cc224c64 64
356095db 65PKGSRC_BOOTSTRAP_KIT?= bootstrap-kit-20080211
4b08f3df 66CVSUP_BOOTSTRAP_KIT?= cvsup-bootstrap-20070716
bce110a5 67
95b64753
MD
68# Default packages to be installed on the release ISO.
69#
b67e8b8c 70PKGSRC_PACKAGES?= cdrtools-ossdvd-2.01.1.36nb2.tgz \
8edeaaff 71 isc-dhcp-base-4.0.0.tgz isc-dhcp-server-4.0.0.tgz
8188de86 72
95b64753
MD
73# Even though buildiso wipes the packages, our check target has to run
74# first and old packages (listed as they appear in pkg_info) must be
75# cleaned out in order for the pkg_add -n test we use in the check target
76# to operate properly.
77#
356095db
MD
78OLD_PKGSRC_PACKAGES?= cdrtools-2.01.01.27nb1 cdrecord-2.00.3nb2 \
79 bootstrap-kit-20070205
95b64753 80
8188de86
MD
81# Specify which root skeletons are required, and let the user include
82# their own. They are copied into ISODIR during the `pkgcustomizeiso'
83# target; each overwrites the last.
84#
85REQ_ROOTSKELS= ${.CURDIR}/root
cc224c64
JS
86ROOTSKELS?= ${REQ_ROOTSKELS}
87
bfe20b28
SW
88.if defined(WITH_INSTALLER)
89OLD_PKGSRC_PACKAGES+= dfuibe_installer-1.1.6 gettext-lib-0.14.5 \
90 dfuibe_installer-1.1.7nb1 dfuife_curses-1.5 \
91 gettext-lib-0.14.6 gettext-tools-0.14.6nb1 \
92 libaura-3.1 libdfui-4.2 libinstaller-5.1
93ROOTSKELS+= ${.CURDIR}/installer
94.endif
95
3f279b9e
SW
96.if defined(WITH_GUI)
97ISOFILE?= ${ISODIR}/dfly-gui.iso
98PKGSRC_PACKAGES+= modular-xorg-apps \
99 modular-xorg-drivers \
100 modular-xorg-fonts \
101 modular-xorg-libs \
bfe20b28
SW
102 fluxbox \
103 firefox3 \
104 xpdf \
105 zsh \
106 emacs \
107 vim \
108 pidgin \
109 irssi \
110 xchat \
111 rxvt-unicode \
112 eterm \
113 perl \
114 nano \
115 bash \
116 exctags \
117 zip \
118 sudo \
119 links-gui \
120 nmap \
121 wget \
122 terminus-font \
123 rsync \
124 idesk \
125 screen
3f279b9e
SW
126ROOTSKELS+= ${.CURDIR}/gui
127.endif
128
3f279b9e
SW
129ISOFILE ?= ${ISODIR}/dfly.iso
130
5b22b655
MD
131# note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
132# the additional '/nrelease' manually, as a safety measure.
133#
134NRLOBJDIR?= /usr/obj
135
8188de86
MD
136#########################################################################
137# BASE ISO TARGETS #
138#########################################################################
139
7ebbae99 140release: check clean buildworld1 buildkernel1 \
19d86faa 141 buildiso syssrcs customizeiso mklocatedb mkiso
8188de86 142
7ebbae99 143quickrel: check clean buildworld2 buildkernel2 \
19d86faa 144 buildiso syssrcs customizeiso mklocatedb mkiso
2e3f8f38 145
7ebbae99 146realquickrel: check clean buildiso syssrcs customizeiso mklocatedb mkiso
6ca9a59c 147
9b29c40a
MD
148quick: quickrel
149
150realquick: realquickrel
151
152#########################################################################
153# CORE SUPPORT TARGETS #
154#########################################################################
155
d2582113 156check:
bce110a5
MD
157.if !exists(${PKGBIN_PKG_ADD})
158 @echo "Unable to find ${PKGBIN_PKG_ADD}. You can use the following"
159 @echo "command to bootstrap pkgsrc:"
160 @echo " make pkgsrc_bootstrap"
161 @exit 1
162.endif
95b64753 163.for PKG in ${OLD_PKGSRC_PACKAGES}
7c01f744 164 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_DELETE} -K ${ISOROOT}${PKGSRC_DB} ${PKG} > /dev/null 2>&1 || exit 0
95b64753 165.endfor
bce110a5 166.for PKG in ${PKGSRC_PACKAGES}
7c01f744 167 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}${PKGSRC_DB} -n ${PKG} > /dev/null 2>&1 || \
cbbd7681 168 (echo "Unable to find ${PKG}, use the following command to fetch required packages:"; echo " make [installer] fetch"; exit 1)
bce110a5
MD
169.endfor
170.if !exists(${PKGBIN_MKISOFS})
171 @echo "mkisofs is not installed. It is part of the cdrecord package."
172 @echo "You can install it with:"
173 @echo " make pkgsrc_cdrecord"
174 @exit 1
175.endif
0a1628e7
MD
176.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
177 @echo "The pkgsrc bootstrap kit is not installed. You can install it with:"
cbbd7681 178 @echo " make [installer] fetch"
0a1628e7
MD
179 @exit 1
180.endif
181.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
182 @echo "The cvsup bootstrap kit is not installed. You can install it with:"
cbbd7681 183 @echo " make [installer] fetch"
0a1628e7
MD
184 @exit 1
185.endif
2e3f8f38 186
588a679c 187buildworld1 buildworld2:
82f56cac 188 cd ${.CURDIR}/..; ${WORLD_CCVER:C/^..*$/CCVER=/}${WORLD_CCVER} make ${WITH_INSTALLER:C/^/-DWANT_INSTALLER/} ${.TARGET:C/build(.*)2/quick\1/:C/1//}
6ca9a59c 189
588a679c 190buildkernel1 buildkernel2:
bfe20b28
SW
191.if make(gui)
192 cd ${.CURDIR}/..; \
193 for kernconf in ${KERNCONF}; do \
82f56cac
SS
194 ${KERNEL_CCVER:C/^..*$/CCVER=/}${KERNEL_CCVER} \
195 make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
bfe20b28
SW
196 KERNCONF=$${kernconf} KERNCONFDIR=${.CURDIR}/gui/root; \
197 done
198.else
588a679c
SS
199 cd ${.CURDIR}/..; \
200 first=; \
201 for kernconf in ${KERNCONF}; do \
82f56cac
SS
202 ${KERNEL_CCVER:C/^..*$/CCVER=/}${KERNEL_CCVER} \
203 make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
588a679c
SS
204 KERNCONF=$${kernconf} \
205 $${first:+-DNO_MODULES}; \
206 first=done; \
207 done
bfe20b28 208.endif
6ca9a59c 209
5b22b655
MD
210# note that we do not want to mess with any /usr/obj directories not related
211# to buildworld, buildkernel, or nrelease, so we must supply the proper
212# MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
213# buildkernel mechanism.
214#
6ca9a59c
MD
215buildiso:
216 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
5b22b655 217 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
7ebbae99 218 ( cd ${.CURDIR}/..; make ${WITH_INSTALLER:C/^/-DWANT_INSTALLER/} DESTDIR=${ISOROOT} installworld )
ab64cf06
SS
219 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
220 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
21aa02d0 221 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
bfe20b28
SW
222.if make(gui)
223 if [ ! -d ${ISOROOT}/kernel.smp ]; then mkdir -p ${ISOROOT}/kernel.smp; fi
224 cd ${.CURDIR}/..; \
225 make installkernel DESTDIR=${ISOROOT} \
226 KERNCONF=DFLYLIVE DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
227 cd ${.CURDIR}/..; \
228 make installkernel DESTDIR=${ISOROOT} \
229 KERNCONF=VKERNEL DESTKERNNAME=kernel.VKERNEL -DNO_MODULES KERNCONFDIR=${.CURDIR}/gui/root; \
230 cd ${.CURDIR}/..; \
231 make installkernel DESTDIR=${ISOROOT}/kernel.smp \
232 KERNCONF=DFLYLIVE-SMP DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
233 cd ${.CURDIR}/..; \
234 make installkernel DESTDIR=${ISOROOT}/kernel.smp \
235 KERNCONF=DFLYLIVE-SMP-NOAPIC DESTKERNNAME=kernel.noapic \
236 KERNCONFDIR=${.CURDIR}/gui/root -DNO_MODULES;
237.else
588a679c
SS
238 cd ${.CURDIR}/..; \
239 first=; \
240 for kernconf in ${KERNCONF}; do \
241 make DESTDIR=${ISOROOT} \
242 installkernel KERNCONF=$${kernconf} \
243 $${first:+DESTKERNNAME=kernel.$${kernconf}} \
244 $${first:+-DNO_MODULES}; \
245 first=done; \
246 done
bfe20b28 247.endif
c5c5e6fc 248 ln -s kernel ${ISOROOT}/kernel.BOOTP
6ca9a59c
MD
249 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
250 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
251 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
8188de86 252
19d86faa
MD
253# Include kernel sources on the release CD (~14MB)
254#
255syssrcs:
66b79064 256.if !defined(WITHOUT_SRCS)
ccbff5d3 257 ( cd ${.CURDIR}/../..; tar -cf - src/Makefile src/Makefile.inc1 src/sys | bzip2 -9 > ${ISOROOT}/usr/src-sys.tar.bz2 )
66b79064 258.endif
19d86faa 259
8188de86 260customizeiso:
0a1628e7 261 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${CVSUP_BOOTSTRAP_KIT}.tgz)
8188de86
MD
262.for ROOTSKEL in ${ROOTSKELS}
263 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
264.endfor
f6c08bce 265 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
20585f87 266 cd ${ISOROOT}; tar xvzpf ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
0a1628e7 267 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/bin/cvsup ${ISOROOT}/usr/local/bin/cvsup
c751e497 268 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/man/man1/cvsup.1 ${ISOROOT}/usr/local/man/man1/cvsup.1
d08963d3 269 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
21aa02d0 270 rm -rf ${ISOROOT}/usr/local/share/pristine
7249926b 271 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
4fba3387
CP
272.for UPGRADE_ITEM in Makefile \
273 etc.${MACHINE_ARCH} \
274 isdn/Makefile \
275 rc.d/Makefile \
276 periodic/Makefile \
277 periodic/daily/Makefile \
278 periodic/security/Makefile \
279 periodic/weekly/Makefile \
280 periodic/monthly/Makefile
281 cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
20585f87 282.endfor
bce110a5 283.for PKG in ${PKGSRC_PACKAGES}
799393ad 284 ${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -I -K ${ISOROOT}${PKGSRC_DB} -p ${ISOROOT}${PKGSRC_PREFIX} ${PKG}
8188de86 285.endfor
c791834f 286 find ${ISOROOT}${PKGSRC_DB} -name +CONTENTS -type f -exec sed -i '' -e 's,${ISOROOT},,' -- {} \;
7c01f744 287 ${PKGBIN_PKG_ADMIN} -K ${ISOROOT}${PKGSRC_DB} rebuild
3f279b9e
SW
288.if defined(WITH_GUI)
289.for FONT in 75dpi 100dpi misc Type1 TTF
290 chroot ${ISOROOT} /usr/pkg/bin/mkfontdir /usr/pkg/lib/X11/fonts/${FONT}
291.endfor
292.endif
6ca9a59c 293
8398ca17
SW
294mklocatedb:
295 ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
296 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
297 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
298 /usr/libexec/locate.mklocatedb \
299 -presort >${ISOROOT}/var/db/locate.database )
300
6ca9a59c 301mkiso:
bce110a5 302 ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \
382f1ee3 303 -R -J -V DragonFly -o ${ISOFILE} . )
6ca9a59c
MD
304
305clean:
306 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
8188de86 307 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
5b22b655 308 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
6ca9a59c
MD
309
310realclean: clean
3ebedc5e 311 rm -rf ${OBJSYS}/${KERNCONF}
bce110a5
MD
312 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
313 # override location.
314 if [ -d ${ISODIR}/packages ]; then rm -rf ${ISODIR}/packages; fi
6ca9a59c 315
cc224c64 316fetch:
9b29c40a 317 @if [ ! -d ${PKGSRC_PKG_PATH} ]; then mkdir -p ${PKGSRC_PKG_PATH}; fi
bce110a5 318.for PKG in ${PKGSRC_PACKAGES}
7c01f744 319 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}${PKGSRC_DB} -n ${PKG} > /dev/null 2>&1 || \
bce110a5
MD
320 (cd ${PKGSRC_PKG_PATH}; echo "Fetching ${PKGSRC_BOOTSTRAP_URL}/${PKG}"; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKG})
321.endfor
322.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
323 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
324.endif
0a1628e7
MD
325.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
326 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz)
327.endif
bce110a5
MD
328
329pkgsrc_bootstrap:
330 mkdir -p ${PKGSRC_PKG_PATH}
331.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
332 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
333.endif
334 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${PKGSRC_BOOTSTRAP_KIT}.tgz)
335 (cd ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}/bootstrap; ./bootstrap)
336
bce110a5
MD
337pkgsrc_cdrecord:
338.if !exists (${PKGBIN_MKISOFS})
20585f87 339 ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrtools*
bce110a5 340.endif
cc224c64 341
588a679c 342
cc224c64 343.PHONY: all release installer_release quickrel installer_quickrel realquickrel
9b29c40a
MD
344.PHONY: installer_fetch installer
345.PHONY: quick realquick
cc224c64
JS
346.PHONY: installer_realquickrel check buildworld1 buildworld2
347.PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
d5c58845 348.PHONY: clean realclean fetch
cc224c64 349
6ca9a59c 350.include <bsd.prog.mk>