1 # $DragonFly: src/nrelease/Makefile,v 1.80 2008/04/01 20:55:06 swildner Exp $
4 #########################################################################
6 #########################################################################
8 # These targets are now obsolete and should not be used
10 installer_release
: warning release
11 installer_quickrel
: warning quickrel
12 installer_realquickrel
: warning realquickrel
13 installer_fetch
: warning fetch
15 .if make
(installer_release
) || make
(installer_quickrel
) || make
(installer_realquickrel
) || make
(installer_fetch
)
20 # New method e.g. 'make installer fetch'. A series of enhancement
21 # targes may be specified which set make variables which enhance
22 # the build in various ways.
27 @echo
"WARNING: The installer_* targets are now obsolete, please"
28 @echo
"use 'make installer blah' instead of 'make installer_blah'"
30 @echo
"will continue in 10 seconds"
41 #########################################################################
43 #########################################################################
45 ISODIR ?
= /usr
/release
46 ISOROOT ?
= ${ISODIR}/root
47 OBJSYS
= ${.OBJDIR
}/..
/sys
48 KERNCONF ?
= GENERIC VKERNEL
50 PKGSRC_PREFIX?
= /usr
/pkg
51 PKGBIN_PKG_ADD?
= ${PKGSRC_PREFIX}/sbin
/pkg_add
52 PKGBIN_PKG_DELETE?
= ${PKGSRC_PREFIX}/sbin
/pkg_delete
53 PKGBIN_PKG_ADMIN?
= ${PKGSRC_PREFIX}/sbin
/pkg_admin
54 PKGBIN_MKISOFS?
= ${PKGSRC_PREFIX}/bin
/mkisofs
55 PKGSRC_PKG_PATH?
= ${ISODIR}/packages
56 PKGSRC_DB?
= /var
/db
/pkg
57 PKGSRC_BOOTSTRAP_URL?
= http
://pkgbox.dragonflybsd.org
/DragonFly-pkgsrc-packages
/i386
/1.12.0-RELEASE-BUILD
62 PKGSRC_CDRECORD?
= cdrtools-ossdvd-2.01
.1.36nb2.tgz
63 PKGSRC_BOOTSTRAP_KIT?
= bootstrap-kit-20080211
64 CVSUP_BOOTSTRAP_KIT?
= cvsup-bootstrap-20070716
66 # Default packages to be installed on the release ISO.
68 PKGSRC_PACKAGES?
= cdrtools-ossdvd-2.01
.1.36nb2.tgz
70 # Even though buildiso wipes the packages, our check target has to run
71 # first and old packages (listed as they appear in pkg_info) must be
72 # cleaned out in order for the pkg_add -n test we use in the check target
73 # to operate properly.
75 OLD_PKGSRC_PACKAGES?
= cdrtools-2.01
.01.27nb1 cdrecord-2.00
.3nb2 \
76 bootstrap-kit-20070205
78 # Specify which root skeletons are required, and let the user include
79 # their own. They are copied into ISODIR during the `pkgcustomizeiso'
80 # target; each overwrites the last.
82 REQ_ROOTSKELS
= ${.CURDIR
}/root
83 ROOTSKELS?
= ${REQ_ROOTSKELS}
86 ISOFILE?
= ${ISODIR}/dfly-gui.iso
87 PKGSRC_PACKAGES
+= modular-xorg-apps \
88 modular-xorg-drivers \
92 ROOTSKELS
+= ${.CURDIR
}/gui
95 .if defined
(WITH_INSTALLER
) || defined
(WITH_LOCAL_INSTALLER
)
96 .if
!defined
(WITH_LOCAL_INSTALLER
)
97 # note: the old dfuibe_install and curses depend on the old gettext and
98 # must be removed for the old gettext to be removed. The new dfuibe install
99 # and curses are named the same as the old.
101 OLD_PKGSRC_PACKAGES
+= dfuibe_installer-1.1
.6 gettext-lib-0.14
.5 \
102 # dfuibe_installer-1.1.7nb1 dfuife_curses-1.5
103 PKGSRC_PACKAGES
+= dfuibe_installer-1.1
.7nb1.tgz dfuife_curses-1.5.tgz
104 PKGSRC_PACKAGES
+= gettext-lib-0.14
.6.tgz gettext-tools-0.14
.6nb1.tgz
105 PKGSRC_PACKAGES
+= libaura-3.1.tgz libdfui-4.2.tgz libinstaller-5.1.tgz
107 ROOTSKELS
+= ${.CURDIR
}/installer
110 ISOFILE ?
= ${ISODIR}/dfly.iso
112 # note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
113 # the additional '/nrelease' manually, as a safety measure.
117 WORLD_CCVER ?
= ${CCVER}
118 KERNEL_CCVER ?
= ${CCVER}
120 #########################################################################
122 #########################################################################
124 release
: localinstaller
check clean buildworld1 buildkernel1 \
125 buildiso syssrcs customizeiso mklocatedb mkiso
127 quickrel
: localinstaller
check clean buildworld2 buildkernel2 \
128 buildiso syssrcs customizeiso mklocatedb mkiso
130 realquickrel
: localinstaller
check clean buildiso syssrcs customizeiso mklocatedb mkiso
134 realquick
: realquickrel
136 #########################################################################
137 # CORE SUPPORT TARGETS #
138 #########################################################################
140 .if defined
(WITH_LOCAL_INSTALLER
)
141 cd
${.CURDIR
}/..
/usr.sbin
/installer
; make
145 .if
!exists
(${PKGBIN_PKG_ADD})
146 @echo
"Unable to find ${PKGBIN_PKG_ADD}. You can use the following"
147 @echo
"command to bootstrap pkgsrc:"
148 @echo
" make pkgsrc_bootstrap"
151 .for PKG in
${OLD_PKGSRC_PACKAGES}
152 @
${ENVCMD} PKG_PATH
=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_DELETE} -K
${ISOROOT}/var
/db
/pkg
${PKG} > /dev
/null
2>&1 || exit
0
154 .for PKG in
${PKGSRC_PACKAGES}
155 @
${ENVCMD} PKG_PATH
=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K
${ISOROOT}/var
/db
/pkg
-n
${PKG} > /dev
/null
2>&1 || \
156 (echo
"Unable to find ${PKG}, use the following command to fetch required packages:"; echo
" make [installer] fetch"; exit
1)
158 .if
!exists
(${PKGBIN_MKISOFS})
159 @echo
"mkisofs is not installed. It is part of the cdrecord package."
160 @echo
"You can install it with:"
161 @echo
" make pkgsrc_cdrecord"
164 .if
!exists
(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
165 @echo
"The pkgsrc bootstrap kit is not installed. You can install it with:"
166 @echo
" make [installer] fetch"
169 .if
!exists
(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz
)
170 @echo
"The cvsup bootstrap kit is not installed. You can install it with:"
171 @echo
" make [installer] fetch"
175 buildworld1 buildworld2
:
176 cd
${.CURDIR
}/..
; CCVER
=${WORLD_CCVER} make
${.TARGET
:C
/build
(.
*)2/quick\
1/:C
/1//}
178 buildkernel1 buildkernel2
:
181 for kernconf in
${KERNCONF}; do \
182 CCVER
=${KERNEL_CCVER} make
${.TARGET
:C
/build
(.
*)2/quick\
1/:C
/1//} \
183 KERNCONF
=$${kernconf} \
184 $${first
:+-DNO_MODULES
}; \
188 # note that we do not want to mess with any /usr/obj directories not related
189 # to buildworld, buildkernel, or nrelease, so we must supply the proper
190 # MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
191 # buildkernel mechanism.
194 if
[ ! -d
${ISOROOT} ]; then mkdir
-p
${ISOROOT}; fi
195 if
[ ! -d
${NRLOBJDIR}/nrelease
]; then mkdir
-p
${NRLOBJDIR}/nrelease
; fi
196 ( cd
${.CURDIR
}/..
; make DESTDIR
=${ISOROOT} installworld
)
197 .if defined
(WITH_LOCAL_INSTALLER
)
198 ( cd
${.CURDIR
}/..
/usr.sbin
/installer
; make DESTDIR
=${ISOROOT} install )
199 ( cd
${.CURDIR
}/..
/share
/installer
; make DESTDIR
=${ISOROOT} install )
201 ( cd
${.CURDIR
}/..
/etc
; MAKEOBJDIRPREFIX
=${NRLOBJDIR}/nrelease \
202 make
-m
${.CURDIR
}/..
/share
/mk DESTDIR
=${ISOROOT} distribution
)
203 chroot
${ISOROOT} /usr
/bin
/newaliases
204 cpdup
${ISOROOT}/etc
${ISOROOT}/etc.hdd
207 for kernconf in
${KERNCONF}; do \
208 make DESTDIR
=${ISOROOT} \
209 installkernel KERNCONF
=$${kernconf} \
210 $${first
:+DESTKERNNAME
=kernel.
$${kernconf}} \
211 $${first
:+-DNO_MODULES
}; \
214 ln
-s kernel
${ISOROOT}/kernel.BOOTP
215 mtree
-deU
-f
${.CURDIR
}/..
/etc
/mtree
/BSD.local.
dist -p
${ISOROOT}/usr
/local
/
216 mtree
-deU
-f
${.CURDIR
}/..
/etc
/mtree
/BSD.var.
dist -p
${ISOROOT}/var
217 dev_mkdb
-f
${ISOROOT}/var
/run
/dev.db
${ISOROOT}/dev
219 # Include kernel sources on the release CD (~14MB)
222 .if
!defined
(WITHOUT_SRCS
)
223 ( cd
${.CURDIR
}/..
/..
; tar --exclude CVS
-cf
- src
/Makefile src
/Makefile.inc1 src
/sys | bzip2
-9 > ${ISOROOT}/usr
/src-sys.
tar.bz2
)
227 (cd
${PKGSRC_PKG_PATH}; tar xzpf
${CVSUP_BOOTSTRAP_KIT}.tgz
)
228 .for ROOTSKEL in
${ROOTSKELS}
229 cpdup
-X cpignore
-o
${ROOTSKEL} ${ISOROOT}
231 rm -rf
${ISOROOT}/tmp
/bootstrap
${ISOROOT}/usr
/obj
/pkgsrc
232 cd
${ISOROOT}; tar xvzpf
${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
233 cp
-p
${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr
/local
/bin
/cvsup
${ISOROOT}/usr
/local
/bin
/cvsup
234 cp
-p
${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr
/local
/man
/man1
/cvsup
.1 ${ISOROOT}/usr
/local
/man
/man1
/cvsup
.1
235 rm -rf
${ISOROOT}/tmp
/bootstrap
${ISOROOT}/usr
/obj
/pkgsrc
236 rm -rf
`find ${ISOROOT} -type d -name CVS -print`
237 rm -rf
${ISOROOT}/usr
/local
/share
/pristine
238 pwd_mkdb
-p
-d
${ISOROOT}/etc
${ISOROOT}/etc
/master.passwd
239 .for UPGRADE_ITEM in Makefile \
240 etc.
${MACHINE_ARCH} \
244 periodic
/daily
/Makefile \
245 periodic
/security
/Makefile \
246 periodic
/weekly
/Makefile \
247 periodic
/monthly
/Makefile
248 cp
-R
${.CURDIR
}/..
/etc
/${UPGRADE_ITEM} ${ISOROOT}/etc
/${UPGRADE_ITEM}
250 # There seems to be no reliable way to install a package to a target
251 # directory prefix so we mount_null our package directory into the
252 # ISO root and do the install chrooted.
254 mkdir
${ISOROOT}/tmp
/packages
255 mount_null
-o ro
${PKGSRC_PKG_PATH} ${ISOROOT}/tmp
/packages
256 .for PKG in
${PKGSRC_PACKAGES}
257 ${ENVCMD} PKG_PATH
=/tmp
/packages chroot
${ISOROOT} ${PKGBIN_PKG_ADD} -I
${PKG}
259 umount
${ISOROOT}/tmp
/packages
260 rmdir
${ISOROOT}/tmp
/packages
261 find
${ISOROOT}${PKGSRC_DB} -name
+CONTENTS
-type f
-exec sed
-i
'' -e
's,${ISOROOT},,' -- {} \
;
262 chroot
${ISOROOT} ${PKGBIN_PKG_ADMIN} rebuild
263 .if defined
(WITH_GUI
)
264 .for FONT in
75dpi
100dpi misc Type1 TTF
265 chroot
${ISOROOT} /usr
/pkg
/bin
/mkfontdir
/usr
/pkg
/lib
/X11
/fonts
/${FONT}
270 ( find
-s
${ISOROOT} -path
${ISOROOT}/tmp
-or \
271 -path
${ISOROOT}/usr
/tmp
-or
-path
${ISOROOT}/var
/tmp \
272 -prune
-o
-print | sed
-e
's#^${ISOROOT}##g' | \
273 /usr
/libexec
/locate.mklocatedb \
274 -presort
>${ISOROOT}/var
/db
/locate.database
)
277 ( cd
${ISOROOT}; ${PKGBIN_MKISOFS} -b boot
/cdboot
-no-emul-boot \
278 -R
-J
-V DragonFly
-o
${ISOFILE} .
)
281 -umount
${ISOROOT}/tmp
/packages
282 if
[ -d
${ISOROOT} ]; then chflags
-R noschg
${ISOROOT}; fi
283 if
[ -d
${ISOROOT} ]; then
rm -rf
${ISOROOT}/*; fi
284 if
[ -d
${NRLOBJDIR}/nrelease
]; then
rm -rf
${NRLOBJDIR}/nrelease
; fi
287 rm -rf
${OBJSYS}/${KERNCONF}
288 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
290 if
[ -d
${ISODIR}/packages
]; then
rm -rf
${ISODIR}/packages
; fi
293 @if
[ ! -d
${PKGSRC_PKG_PATH} ]; then mkdir
-p
${PKGSRC_PKG_PATH}; fi
294 .for PKG in
${PKGSRC_PACKAGES}
295 @
${ENVCMD} PKG_PATH
=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K
${ISOROOT}/var
/db
/pkg
-n
${PKG} > /dev
/null
2>&1 || \
296 (cd
${PKGSRC_PKG_PATH}; echo
"Fetching ${PKGSRC_BOOTSTRAP_URL}/${PKG}"; fetch
${PKGSRC_BOOTSTRAP_URL}/${PKG})
298 .if
!exists
(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
299 (cd
${PKGSRC_PKG_PATH}; fetch
${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
301 .if
!exists
(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz
)
302 (cd
${PKGSRC_PKG_PATH}; fetch
${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz
)
306 mkdir
-p
${PKGSRC_PKG_PATH}
307 .if
!exists
(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
308 (cd
${PKGSRC_PKG_PATH}; fetch
${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
310 (cd
${PKGSRC_PKG_PATH}; tar xzpf
${PKGSRC_BOOTSTRAP_KIT}.tgz
)
311 (cd
${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}/bootstrap
; .
/bootstrap
)
314 .if
!exists
(${PKGBIN_MKISOFS})
315 ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrtools
*
319 .PHONY
: all release installer_release quickrel installer_quickrel realquickrel
320 .PHONY
: installer_fetch installer
321 .PHONY
: quick realquick
322 .PHONY
: installer_realquickrel
check buildworld1 buildworld2
323 .PHONY
: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
324 .PHONY
: clean realclean fetch
326 .
include <bsd.prog.mk
>