xref: /dragonfly/nrelease/Makefile (revision 7249926b)
1*7249926bSMatthew Dillon# $DragonFly: src/nrelease/Makefile,v 1.10 2004/07/11 02:53:13 dillon Exp $
26ca9a59cSMatthew Dillon#
35b22b655SMatthew Dillon
46ca9a59cSMatthew DillonISODIR ?= /usr/release
56ca9a59cSMatthew DillonISOFILE ?= ${ISODIR}/dfly.iso
66ca9a59cSMatthew DillonISOROOT = ${ISODIR}/root
76ca9a59cSMatthew DillonOBJSYS= ${.OBJDIR}/../sys
86ca9a59cSMatthew DillonKERNCONF ?= GENERIC
96ca9a59cSMatthew Dillon
108188de86SMatthew Dillon# Specify which packages are required on the ISO, and let the user
118188de86SMatthew Dillon# specify additional packages to include.  During the `pkgaddiso'
128188de86SMatthew Dillon# target, the packages are obtained from PACKAGES_LOC.
138188de86SMatthew Dillon#
148188de86SMatthew DillonREQ_PACKAGES= cdrtools-2.0.3_3 cvsup-without-gui-16.1h
158188de86SMatthew DillonPACKAGES?= ${REQ_PACKAGES} ${EXTRA_PACKAGES}
168188de86SMatthew DillonPACKAGES_LOC?= /usr/ports/packages/All
178188de86SMatthew Dillon
188188de86SMatthew Dillon# Specify which root skeletons are required, and let the user include
198188de86SMatthew Dillon# their own.  They are copied into ISODIR during the `pkgcustomizeiso'
208188de86SMatthew Dillon# target; each overwrites the last.
218188de86SMatthew Dillon#
228188de86SMatthew DillonREQ_ROOTSKELS= ${.CURDIR}/root
238188de86SMatthew DillonROOTSKELS?= ${REQ_ROOTSKELS} ${EXTRA_ROOTSKELS}
248188de86SMatthew Dillon
255b22b655SMatthew Dillon# note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
265b22b655SMatthew Dillon# the additional '/nrelease' manually, as a safety measure.
275b22b655SMatthew Dillon#
285b22b655SMatthew DillonNRLOBJDIR?= /usr/obj
295b22b655SMatthew Dillon
30acc392b5SJoerg SonnenbergerWORLD_CCVER ?= ${CCVER}
31acc392b5SJoerg SonnenbergerKERNEL_CCVER ?= ${CCVER}
32acc392b5SJoerg Sonnenberger
338188de86SMatthew Dillon#########################################################################
348188de86SMatthew Dillon#				BASE ISO TARGETS 			#
358188de86SMatthew Dillon#########################################################################
366ca9a59cSMatthew Dillon
378188de86SMatthew Dillonrelease:	check clean buildworld1 buildkernel1 \
388188de86SMatthew Dillon		buildiso customizeiso pkgaddiso mkiso
396ca9a59cSMatthew Dillon
408188de86SMatthew Dillonquickrel:	check clean buildworld2 buildkernel2 \
418188de86SMatthew Dillon		buildiso customizeiso pkgaddiso mkiso
428188de86SMatthew Dillon
438188de86SMatthew Dillonrealquickrel:	check clean \
448188de86SMatthew Dillon		buildiso customizeiso pkgaddiso mkiso
458188de86SMatthew Dillon
468188de86SMatthew Dillon#########################################################################
478188de86SMatthew Dillon#			ISO TARGETS WITH INSTALLER			#
488188de86SMatthew Dillon#########################################################################
498188de86SMatthew Dillon
508188de86SMatthew DillonINSTALLER_PKGS= dfuibe_installer dfuife_curses libdfui \
518188de86SMatthew Dillon		thttpd-notimeout dfuife_cgi
528188de86SMatthew DillonINSTALLER_SKELS= installer
538188de86SMatthew Dillon
548188de86SMatthew DillonINSTALLER_ENV= EXTRA_PACKAGES="${INSTALLER_PKGS}" \
558188de86SMatthew Dillon		EXTRA_ROOTSKELS="${INSTALLER_SKELS}"
568188de86SMatthew Dillon
578188de86SMatthew Dilloninstaller_check:
588188de86SMatthew Dillon		@${INSTALLER_ENV} ${MAKE} check
598188de86SMatthew Dillon
608188de86SMatthew Dilloninstaller_release:
618188de86SMatthew Dillon		${INSTALLER_ENV} ${MAKE} release
628188de86SMatthew Dillon
638188de86SMatthew Dilloninstaller_quickrel:
648188de86SMatthew Dillon		${INSTALLER_ENV} ${MAKE} quickrel
658188de86SMatthew Dillon
668188de86SMatthew Dilloninstaller_realquickrel:
678188de86SMatthew Dillon		${INSTALLER_ENV} ${MAKE} realquickrel
688188de86SMatthew Dillon
698188de86SMatthew Dillon#########################################################################
708188de86SMatthew Dillon#				HELPER TARGETS				#
718188de86SMatthew Dillon#########################################################################
726ca9a59cSMatthew Dillon
7317d0fefeSMatthew Dilloncheck:
748188de86SMatthew Dillon	@if [ ! -f /usr/local/bin/mkisofs ]; then \
7517d0fefeSMatthew Dillon		echo "You need to install the mkisofs port for this target"; \
768188de86SMatthew Dillon		exit 1; \
778188de86SMatthew Dillon	fi
788188de86SMatthew Dillon.for PKG in ${PACKAGES}
798188de86SMatthew Dillon	@if [ ! -f ${PACKAGES_LOC}/${PKG}.tgz ]; then \
808188de86SMatthew Dillon		echo "Unable to find ${PACKAGES_LOC}/${PKG}.tgz.  This is"; \
818188de86SMatthew Dillon		echo "typically accomplished by cd'ing into the appropriate"; \
828188de86SMatthew Dillon		echo "port and typing 'make package'"; \
838188de86SMatthew Dillon		echo ""; \
848188de86SMatthew Dillon		echo "If you are trying to build the installer, the"; \
858188de86SMatthew Dillon		echo "required packages can be obtained from:"; \
868188de86SMatthew Dillon		echo "http://catseye.mine.nu:8080/DragonFlyBSD/installer/"; \
878188de86SMatthew Dillon		exit 1; \
888188de86SMatthew Dillon	fi
898188de86SMatthew Dillon.endfor
908188de86SMatthew Dillon	@echo "check: all preqs found"
916ca9a59cSMatthew Dillon
926ca9a59cSMatthew Dillonbuildworld1:
93acc392b5SJoerg Sonnenberger	( cd ${.CURDIR}/..; make buildworld CCVER=${WORLD_CCVER} )
946ca9a59cSMatthew Dillon
956ca9a59cSMatthew Dillonbuildworld2:
96acc392b5SJoerg Sonnenberger	( cd ${.CURDIR}/..; make -DNOTOOLS -DNOCLEAN buildworld CCVER=${WORLD_CCVER} )
976ca9a59cSMatthew Dillon
986ca9a59cSMatthew Dillonbuildkernel1:
99acc392b5SJoerg Sonnenberger	( cd ${.CURDIR}/..; make buildkernel KERNCONF=${KERNCONF} CCVER=${KERNEL_CCVER} )
1006ca9a59cSMatthew Dillon
1016ca9a59cSMatthew Dillonbuildkernel2:
102acc392b5SJoerg Sonnenberger	( cd ${.CURDIR}/..; make -DNOCLEAN buildkernel KERNCONF=${KERNCONF} CCVER=${KERNEL_CCVER} )
1036ca9a59cSMatthew Dillon
1045b22b655SMatthew Dillon# note that we do not want to mess with any /usr/obj directories not related
1055b22b655SMatthew Dillon# to buildworld, buildkernel, or nrelease, so we must supply the proper
1065b22b655SMatthew Dillon# MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
1075b22b655SMatthew Dillon# buildkernel mechanism.
1085b22b655SMatthew Dillon#
1096ca9a59cSMatthew Dillonbuildiso:
1106ca9a59cSMatthew Dillon	if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
1115b22b655SMatthew Dillon	if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
1126ca9a59cSMatthew Dillon	( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
1135b22b655SMatthew Dillon	( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease make DESTDIR=${ISOROOT} distribution )
1146ca9a59cSMatthew Dillon	( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} \
1156ca9a59cSMatthew Dillon		installkernel KERNCONF=${KERNCONF} )
1166ca9a59cSMatthew Dillon	mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
1176ca9a59cSMatthew Dillon	mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
1186ca9a59cSMatthew Dillon	dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
1198188de86SMatthew Dillon
1208188de86SMatthew Dilloncustomizeiso:
1218188de86SMatthew Dillon.for ROOTSKEL in ${ROOTSKELS}
1228188de86SMatthew Dillon	cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
1238188de86SMatthew Dillon.endfor
1248188de86SMatthew Dillon	rm -rf `find ${ISOROOT} -type d -name CVS -print`
125*7249926bSMatthew Dillon	pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
1268188de86SMatthew Dillon
1278188de86SMatthew Dillonpkgcleaniso:
1288188de86SMatthew Dillon	rm -f ${ISOROOT}/tmp/chrootscript
1298188de86SMatthew Dillon	echo "#!/bin/sh" > ${ISOROOT}/tmp/chrootscript
1308188de86SMatthew Dillon.for PKG in ${PACKAGES}
1318188de86SMatthew Dillon	echo "pkg_delete -f ${PKG}" >> ${ISOROOT}/tmp/chrootscript
1328188de86SMatthew Dillon.endfor
1338188de86SMatthew Dillon	chmod a+x ${ISOROOT}/tmp/chrootscript
1348188de86SMatthew Dillon	chroot ${ISOROOT}/ /tmp/chrootscript || exit 0
1358188de86SMatthew Dillon	rm ${ISOROOT}/tmp/chrootscript
1368188de86SMatthew Dillon
1378188de86SMatthew Dillonpkgaddiso:
1388188de86SMatthew Dillon	rm -f ${ISOROOT}/tmp/chrootscript
1398188de86SMatthew Dillon	echo "#!/bin/sh" > ${ISOROOT}/tmp/chrootscript
1408188de86SMatthew Dillon.for PKG in ${PACKAGES}
1418188de86SMatthew Dillon	cp ${PACKAGES_LOC}/${PKG}.tgz ${ISOROOT}/tmp/${PKG}.tgz
1428188de86SMatthew Dillon	echo "echo 'Installing package ${PKG}...'" >> ${ISOROOT}/tmp/chrootscript
1438188de86SMatthew Dillon	echo "pkg_add /tmp/${PKG}.tgz" >> ${ISOROOT}/tmp/chrootscript
1448188de86SMatthew Dillon.endfor
1458188de86SMatthew Dillon	chmod a+x ${ISOROOT}/tmp/chrootscript
1468188de86SMatthew Dillon	chroot ${ISOROOT}/ /tmp/chrootscript
1478188de86SMatthew Dillon	rm ${ISOROOT}/tmp/chrootscript
1488188de86SMatthew Dillon.for PKG in ${PACKAGES}
1498188de86SMatthew Dillon	rm -f ${ISOROOT}/tmp/${PKG}.tgz
1508188de86SMatthew Dillon.endfor
1516ca9a59cSMatthew Dillon
1526ca9a59cSMatthew Dillonmkiso:
1536ca9a59cSMatthew Dillon	( cd ${ISOROOT}; mkisofs -b boot/cdboot -no-emul-boot \
154382f1ee3SMatthew Dillon		-R -J -V DragonFly -o ${ISOFILE} . )
1556ca9a59cSMatthew Dillon
1566ca9a59cSMatthew Dillonclean:
1576ca9a59cSMatthew Dillon	if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
1588188de86SMatthew Dillon	if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
1595b22b655SMatthew Dillon	if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
1606ca9a59cSMatthew Dillon
1616ca9a59cSMatthew Dillonrealclean:	clean
1623ebedc5eSMatthew Dillon	rm -rf ${OBJSYS}/${KERNCONF}
1636ca9a59cSMatthew Dillon
1646ca9a59cSMatthew Dillon.include <bsd.prog.mk>
165