1 # $DragonFly: src/nrelease/Makefile,v 1.75 2008/02/12 02:06:12 dillon 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
)
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.
26 @echo
"WARNING: The installer_* targets are now obsolete, please"
27 @echo
"use 'make installer blah' instead of 'make installer_blah'"
29 @echo
"will continue in 10 seconds"
36 #########################################################################
38 #########################################################################
40 ISODIR ?
= /usr
/release
41 ISOFILE ?
= ${ISODIR}/dfly.iso
42 ISOROOT
= ${ISODIR}/root
43 OBJSYS
= ${.OBJDIR
}/..
/sys
44 KERNCONF ?
= GENERIC VKERNEL
46 PKGSRC_PREFIX?
= /usr
/pkg
47 PKGBIN_PKG_ADD?
= ${PKGSRC_PREFIX}/sbin
/pkg_add
48 PKGBIN_PKG_DELETE?
= ${PKGSRC_PREFIX}/sbin
/pkg_delete
49 PKGBIN_PKG_ADMIN?
= ${PKGSRC_PREFIX}/sbin
/pkg_admin
50 PKGBIN_MKISOFS?
= ${PKGSRC_PREFIX}/bin
/mkisofs
51 PKGSRC_PKG_PATH?
= ${ISODIR}/packages
52 PKGSRC_DB?
= /var
/db
/pkg
53 PKGSRC_BOOTSTRAP_URL?
= http
://pkgbox.dragonflybsd.org
/DragonFly-pkgsrc-packages
/i386
/1.12.0-RELEASE-BUILD
58 PKGSRC_CDRECORD?
= cdrtools-ossdvd-2.01
.1.36nb2.tgz
59 PKGSRC_BOOTSTRAP_KIT?
= bootstrap-kit-20080211
60 CVSUP_BOOTSTRAP_KIT?
= cvsup-bootstrap-20070716
62 # Default packages to be installed on the release ISO.
64 PKGSRC_PACKAGES?
= cdrtools-ossdvd-2.01
.1.36nb2.tgz
66 # Even though buildiso wipes the packages, our check target has to run
67 # first and old packages (listed as they appear in pkg_info) must be
68 # cleaned out in order for the pkg_add -n test we use in the check target
69 # to operate properly.
71 OLD_PKGSRC_PACKAGES?
= cdrtools-2.01
.01.27nb1 cdrecord-2.00
.3nb2 \
72 bootstrap-kit-20070205
74 # Specify which root skeletons are required, and let the user include
75 # their own. They are copied into ISODIR during the `pkgcustomizeiso'
76 # target; each overwrites the last.
78 REQ_ROOTSKELS
= ${.CURDIR
}/root
79 ROOTSKELS?
= ${REQ_ROOTSKELS}
81 .if defined
(WITH_INSTALLER
)
82 # note: the old dfuibe_install and curses depend on the old gettext and
83 # must be removed for the old gettext to be removed. The new dfuibe install
84 # and curses are named the same as the old.
86 OLD_PKGSRC_PACKAGES
+= dfuibe_installer-1.1
.6 gettext-lib-0.14
.5 \
87 dfuibe_installer-1.1
.7nb1 dfuife_curses-1.5
88 PKGSRC_PACKAGES
+= dfuibe_installer-1.1
.7nb1.tgz dfuife_curses-1.5.tgz
89 PKGSRC_PACKAGES
+= gettext-lib-0.14
.6.tgz gettext-tools-0.14
.6nb1.tgz
90 PKGSRC_PACKAGES
+= libaura-3.1.tgz libdfui-4.2.tgz libinstaller-5.1.tgz
91 ROOTSKELS
+= ${.CURDIR
}/installer
94 # note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
95 # the additional '/nrelease' manually, as a safety measure.
99 WORLD_CCVER ?
= ${CCVER}
100 KERNEL_CCVER ?
= ${CCVER}
102 #########################################################################
104 #########################################################################
106 release
: check clean buildworld1 buildkernel1 \
107 buildiso syssrcs customizeiso mklocatedb mkiso
109 quickrel
: check clean buildworld2 buildkernel2 \
110 buildiso syssrcs customizeiso mklocatedb mkiso
112 realquickrel
: check clean buildiso syssrcs customizeiso mklocatedb mkiso
116 realquick
: realquickrel
118 #########################################################################
119 # CORE SUPPORT TARGETS #
120 #########################################################################
123 .if
!exists
(${PKGBIN_PKG_ADD})
124 @echo
"Unable to find ${PKGBIN_PKG_ADD}. You can use the following"
125 @echo
"command to bootstrap pkgsrc:"
126 @echo
" make pkgsrc_bootstrap"
129 .for PKG in
${OLD_PKGSRC_PACKAGES}
130 @
${ENVCMD} PKG_PATH
=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_DELETE} -K
${ISOROOT}/var
/db
/pkg
${PKG} > /dev
/null
2>&1 || exit
0
132 .for PKG in
${PKGSRC_PACKAGES}
133 @
${ENVCMD} PKG_PATH
=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K
${ISOROOT}/var
/db
/pkg
-n
${PKG} > /dev
/null
2>&1 || \
134 (echo
"Unable to find ${PKG}, use the following command to fetch required packages:"; echo
" make [installer] fetch"; exit
1)
136 .if
!exists
(${PKGBIN_MKISOFS})
137 @echo
"mkisofs is not installed. It is part of the cdrecord package."
138 @echo
"You can install it with:"
139 @echo
" make pkgsrc_cdrecord"
142 .if
!exists
(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
143 @echo
"The pkgsrc bootstrap kit is not installed. You can install it with:"
144 @echo
" make [installer] fetch"
147 .if
!exists
(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz
)
148 @echo
"The cvsup bootstrap kit is not installed. You can install it with:"
149 @echo
" make [installer] fetch"
153 buildworld1 buildworld2
:
154 cd
${.CURDIR
}/..
; CCVER
=${WORLD_CCVER} make
${.TARGET
:C
/build
(.
*)2/quick\
1/:C
/1//}
156 buildkernel1 buildkernel2
:
159 for kernconf in
${KERNCONF}; do \
160 CCVER
=${KERNEL_CCVER} make
${.TARGET
:C
/build
(.
*)2/quick\
1/:C
/1//} \
161 KERNCONF
=$${kernconf} \
162 $${first
:+-DNO_MODULES
}; \
166 # note that we do not want to mess with any /usr/obj directories not related
167 # to buildworld, buildkernel, or nrelease, so we must supply the proper
168 # MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
169 # buildkernel mechanism.
172 if
[ ! -d
${ISOROOT} ]; then mkdir
-p
${ISOROOT}; fi
173 if
[ ! -d
${NRLOBJDIR}/nrelease
]; then mkdir
-p
${NRLOBJDIR}/nrelease
; fi
174 ( cd
${.CURDIR
}/..
; make DESTDIR
=${ISOROOT} installworld
)
175 ( cd
${.CURDIR
}/..
/etc
; MAKEOBJDIRPREFIX
=${NRLOBJDIR}/nrelease \
176 make
-m
${.CURDIR
}/..
/share
/mk DESTDIR
=${ISOROOT} distribution
)
177 chroot
${ISOROOT} /usr
/bin
/newaliases
178 cpdup
${ISOROOT}/etc
${ISOROOT}/etc.hdd
181 for kernconf in
${KERNCONF}; do \
182 make DESTDIR
=${ISOROOT} \
183 installkernel KERNCONF
=$${kernconf} \
184 $${first
:+DESTKERNNAME
=kernel.
$${kernconf}} \
185 $${first
:+-DNO_MODULES
}; \
188 ln
-s kernel
${ISOROOT}/kernel.BOOTP
189 mtree
-deU
-f
${.CURDIR
}/..
/etc
/mtree
/BSD.local.
dist -p
${ISOROOT}/usr
/local
/
190 mtree
-deU
-f
${.CURDIR
}/..
/etc
/mtree
/BSD.var.
dist -p
${ISOROOT}/var
191 dev_mkdb
-f
${ISOROOT}/var
/run
/dev.db
${ISOROOT}/dev
193 # Include kernel sources on the release CD (~14MB)
196 .if
!defined
(WITHOUT_SRCS
)
197 ( cd
${.CURDIR
}/..
/..
; tar --exclude CVS
-cf
- src
/Makefile src
/Makefile.inc1 src
/sys | bzip2
-9 > ${ISOROOT}/usr
/src-sys.
tar.bz2
)
201 (cd
${PKGSRC_PKG_PATH}; tar xzpf
${CVSUP_BOOTSTRAP_KIT}.tgz
)
202 .for ROOTSKEL in
${ROOTSKELS}
203 cpdup
-X cpignore
-o
${ROOTSKEL} ${ISOROOT}
205 rm -rf
${ISOROOT}/tmp
/bootstrap
${ISOROOT}/usr
/obj
/pkgsrc
206 cd
${ISOROOT}; tar xvzpf
${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
207 cp
-p
${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr
/local
/bin
/cvsup
${ISOROOT}/usr
/local
/bin
/cvsup
208 cp
-p
${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr
/local
/man
/man1
/cvsup
.1 ${ISOROOT}/usr
/local
/man
/man1
/cvsup
.1
209 rm -rf
${ISOROOT}/tmp
/bootstrap
${ISOROOT}/usr
/obj
/pkgsrc
210 rm -rf
`find ${ISOROOT} -type d -name CVS -print`
211 rm -rf
${ISOROOT}/usr
/local
/share
/pristine
212 pwd_mkdb
-p
-d
${ISOROOT}/etc
${ISOROOT}/etc
/master.passwd
213 .for UPGRADE_ITEM in Makefile \
214 etc.
${MACHINE_ARCH} \
218 periodic
/daily
/Makefile \
219 periodic
/security
/Makefile \
220 periodic
/weekly
/Makefile \
221 periodic
/monthly
/Makefile
222 cp
-R
${.CURDIR
}/..
/etc
/${UPGRADE_ITEM} ${ISOROOT}/etc
/${UPGRADE_ITEM}
224 # This is a really bad hack. There seems to be no reliable way
225 # to install a package to a target directory prefix so we have to
226 # copy everything into the ISO root and do the install chrooted.
228 rm -rf
${ISOROOT}/tmp
/packages
229 mkdir
${ISOROOT}/tmp
/packages
230 .for PKG in
${PKGSRC_PACKAGES}
231 cp
${PKGSRC_PKG_PATH}/${PKG} ${ISOROOT}/tmp
/packages
233 .for PKG in
${PKGSRC_PACKAGES}
234 ${ENVCMD} PKG_PATH
=/tmp
/packages chroot
${ISOROOT} ${PKGBIN_PKG_ADD} -I
${PKG}
236 rm -rf
${ISOROOT}/tmp
/packages
237 find
${ISOROOT}${PKGSRC_DB} -name
+CONTENTS
-type f
-exec sed
-i
'' -e
's,${ISOROOT},,' -- {} \
;
238 chroot
${ISOROOT} ${PKGBIN_PKG_ADMIN} rebuild
241 ( find
-s
${ISOROOT} -path
${ISOROOT}/tmp
-or \
242 -path
${ISOROOT}/usr
/tmp
-or
-path
${ISOROOT}/var
/tmp \
243 -prune
-o
-print | sed
-e
's#^${ISOROOT}##g' | \
244 /usr
/libexec
/locate.mklocatedb \
245 -presort
>${ISOROOT}/var
/db
/locate.database
)
248 ( cd
${ISOROOT}; ${PKGBIN_MKISOFS} -b boot
/cdboot
-no-emul-boot \
249 -R
-J
-V DragonFly
-o
${ISOFILE} .
)
252 if
[ -d
${ISOROOT} ]; then chflags
-R noschg
${ISOROOT}; fi
253 if
[ -d
${ISOROOT} ]; then
rm -rf
${ISOROOT}/*; fi
254 if
[ -d
${NRLOBJDIR}/nrelease
]; then
rm -rf
${NRLOBJDIR}/nrelease
; fi
257 rm -rf
${OBJSYS}/${KERNCONF}
258 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
260 if
[ -d
${ISODIR}/packages
]; then
rm -rf
${ISODIR}/packages
; fi
263 @if
[ ! -d
${PKGSRC_PKG_PATH} ]; then mkdir
-p
${PKGSRC_PKG_PATH}; fi
264 .for PKG in
${PKGSRC_PACKAGES}
265 @
${ENVCMD} PKG_PATH
=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K
${ISOROOT}/var
/db
/pkg
-n
${PKG} > /dev
/null
2>&1 || \
266 (cd
${PKGSRC_PKG_PATH}; echo
"Fetching ${PKGSRC_BOOTSTRAP_URL}/${PKG}"; fetch
${PKGSRC_BOOTSTRAP_URL}/${PKG})
268 .if
!exists
(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
269 (cd
${PKGSRC_PKG_PATH}; fetch
${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
271 .if
!exists
(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz
)
272 (cd
${PKGSRC_PKG_PATH}; fetch
${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz
)
276 mkdir
-p
${PKGSRC_PKG_PATH}
277 .if
!exists
(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
278 (cd
${PKGSRC_PKG_PATH}; fetch
${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz
)
280 (cd
${PKGSRC_PKG_PATH}; tar xzpf
${PKGSRC_BOOTSTRAP_KIT}.tgz
)
281 (cd
${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}/bootstrap
; .
/bootstrap
)
284 .if
!exists
(${PKGBIN_MKISOFS})
285 ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrtools
*
289 .PHONY
: all release installer_release quickrel installer_quickrel realquickrel
290 .PHONY
: installer_fetch installer
291 .PHONY
: quick realquick
292 .PHONY
: installer_realquickrel
check buildworld1 buildworld2
293 .PHONY
: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
294 .PHONY
: clean realclean fetch
296 .
include <bsd.prog.mk
>