1 # $DragonFly: src/nrelease/Makefile,v 1.50 2005/12/29 20:18:58 dillon Exp $
5 installer_release: release
6 installer_quickrel: quickrel
7 installer_realquickrel: realquickrel
10 .if make(installer_release) || make(installer_quickrel) || make(installer_realquickrel) || make(installer_fetch)
14 ISODIR ?= /usr/release
15 ISOFILE ?= ${ISODIR}/dfly.iso
16 ISOROOT = ${ISODIR}/root
17 OBJSYS= ${.OBJDIR}/../sys
20 PKGSRC_PREFIX?= /usr/pkg
21 PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add
22 PKGBIN_MKISOFS?= ${PKGSRC_PREFIX}/bin/mkisofs
23 PKGSRC_PKG_PATH?= ${ISODIR}/packages
24 PKGSRC_DB?= /var/db/pkg
25 PKGSRC_BOOTSTRAP_URL?= http://pkgbox.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.4.0-RELEASE-BUILD
30 PKGSRC_CDRECORD?= cdrecord-2.00.3nb2.tgz
31 PKGSRC_BOOTSTRAP_KIT?= bootstrap-kit-20051221
32 CVSUP_BOOTSTRAP_KIT?= cvsup-bootstrap-20051229
34 PKGSRC_PACKAGES?= cdrecord-2.00.3nb2.tgz
36 # Specify which root skeletons are required, and let the user include
37 # their own. They are copied into ISODIR during the `pkgcustomizeiso'
38 # target; each overwrites the last.
40 REQ_ROOTSKELS= ${.CURDIR}/root
41 ROOTSKELS?= ${REQ_ROOTSKELS}
43 .if defined(WITH_INSTALLER)
44 PKGSRC_PACKAGES+= dfuibe_installer-1.1.6.tgz dfuife_curses-1.5.tgz
45 PKGSRC_PACKAGES+= gettext-lib-0.11.5nb6.tgz libaura-3.1.tgz \
46 libdfui-4.1.tgz libinstaller-5.1.tgz
50 # note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
51 # the additional '/nrelease' manually, as a safety measure.
55 WORLD_CCVER ?= ${CCVER}
56 KERNEL_CCVER ?= ${CCVER}
58 #########################################################################
60 #########################################################################
62 release: check clean buildworld1 buildkernel1 \
63 buildiso customizeiso mklocatedb mkiso
65 quickrel: check clean buildworld2 buildkernel2 \
66 buildiso customizeiso mklocatedb mkiso
68 realquickrel: check clean buildiso customizeiso mklocatedb mkiso
71 .if !exists(${PKGBIN_PKG_ADD})
72 @echo "Unable to find ${PKGBIN_PKG_ADD}. You can use the following"
73 @echo "command to bootstrap pkgsrc:"
74 @echo " make pkgsrc_bootstrap"
77 .if !exists(/etc/mk.conf)
78 @echo "You do not have an /etc/mk.conf. You can use the following"
79 @echo "command to install one. Otherwise pkgsrc defaults will not"
80 @echo "point to the right place:"
81 @echo " make pkgsrc_conf"
84 .for PKG in ${PKGSRC_PACKAGES}
85 @${ENV} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -n ${PKG} > /dev/null 2>&1 || \
86 (echo "Unable to find ${PKG}, use the following command to fetch required packages:"; echo " make [installer_]fetch"; exit 1)
88 .if !exists(${PKGBIN_MKISOFS})
89 @echo "mkisofs is not installed. It is part of the cdrecord package."
90 @echo "You can install it with:"
91 @echo " make pkgsrc_cdrecord"
94 .if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
95 @echo "The pkgsrc bootstrap kit is not installed. You can install it with:"
96 @echo " make [installer_]fetch"
99 .if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
100 @echo "The cvsup bootstrap kit is not installed. You can install it with:"
101 @echo " make [installer_]fetch"
106 ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make buildworld )
109 ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make quickworld )
112 ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make buildkernel KERNCONF=${KERNCONF} )
115 ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make quickkernel KERNCONF=${KERNCONF} )
117 # note that we do not want to mess with any /usr/obj directories not related
118 # to buildworld, buildkernel, or nrelease, so we must supply the proper
119 # MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
120 # buildkernel mechanism.
123 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
124 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
125 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
126 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
127 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
128 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
129 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} \
130 installkernel KERNCONF=${KERNCONF} )
131 ln -s kernel ${ISOROOT}/kernel.BOOTP
132 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
133 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
134 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
137 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${PKGSRC_BOOTSTRAP_KIT}.tgz)
138 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${CVSUP_BOOTSTRAP_KIT}.tgz)
139 .for ROOTSKEL in ${ROOTSKELS}
140 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
142 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
143 cpdup ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT} ${ISOROOT}/tmp/bootstrap
144 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/bin/cvsup ${ISOROOT}/usr/local/bin/cvsup
145 chroot ${ISOROOT} csh -c "cd /tmp/bootstrap/bootstrap; ./bootstrap"
146 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
147 rm -rf `find ${ISOROOT} -type d -name CVS -print`
148 rm -rf ${ISOROOT}/usr/local/share/pristine
149 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
150 .for UPGRADE_ITEM in Makefile \
151 etc.${MACHINE_ARCH} \
155 periodic/daily/Makefile \
156 periodic/security/Makefile \
157 periodic/weekly/Makefile \
158 periodic/monthly/Makefile
159 cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
161 .for PKG in ${PKGSRC_PACKAGES}
162 ${ENV} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -I -K ${ISOROOT}${PKGSRC_DB} -p ${ISOROOT}${PKGSRC_PREFIX} ${PKG}
166 ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
167 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
168 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
169 /usr/libexec/locate.mklocatedb \
170 -presort >${ISOROOT}/var/db/locate.database )
173 ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \
174 -R -J -V DragonFly -o ${ISOFILE} . )
177 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
178 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
179 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
182 rm -rf ${OBJSYS}/${KERNCONF}
183 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
185 if [ -d ${ISODIR}/packages ]; then rm -rf ${ISODIR}/packages; fi
188 mkdir -p ${PKGSRC_PKG_PATH}
189 .for PKG in ${PKGSRC_PACKAGES}
190 @${ENV} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -n ${PKG} > /dev/null 2>&1 || \
191 (cd ${PKGSRC_PKG_PATH}; echo "Fetching ${PKGSRC_BOOTSTRAP_URL}/${PKG}"; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKG})
193 .if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
194 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
196 .if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
197 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz)
201 mkdir -p ${PKGSRC_PKG_PATH}
202 .if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
203 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
205 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${PKGSRC_BOOTSTRAP_KIT}.tgz)
206 (cd ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}/bootstrap; ./bootstrap)
209 .if !exists(/etc/mk.conf)
210 cp ${.CURDIR}/mk.conf.pkgsrc /etc/mk.conf
212 fgrep -q BSD_PKG_MK /etc/mk.conf || cat ${.CURDIR}/mk.conf.pkgsrc >> /etc/mk.conf
216 .if !exists (${PKGBIN_MKISOFS})
217 ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrecord*
220 .PHONY: all release installer_release quickrel installer_quickrel realquickrel
221 .PHONY: installer_fetch
222 .PHONY: installer_realquickrel check buildworld1 buildworld2
223 .PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
224 .PHONY: clean realclean fetch
226 .include <bsd.prog.mk>