Remove any vestiges of the old pam, particularly /etc/pam.conf. pam config
[dragonfly.git] / nrelease / Makefile
CommitLineData
bc9c6dc4 1# $DragonFly: src/nrelease/Makefile,v 1.89 2008/08/31 15:46:48 swildner Exp $
6ca9a59c 2#
5b22b655 3
9b29c40a
MD
4#########################################################################
5# ENHANCEMENTS #
6#########################################################################
7
8# These targets are now obsolete and should not be used
9#
10installer_release: warning release
11installer_quickrel: warning quickrel
12installer_realquickrel: warning realquickrel
13installer_fetch: warning fetch
cc224c64 14
bce110a5 15.if make(installer_release) || make(installer_quickrel) || make(installer_realquickrel) || make(installer_fetch)
cc224c64
JS
16WITH_INSTALLER=
17.endif
18
9b29c40a
MD
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.
22#
3f279b9e 23gui installer:
9b29c40a
MD
24
25warning:
26 @echo "WARNING: The installer_* targets are now obsolete, please"
27 @echo "use 'make installer blah' instead of 'make installer_blah'"
28 @echo ""
29 @echo "will continue in 10 seconds"
30 @sleep 10
31
3f279b9e
SW
32.if make(gui)
33WITH_GUI=
34.endif
9b29c40a
MD
35.if make(installer)
36WITH_INSTALLER=
37.endif
38
39#########################################################################
40# SETUP #
41#########################################################################
42
6ca9a59c 43ISODIR ?= /usr/release
5ec00f8a 44ISOROOT ?= ${ISODIR}/root
6ca9a59c 45OBJSYS= ${.OBJDIR}/../sys
1d3eb8c5 46KERNCONF ?= GENERIC VKERNEL
6ca9a59c 47
cc224c64 48PKGSRC_PREFIX?= /usr/pkg
bce110a5 49PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add
95b64753 50PKGBIN_PKG_DELETE?= ${PKGSRC_PREFIX}/sbin/pkg_delete
c791834f 51PKGBIN_PKG_ADMIN?= ${PKGSRC_PREFIX}/sbin/pkg_admin
bce110a5
MD
52PKGBIN_MKISOFS?= ${PKGSRC_PREFIX}/bin/mkisofs
53PKGSRC_PKG_PATH?= ${ISODIR}/packages
54PKGSRC_DB?= /var/db/pkg
356095db 55PKGSRC_BOOTSTRAP_URL?= http://pkgbox.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.12.0-RELEASE-BUILD
cc224c64 56
2157278d 57ENVCMD?= env
cc224c64 58TAR?= tar
cc224c64 59
356095db 60PKGSRC_BOOTSTRAP_KIT?= bootstrap-kit-20080211
4b08f3df 61CVSUP_BOOTSTRAP_KIT?= cvsup-bootstrap-20070716
bce110a5 62
95b64753
MD
63# Default packages to be installed on the release ISO.
64#
b67e8b8c 65PKGSRC_PACKAGES?= cdrtools-ossdvd-2.01.1.36nb2.tgz \
8edeaaff 66 isc-dhcp-base-4.0.0.tgz isc-dhcp-server-4.0.0.tgz
8188de86 67
95b64753
MD
68# Even though buildiso wipes the packages, our check target has to run
69# first and old packages (listed as they appear in pkg_info) must be
70# cleaned out in order for the pkg_add -n test we use in the check target
71# to operate properly.
72#
356095db
MD
73OLD_PKGSRC_PACKAGES?= cdrtools-2.01.01.27nb1 cdrecord-2.00.3nb2 \
74 bootstrap-kit-20070205
95b64753 75
8188de86
MD
76# Specify which root skeletons are required, and let the user include
77# their own. They are copied into ISODIR during the `pkgcustomizeiso'
78# target; each overwrites the last.
79#
80REQ_ROOTSKELS= ${.CURDIR}/root
cc224c64
JS
81ROOTSKELS?= ${REQ_ROOTSKELS}
82
3f279b9e
SW
83.if defined(WITH_GUI)
84ISOFILE?= ${ISODIR}/dfly-gui.iso
85PKGSRC_PACKAGES+= modular-xorg-apps \
86 modular-xorg-drivers \
87 modular-xorg-fonts \
88 modular-xorg-libs \
89 fluxbox
90ROOTSKELS+= ${.CURDIR}/gui
91.endif
92
7ebbae99 93.if defined(WITH_INSTALLER)
26e1ac8c
SW
94OLD_PKGSRC_PACKAGES+= dfuibe_installer-1.1.6 gettext-lib-0.14.5 \
95 dfuibe_installer-1.1.7nb1 dfuife_curses-1.5 \
96 gettext-lib-0.14.6 gettext-tools-0.14.6nb1 \
97 libaura-3.1 libdfui-4.2 libinstaller-5.1
2b990685 98ROOTSKELS+= ${.CURDIR}/installer
cc224c64 99.endif
8188de86 100
3f279b9e
SW
101ISOFILE ?= ${ISODIR}/dfly.iso
102
5b22b655
MD
103# note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
104# the additional '/nrelease' manually, as a safety measure.
105#
106NRLOBJDIR?= /usr/obj
107
acc392b5
JS
108WORLD_CCVER ?= ${CCVER}
109KERNEL_CCVER ?= ${CCVER}
110
8188de86
MD
111#########################################################################
112# BASE ISO TARGETS #
113#########################################################################
114
7ebbae99 115release: check clean buildworld1 buildkernel1 \
19d86faa 116 buildiso syssrcs customizeiso mklocatedb mkiso
8188de86 117
7ebbae99 118quickrel: check clean buildworld2 buildkernel2 \
19d86faa 119 buildiso syssrcs customizeiso mklocatedb mkiso
2e3f8f38 120
7ebbae99 121realquickrel: check clean buildiso syssrcs customizeiso mklocatedb mkiso
6ca9a59c 122
9b29c40a
MD
123quick: quickrel
124
125realquick: realquickrel
126
127#########################################################################
128# CORE SUPPORT TARGETS #
129#########################################################################
130
d2582113 131check:
bce110a5
MD
132.if !exists(${PKGBIN_PKG_ADD})
133 @echo "Unable to find ${PKGBIN_PKG_ADD}. You can use the following"
134 @echo "command to bootstrap pkgsrc:"
135 @echo " make pkgsrc_bootstrap"
136 @exit 1
137.endif
95b64753 138.for PKG in ${OLD_PKGSRC_PACKAGES}
7c01f744 139 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_DELETE} -K ${ISOROOT}${PKGSRC_DB} ${PKG} > /dev/null 2>&1 || exit 0
95b64753 140.endfor
bce110a5 141.for PKG in ${PKGSRC_PACKAGES}
7c01f744 142 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}${PKGSRC_DB} -n ${PKG} > /dev/null 2>&1 || \
cbbd7681 143 (echo "Unable to find ${PKG}, use the following command to fetch required packages:"; echo " make [installer] fetch"; exit 1)
bce110a5
MD
144.endfor
145.if !exists(${PKGBIN_MKISOFS})
146 @echo "mkisofs is not installed. It is part of the cdrecord package."
147 @echo "You can install it with:"
148 @echo " make pkgsrc_cdrecord"
149 @exit 1
150.endif
0a1628e7
MD
151.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
152 @echo "The pkgsrc bootstrap kit is not installed. You can install it with:"
cbbd7681 153 @echo " make [installer] fetch"
0a1628e7
MD
154 @exit 1
155.endif
156.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
157 @echo "The cvsup bootstrap kit is not installed. You can install it with:"
cbbd7681 158 @echo " make [installer] fetch"
0a1628e7
MD
159 @exit 1
160.endif
2e3f8f38 161
588a679c 162buildworld1 buildworld2:
7ebbae99 163 cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make ${WITH_INSTALLER:C/^/-DWANT_INSTALLER/} ${.TARGET:C/build(.*)2/quick\1/:C/1//}
6ca9a59c 164
588a679c
SS
165buildkernel1 buildkernel2:
166 cd ${.CURDIR}/..; \
167 first=; \
168 for kernconf in ${KERNCONF}; do \
169 CCVER=${KERNEL_CCVER} make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
170 KERNCONF=$${kernconf} \
171 $${first:+-DNO_MODULES}; \
172 first=done; \
173 done
6ca9a59c 174
5b22b655
MD
175# note that we do not want to mess with any /usr/obj directories not related
176# to buildworld, buildkernel, or nrelease, so we must supply the proper
177# MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
178# buildkernel mechanism.
179#
6ca9a59c
MD
180buildiso:
181 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
5b22b655 182 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
7ebbae99 183 ( cd ${.CURDIR}/..; make ${WITH_INSTALLER:C/^/-DWANT_INSTALLER/} DESTDIR=${ISOROOT} installworld )
ab64cf06
SS
184 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
185 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
21aa02d0 186 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
588a679c
SS
187 cd ${.CURDIR}/..; \
188 first=; \
189 for kernconf in ${KERNCONF}; do \
190 make DESTDIR=${ISOROOT} \
191 installkernel KERNCONF=$${kernconf} \
192 $${first:+DESTKERNNAME=kernel.$${kernconf}} \
193 $${first:+-DNO_MODULES}; \
194 first=done; \
195 done
c5c5e6fc 196 ln -s kernel ${ISOROOT}/kernel.BOOTP
6ca9a59c
MD
197 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
198 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
199 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
8188de86 200
19d86faa
MD
201# Include kernel sources on the release CD (~14MB)
202#
203syssrcs:
66b79064
MD
204.if !defined(WITHOUT_SRCS)
205 ( cd ${.CURDIR}/../..; tar --exclude CVS -cf - src/Makefile src/Makefile.inc1 src/sys | bzip2 -9 > ${ISOROOT}/usr/src-sys.tar.bz2 )
206.endif
19d86faa 207
8188de86 208customizeiso:
0a1628e7 209 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${CVSUP_BOOTSTRAP_KIT}.tgz)
8188de86
MD
210.for ROOTSKEL in ${ROOTSKELS}
211 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
212.endfor
f6c08bce 213 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
20585f87 214 cd ${ISOROOT}; tar xvzpf ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
0a1628e7 215 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/bin/cvsup ${ISOROOT}/usr/local/bin/cvsup
c751e497 216 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/man/man1/cvsup.1 ${ISOROOT}/usr/local/man/man1/cvsup.1
d08963d3 217 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
8188de86 218 rm -rf `find ${ISOROOT} -type d -name CVS -print`
21aa02d0 219 rm -rf ${ISOROOT}/usr/local/share/pristine
7249926b 220 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
4fba3387
CP
221.for UPGRADE_ITEM in Makefile \
222 etc.${MACHINE_ARCH} \
223 isdn/Makefile \
224 rc.d/Makefile \
225 periodic/Makefile \
226 periodic/daily/Makefile \
227 periodic/security/Makefile \
228 periodic/weekly/Makefile \
229 periodic/monthly/Makefile
230 cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
20585f87 231.endfor
bce110a5 232.for PKG in ${PKGSRC_PACKAGES}
799393ad 233 ${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -I -K ${ISOROOT}${PKGSRC_DB} -p ${ISOROOT}${PKGSRC_PREFIX} ${PKG}
8188de86 234.endfor
c791834f 235 find ${ISOROOT}${PKGSRC_DB} -name +CONTENTS -type f -exec sed -i '' -e 's,${ISOROOT},,' -- {} \;
7c01f744 236 ${PKGBIN_PKG_ADMIN} -K ${ISOROOT}${PKGSRC_DB} rebuild
3f279b9e
SW
237.if defined(WITH_GUI)
238.for FONT in 75dpi 100dpi misc Type1 TTF
239 chroot ${ISOROOT} /usr/pkg/bin/mkfontdir /usr/pkg/lib/X11/fonts/${FONT}
240.endfor
241.endif
6ca9a59c 242
8398ca17
SW
243mklocatedb:
244 ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
245 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
246 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
247 /usr/libexec/locate.mklocatedb \
248 -presort >${ISOROOT}/var/db/locate.database )
249
6ca9a59c 250mkiso:
bce110a5 251 ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \
382f1ee3 252 -R -J -V DragonFly -o ${ISOFILE} . )
6ca9a59c
MD
253
254clean:
255 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
8188de86 256 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
5b22b655 257 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
6ca9a59c
MD
258
259realclean: clean
3ebedc5e 260 rm -rf ${OBJSYS}/${KERNCONF}
bce110a5
MD
261 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
262 # override location.
263 if [ -d ${ISODIR}/packages ]; then rm -rf ${ISODIR}/packages; fi
6ca9a59c 264
cc224c64 265fetch:
9b29c40a 266 @if [ ! -d ${PKGSRC_PKG_PATH} ]; then mkdir -p ${PKGSRC_PKG_PATH}; fi
bce110a5 267.for PKG in ${PKGSRC_PACKAGES}
7c01f744 268 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}${PKGSRC_DB} -n ${PKG} > /dev/null 2>&1 || \
bce110a5
MD
269 (cd ${PKGSRC_PKG_PATH}; echo "Fetching ${PKGSRC_BOOTSTRAP_URL}/${PKG}"; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKG})
270.endfor
271.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
272 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
273.endif
0a1628e7
MD
274.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
275 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz)
276.endif
bce110a5
MD
277
278pkgsrc_bootstrap:
279 mkdir -p ${PKGSRC_PKG_PATH}
280.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
281 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
282.endif
283 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${PKGSRC_BOOTSTRAP_KIT}.tgz)
284 (cd ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}/bootstrap; ./bootstrap)
285
bce110a5
MD
286pkgsrc_cdrecord:
287.if !exists (${PKGBIN_MKISOFS})
20585f87 288 ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrtools*
bce110a5 289.endif
cc224c64 290
588a679c 291
cc224c64 292.PHONY: all release installer_release quickrel installer_quickrel realquickrel
9b29c40a
MD
293.PHONY: installer_fetch installer
294.PHONY: quick realquick
cc224c64
JS
295.PHONY: installer_realquickrel check buildworld1 buildworld2
296.PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
d5c58845 297.PHONY: clean realclean fetch
cc224c64 298
6ca9a59c 299.include <bsd.prog.mk>