bridge_enqueue() does not use bridge(4)'s softc, so don't pretend that the
[dragonfly/port-amd64.git] / nrelease / Makefile
blob0ea96434ef49445ffe7cf65b838cac0bd38ca575
1 # $DragonFly: src/nrelease/Makefile,v 1.64 2007/06/04 01:47:41 swildner Exp $
4 # compat target
5 installer_release: release
6 installer_quickrel: quickrel
7 installer_realquickrel: realquickrel
8 installer_fetch: fetch
10 .if make(installer_release) || make(installer_quickrel) || make(installer_realquickrel) || make(installer_fetch)
11 WITH_INSTALLER=
12 .endif
14 ISODIR ?= /usr/release
15 ISOFILE ?= ${ISODIR}/dfly.iso
16 ISOROOT = ${ISODIR}/root
17 OBJSYS= ${.OBJDIR}/../sys
18 KERNCONF ?= GENERIC NATA
20 PKGSRC_PREFIX?= /usr/pkg
21 PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add
22 PKGBIN_PKG_ADMIN?= ${PKGSRC_PREFIX}/sbin/pkg_admin
23 PKGBIN_MKISOFS?= ${PKGSRC_PREFIX}/bin/mkisofs
24 PKGSRC_PKG_PATH?= ${ISODIR}/packages
25 PKGSRC_DB?= /var/db/pkg
26 PKGSRC_BOOTSTRAP_URL?= http://pkgbox.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.9.0-DEVELOPMENT
28 ENVCMD?= env
29 TAR?= tar
31 PKGSRC_CDRECORD?= cdrecord-2.00.3nb2.tgz
32 PKGSRC_BOOTSTRAP_KIT?= bootstrap-kit-20070205
33 CVSUP_BOOTSTRAP_KIT?= cvsup-bootstrap-20051229
35 PKGSRC_PACKAGES?= cdrecord-2.00.3nb2.tgz
37 # Specify which root skeletons are required, and let the user include
38 # their own. They are copied into ISODIR during the `pkgcustomizeiso'
39 # target; each overwrites the last.
41 REQ_ROOTSKELS= ${.CURDIR}/root
42 ROOTSKELS?= ${REQ_ROOTSKELS}
44 .if defined(WITH_INSTALLER)
45 PKGSRC_PACKAGES+= dfuibe_installer-1.1.6a.tgz dfuife_curses-1.5.tgz
46 PKGSRC_PACKAGES+= gettext-lib-0.14.5.tgz libaura-3.1.tgz \
47 libdfui-4.2.tgz libinstaller-5.1.tgz
48 ROOTSKELS+= ${.CURDIR}/installer
49 .endif
51 # note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
52 # the additional '/nrelease' manually, as a safety measure.
54 NRLOBJDIR?= /usr/obj
56 WORLD_CCVER ?= ${CCVER}
57 KERNEL_CCVER ?= ${CCVER}
59 #########################################################################
60 # BASE ISO TARGETS #
61 #########################################################################
63 release: check clean buildworld1 buildkernel1 \
64 buildiso syssrcs customizeiso mklocatedb mkiso
66 quickrel: check clean buildworld2 buildkernel2 \
67 buildiso syssrcs customizeiso mklocatedb mkiso
69 realquickrel: check clean buildiso syssrcs customizeiso mklocatedb mkiso
71 check:
72 .if !exists(${PKGBIN_PKG_ADD})
73 @echo "Unable to find ${PKGBIN_PKG_ADD}. You can use the following"
74 @echo "command to bootstrap pkgsrc:"
75 @echo " make pkgsrc_bootstrap"
76 @exit 1
77 .endif
78 .if !exists(/etc/mk.conf)
79 @echo "You do not have an /etc/mk.conf. You can use the following"
80 @echo "command to install one. Otherwise pkgsrc defaults will not"
81 @echo "point to the right place:"
82 @echo " make pkgsrc_conf"
83 @exit 1
84 .endif
85 .for PKG in ${PKGSRC_PACKAGES}
86 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}/var/db/pkg -n ${PKG} > /dev/null 2>&1 || \
87 (echo "Unable to find ${PKG}, use the following command to fetch required packages:"; echo " make [installer_]fetch"; exit 1)
88 .endfor
89 .if !exists(${PKGBIN_MKISOFS})
90 @echo "mkisofs is not installed. It is part of the cdrecord package."
91 @echo "You can install it with:"
92 @echo " make pkgsrc_cdrecord"
93 @exit 1
94 .endif
95 .if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
96 @echo "The pkgsrc bootstrap kit is not installed. You can install it with:"
97 @echo " make [installer_]fetch"
98 @exit 1
99 .endif
100 .if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
101 @echo "The cvsup bootstrap kit is not installed. You can install it with:"
102 @echo " make [installer_]fetch"
103 @exit 1
104 .endif
105 .if !exists(${.CURDIR}/../sys/config/NATA)
106 @echo "/usr/src/sys/config/NATA doesn't exist, your CVS may be out of date"
107 @exit 1
108 .endif
110 buildworld1 buildworld2:
111 cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make ${.TARGET:C/build(.*)2/quick\1/:C/1//}
113 buildkernel1 buildkernel2:
114 cd ${.CURDIR}/..; \
115 first=; \
116 for kernconf in ${KERNCONF}; do \
117 CCVER=${KERNEL_CCVER} make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
118 KERNCONF=$${kernconf} \
119 $${first:+-DNO_MODULES}; \
120 first=done; \
121 done
123 # note that we do not want to mess with any /usr/obj directories not related
124 # to buildworld, buildkernel, or nrelease, so we must supply the proper
125 # MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
126 # buildkernel mechanism.
128 buildiso:
129 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
130 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
131 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
132 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
133 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
134 cp -p ${.CURDIR}/mk.conf.pkgsrc ${ISOROOT}/etc/mk.conf
135 chroot ${ISOROOT} /usr/bin/newaliases
136 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
137 cd ${.CURDIR}/..; \
138 first=; \
139 for kernconf in ${KERNCONF}; do \
140 make DESTDIR=${ISOROOT} \
141 installkernel KERNCONF=$${kernconf} \
142 $${first:+DESTKERNNAME=kernel.$${kernconf}} \
143 $${first:+-DNO_MODULES}; \
144 first=done; \
145 done
146 ln -s kernel ${ISOROOT}/kernel.BOOTP
147 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
148 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
149 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
151 # Include kernel sources on the release CD (~14MB)
153 syssrcs:
154 .if !defined(WITHOUT_SRCS)
155 ( cd ${.CURDIR}/../..; tar --exclude CVS -cf - src/Makefile src/Makefile.inc1 src/sys | bzip2 -9 > ${ISOROOT}/usr/src-sys.tar.bz2 )
156 .endif
158 customizeiso:
159 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${PKGSRC_BOOTSTRAP_KIT}.tgz)
160 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${CVSUP_BOOTSTRAP_KIT}.tgz)
161 .for ROOTSKEL in ${ROOTSKELS}
162 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
163 .endfor
164 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
165 cpdup ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT} ${ISOROOT}/tmp/bootstrap
166 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/bin/cvsup ${ISOROOT}/usr/local/bin/cvsup
167 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/man/man1/cvsup.1 ${ISOROOT}/usr/local/man/man1/cvsup.1
168 mkdir -p ${ISOROOT}/tmp/bootstrap/distfiles # new bootstrap insists in that
169 chroot ${ISOROOT} csh -c "cd /tmp/bootstrap/bootstrap; ./bootstrap"
170 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
171 rm -rf `find ${ISOROOT} -type d -name CVS -print`
172 rm -rf ${ISOROOT}/usr/local/share/pristine
173 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
174 .for UPGRADE_ITEM in Makefile \
175 etc.${MACHINE_ARCH} \
176 isdn/Makefile \
177 rc.d/Makefile \
178 periodic/Makefile \
179 periodic/daily/Makefile \
180 periodic/security/Makefile \
181 periodic/weekly/Makefile \
182 periodic/monthly/Makefile
183 cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
184 .endfor
185 .for PKG in ${PKGSRC_PACKAGES}
186 ${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -I -K ${ISOROOT}${PKGSRC_DB} -p ${ISOROOT}${PKGSRC_PREFIX} ${PKG}
187 .endfor
188 find ${ISOROOT}${PKGSRC_DB} -name +CONTENTS -type f -exec sed -i '' -e 's,${ISOROOT},,' -- {} \;
189 ${PKGBIN_PKG_ADMIN} -K ${ISOROOT}${PKGSRC_DB} rebuild
191 mklocatedb:
192 ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
193 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
194 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
195 /usr/libexec/locate.mklocatedb \
196 -presort >${ISOROOT}/var/db/locate.database )
198 mkiso:
199 ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \
200 -R -J -V DragonFly -o ${ISOFILE} . )
202 clean:
203 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
204 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
205 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
207 realclean: clean
208 rm -rf ${OBJSYS}/${KERNCONF}
209 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
210 # override location.
211 if [ -d ${ISODIR}/packages ]; then rm -rf ${ISODIR}/packages; fi
213 fetch:
214 mkdir -p ${PKGSRC_PKG_PATH}
215 .for PKG in ${PKGSRC_PACKAGES}
216 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}/var/db/pkg -n ${PKG} > /dev/null 2>&1 || \
217 (cd ${PKGSRC_PKG_PATH}; echo "Fetching ${PKGSRC_BOOTSTRAP_URL}/${PKG}"; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKG})
218 .endfor
219 .if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
220 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
221 .endif
222 .if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
223 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz)
224 .endif
226 pkgsrc_bootstrap:
227 mkdir -p ${PKGSRC_PKG_PATH}
228 .if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
229 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
230 .endif
231 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${PKGSRC_BOOTSTRAP_KIT}.tgz)
232 (cd ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}/bootstrap; ./bootstrap)
234 pkgsrc_conf:
235 .if !exists(/etc/mk.conf)
236 cp ${.CURDIR}/mk.conf.pkgsrc /etc/mk.conf
237 .else
238 fgrep -q BSD_PKG_MK /etc/mk.conf || cat ${.CURDIR}/mk.conf.pkgsrc >> /etc/mk.conf
239 .endif
241 pkgsrc_cdrecord:
242 .if !exists (${PKGBIN_MKISOFS})
243 ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrecord*
244 .endif
247 .PHONY: all release installer_release quickrel installer_quickrel realquickrel
248 .PHONY: installer_fetch
249 .PHONY: installer_realquickrel check buildworld1 buildworld2
250 .PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
251 .PHONY: clean realclean fetch
253 .include <bsd.prog.mk>