Annotation of pkgsrc/bootstrap/bootstrap, Revision 1.13
1.1 grant 1: #! /bin/sh
2:
1.13 ! heinz 3: # $NetBSD: bootstrap,v 1.12 2004/04/11 03:17:12 heinz Exp $
1.1 grant 4: #
5: #
6: # Copyright (c) 2001-2002 Alistair G. Crooks. All rights reserved.
7: #
8: # Redistribution and use in source and binary forms, with or without
9: # modification, are permitted provided that the following conditions
10: # are met:
11: # 1. Redistributions of source code must retain the above copyright
12: # notice, this list of conditions and the following disclaimer.
13: # 2. Redistributions in binary form must reproduce the above copyright
14: # notice, this list of conditions and the following disclaimer in the
15: # documentation and/or other materials provided with the distribution.
16: # 3. All advertising materials mentioning features or use of this software
17: # must display the following acknowledgement:
18: # This product includes software developed by Alistair G. Crooks
19: # for the NetBSD project.
20: # 4. The name of the author may not be used to endorse or promote
21: # products derived from this software without specific prior written
22: # permission.
23: #
24: # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
25: # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26: # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27: # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
28: # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
30: # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31: # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32: # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33: # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34: # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35: #
36: #set -x
37:
38: BOOTSTRAP_VERSION=20040214
39:
40: # set defaults for system locations
41: prefix=/usr/pkg
42: pkgdbdir=/var/db/pkg
43: pkgsrcdir=/usr/pkgsrc
1.11 jmmv 44: sysconfdir=${prefix}/etc
1.1 grant 45:
46: ignorecasecheck=no
47: ignoreusercheck=no
48:
1.9 grant 49: # where the building takes place
50: wrkdir=work # default: relative to pkgsrc/bootstrap
51: bootstrapdir=`pwd`
52:
1.1 grant 53: usage="Usage: $0 "'
1.9 grant 54: [ --workdir=<workdir> ]
1.1 grant 55: [ --prefix=<prefix> ]
56: [ --pkgdbdir=<pkgdbdir> ]
57: [ --pkgsrcdir=<pkgsrcdir> ]
1.11 jmmv 58: [ --sysconfdir=<sysconfdir> ]
1.1 grant 59: [ --ignore-case-check ]
60: [ --ignore-user-check ]
61: [ --help ]'
62:
63: # this replicates some of the logic in bsd.prefs.mk. until
64: # bootstrap-pkgsrc is merged into pkgsrc, we need to determine the
65: # right value for OPSYS and MACHINE_ARCH.
66:
67: # strip / for BSD/OS
68: opsys=`uname -s | tr -d /`
69:
70: die()
71: {
72: echo >&2 "$@"
73: exit 1
74: }
75:
76: echo_msg()
77: {
78: echo "===> $@"
79: }
80:
81: get_abi()
82: {
83: abi_opsys=$@
84: case "$abi_opsys" in
85: IRIX)
86: abi=`sed -e 's/.*\(abi=\)\([on]*[36][24]\).*/\2/' /etc/compiler.defaults`
87: isa=`sed -e 's/.*\(isa=mips\)\([1234]\).*/\2/' /etc/compiler.defaults`
88: case "$abi" in
89: o32)
90: imakeopts="-DBuildO32 -DSgiISAo32=$isa"
91: abi=""
92: ;;
93: n32) imakeopts="-DBuildN32 -DSgiISA32=$isa"
94: abi="32"
95: ;;
96: 64 | n64)
97: imakeopts="-DBuild64bit -DSgiISA64=$isa"
98: abi="64"
99: ;;
100: esac
101:
102:
103: ;;
104: esac
105: }
106:
107: check_prog()
108: {
109: _var="$1"; _name="$2"
110:
111: eval _tmp=\"\$$_var\"
112: if [ "x$_tmp" != "x" ]; then
113: # Variable is already set (by the user, for example)
114: return 0
115: fi
116:
117: for _d in `echo $PATH | tr ':' ' '`; do
118: if [ -x "$_d/$_name" ]; then
119: # Program found
120: eval $_var=\""$_d/$_name"\"
121: return 1
122: fi
123: done
124:
125: die "$_name not found in path."
126: }
127:
128: opsys_finish()
129: {
130: case "$opsys" in
131: IRIX)
132: # setting X11BASE to /usr breaks buildlink
133: if [ ! -e /usr/X11R6 ]; then
134: ln -sf /usr /usr/X11R6
135: fi
136: if [ ! -z $imakeopts ]; then
1.9 grant 137: echo "IMAKEOPTS+=$imakeopts" >> ${MKCONF_EXAMPLE}
1.1 grant 138: fi
139: patch -d / --forward --quiet -E -p0 \
140: < files/irix.patch 2>/dev/null || true
141: ;;
142: esac
143: }
144:
145: is_root()
146: {
147: if [ `$idprog -u` != 0 ]; then
148: return 0
149: fi
150: return 1
151: }
152:
153: # run a command, abort if it fails
154: run_cmd()
155: {
156: echo_msg "running: $@"
157: eval "$@"
158: ret=$?
159: if [ $ret -ne 0 ]; then
160: echo_msg "exited with status $ret"
161: die "aborted."
162: fi
163: }
164:
1.4 sketch 165: # Some versions of mkdir (notably SunOS) bail out too easily, so use the
166: # install-sh wrapper instead.
167: mkdir_p()
168: {
1.7 tv 169: for dir in $@; do
1.10 tv 170: run_cmd "($shprog ./files/install-sh -d -o $user -g $group $dir)"
1.7 tv 171: done
1.4 sketch 172: }
173:
1.2 grant 174: copy_src()
175: {
176: _src="$1"; _dst="$2"
177: if [ ! -d $wrkdir/$_dst ]; then
1.4 sketch 178: mkdir_p $wrkdir/$_dst
1.2 grant 179: fi
180: $cpprog -Rp $_src/* $wrkdir/$_dst
181: }
182:
1.1 grant 183: build_start=`date`
184: echo_msg "bootstrap command: $0 $@"
185: echo_msg "bootstrap started: $build_start"
186:
187: overpath=""
1.3 tv 188: root_user=root
1.1 grant 189: case "$opsys" in
190: Darwin)
191: root_group=wheel
192: need_pax=yes
193: need_mtree=no
194: need_bsd_install=no
195: need_sed=no
196: set_opsys=no
197: check_prog mtreeprog mtree
198: machine_arch=`uname -p`
199: ;;
200: FreeBSD)
201: root_group=wheel
202: need_pax=yes
203: need_mtree=yes
204: need_bsd_install=no
205: need_sed=no
206: set_opsys=no
207: machine_arch=`uname -p`
208: ;;
209: HP-UX)
210: root_group=root
211: need_pax=yes
212: need_mtree=yes
213: need_bsd_install=yes
214: need_sed=yes
215: set_opsys=no
216: ;;
217: IRIX*)
218: if [ -d "/usr/freeware/bin" ]; then
219: overpath="/usr/freeware/bin:$overpath"
220: fi
221: if [ -d "/usr/bsd/bin" ]; then
222: overpath="/usr/bsd/bin:$overpath"
223: fi
224: root_group=sys
225: need_mtree=yes
226: need_bsd_install=yes
227: need_pax=yes
228: configargs="--with-machine_arch=mipseb"
229: get_abi "IRIX"
230: opsys=IRIX
231: need_sed=yes
232: set_opsys=yes
233: ;;
234: Linux)
235: if [ -f /etc/debian_version ]; then
236: DEBIAN=yes
237: fi
238: root_group=root
239: need_pax=yes
240: need_mtree=yes
241: need_bsd_install=no
242: need_sed=no
243: set_opsys=no
244: machine_arch=`uname -m | sed -e 's/i.86/i386/'`
245: ;;
246: NetBSD)
247: root_group=wheel
248: need_pax=no
249: need_mtree=no
250: need_bsd_install=no
251: need_sed=no
252: set_opsys=no
253: check_prog paxprog pax
254: check_prog tarprog tar
255: check_prog mtreeprog mtree
256: machine_arch=`uname -p`
257: ;;
258: OpenBSD)
259: root_group=wheel
260: need_pax=yes
261: need_mtree=no
262: need_bsd_install=no
263: need_sed=no
264: set_opsys=no
265: check_prog mtreeprog mtree
1.8 grant 266: machine_arch=`uname -m`
1.1 grant 267: ;;
268: SunOS)
269: if [ -d "/usr/xpg4/bin" ]; then
270: overpath="/usr/xpg4/bin:$overpath"
271: fi
272: root_group=root
273: need_pax=yes
274: need_mtree=yes
275: need_bsd_install=no
276: need_sed=yes
277: set_opsys=no
278: whoamiprog=/usr/ucb/whoami
279: machine_arch=`uname -p | sed -e 's/i86pc/i386/'`
280: ;;
281: AIX)
282: root_group=system
283: need_pax=yes
284: need_mtree=yes
285: need_bsd_install=yes
286: need_sed=yes
287: need_fixed_strip=yes
288: set_opsys=no
289: ;;
290: Interix)
1.3 tv 291: is_root () {
292: if id -Gn | grep -q +Administrators; then
293: return 1
294: fi
295: return 0
296: }
297: root_user=`id -un`
1.1 grant 298: root_group=+Administrators
1.5 tv 299: need_pax=yes
1.1 grant 300: need_mtree=yes
301: need_bsd_install=yes
302: need_sed=yes
303: set_opsys=no
1.10 tv 304: # only used for unprivileged builds
305: groupsprog="id -gn"
306: # for bootstrap only; pkgsrc uses CPPFLAGS
1.1 grant 307: CC="gcc -D_ALL_SOURCE"; export CC
308: ;;
1.12 heinz 309: UnixWare)
310: root_group=sys
311: need_pax=yes
312: need_mtree=yes
313: need_bsd_install=no
314: BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV"
315: need_mkdir=yes
316: need_sed=yes
317: whoamiprog=/usr/ucb/whoami
318: set_opsys=no
319: CC="gcc -DUNIXWARE"; export CC
320: ;;
1.1 grant 321: *)
322: echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc"
323: root_group=wheel
324: need_pax=yes
325: need_mtree=yes
326: need_bsd_install=yes
327: need_sed=yes
328: set_opsys=no
329: ;;
330: esac
331:
332: # export OPSYS and MACHINE_ARCH for pkg_install. we only set
333: # MACHINE_ARCH on platforms where we override bmake's value.
334: OPSYS=${opsys}
335: export OPSYS
336: if [ "${machine_arch}" != "" ]; then
337: MACHINE_ARCH=${machine_arch}
338: export MACHINE_ARCH
339: fi
340:
341: if [ "x${PRESERVE_PATH}" != "xyes" ]; then
342: PATH="$overpath:$PATH"
343: fi
344:
345: check_prog awkprog awk
346: check_prog cpprog cp
347: check_prog idprog id
348: check_prog groupsprog groups
349: check_prog lsprog ls
350: check_prog rmdirprog rmdir
351: check_prog sedprog sed
352: check_prog shprog sh
353: check_prog whoamiprog whoami
354:
355: while [ $# -gt 0 ]; do
356: case $1 in
1.9 grant 357: --workdir=*) wrkdir=`echo $1 | $sedprog -e 's|--workdir=||'` ;;
1.11 jmmv 358: --prefix=*) prefix=`echo $1 | $sedprog -e 's|--prefix=||'`
359: sysconfdir=${prefix}/etc ;;
1.1 grant 360: --pkgdbdir=*) pkgdbdir=`echo $1 | $sedprog -e 's|--pkgdbdir=||'` ;;
361: --pkgsrcdir=*) pkgsrcdir=`echo $1 | $sedprog -e 's|--pkgsrcdir=||'` ;;
1.11 jmmv 362: --sysconfdir=*) sysconfdir=`echo $1 | $sedprog -e 's|--sysconfdir=||'`;;
1.1 grant 363: --ignore-case-check) ignorecasecheck=yes ;;
364: --ignore-user-check) ignoreusercheck=yes ;;
365: --help) echo "$usage"; exit ;;
366: -h) echo "$usage"; exit ;;
367: --*) echo "$usage"; exit 1 ;;
368: esac
369: shift
370: done
371:
1.9 grant 372: if [ ! -d ${wrkdir} ]; then
373: if mkdir ${wrkdir}; then
374: :
375: else
376: echo "Could not create the working directory \"${wrkdir}\". Try $0 -h.";
377: exit 1
378: fi
379: fi
380: if touch ${wrkdir}/.writeable; then
381: :
382: else
383: echo "\"${wrkdir}\" is not writeable. Try $0 -h.";
384: exit 1
385: fi
386: echo "Working directory is: ${wrkdir}"
387:
1.1 grant 388: is_root
389: if [ $? = 1 ]; then
1.3 tv 390: user=$root_user
1.1 grant 391: group=$root_group
392: else
393: if [ $ignoreusercheck = "no" ]; then
394: die "You must be root to install bootstrap-pkgsrc."
395: fi
396:
397: user=`$whoamiprog`
398: group=`$groupsprog | $awkprog '{print $1}'`
399: echo_msg "building as unprivileged user $user/$group"
400:
401: # force bmake install target to use $user and $group
402: echo "BINOWN=$user
403: BINGRP=$group
404: LIBOWN=$user
405: LIBGRP=$group
406: MANOWN=$user
1.9 grant 407: MANGRP=$group" > ${wrkdir}/Makefile.inc
1.1 grant 408: fi
409:
410: # make sure we're using a case-sensitive file system on Darwin
411: if [ $ignorecasecheck = "no" ]; then
412: case "$opsys" in
1.6 tv 413: Darwin|Interix)
1.1 grant 414: echo_msg "Testing file system case sensitivity"
415: for fs in "$prefix" "$pkgsrcdir"; do
416: testdir="pkgsrc-REQUIRES-case-SENSITIVE-filesystem"
417: testdir_mangled="PKGSRC-requires-CASE-sensitive-FILESYSTEM"
1.4 sketch 418: mkdir_p "$fs/$testdir" || die "can't verify filesystem ($fs) case-sensitivity"
1.1 grant 419: if [ -d "$fs/$testdir_mangled" ]; then
420: $rmdirprog "$fs/$testdir"
1.6 tv 421: die "\"$fs\" needs to be on a case-sensitive filesystem (see README.$opsys)"
1.1 grant 422: fi
423: $rmdirprog "$fs/$testdir"
424: done
425: ;;
426: esac
427: fi
428:
429: # export the proper environment
430: PATH=$prefix/bin:$prefix/sbin:${PATH}; export PATH
431: if [ -d /usr/ccs/bin -a -x /usr/ccs/bin/make ]; then
432: PATH=/usr/ccs/bin:$PATH; export PATH
433: fi
434: PKG_DBDIR=$pkgdbdir; export PKG_DBDIR
435: LOCALBASE=$prefix; export LOCALBASE
436:
437: # set up an example mk.conf file
1.9 grant 438: MKCONF_EXAMPLE=${wrkdir}/mk.conf.example
439: export MKCONF_EXAMPLE
440: echo_msg "Creating mk.conf.example in ${wrkdir}"
1.11 jmmv 441: echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${MKCONF_EXAMPLE}
1.9 grant 442: echo "# `date`" >> ${MKCONF_EXAMPLE}
443: echo "" >> ${MKCONF_EXAMPLE}
444: echo ".ifdef BSD_PKG_MK # begin pkgsrc settings" >> ${MKCONF_EXAMPLE}
445: echo "" >> ${MKCONF_EXAMPLE}
1.1 grant 446:
447: # IRIX64 needs to be set to IRIX, for example
448: if [ "$set_opsys" = "yes" ]; then
1.9 grant 449: echo "OPSYS=$opsys" >> ${MKCONF_EXAMPLE}
1.1 grant 450: fi
451:
452: if [ ! -z "$abi" ]; then
1.9 grant 453: echo "ABI=$abi" >> ${MKCONF_EXAMPLE}
1.1 grant 454: fi
455:
456: # save environment in example mk.conf
1.9 grant 457: echo "PKG_DBDIR=$pkgdbdir" >> ${MKCONF_EXAMPLE}
458: echo "LOCALBASE=$prefix" >> ${MKCONF_EXAMPLE}
1.11 jmmv 459: if [ "${sysconfdir}" != "${prefix}/etc" ]; then
460: echo "PKG_SYSCONFBASE=$sysconfdir" >> ${MKCONF_EXAMPLE}
461: fi
1.1 grant 462:
463: # create directories
1.4 sketch 464: mkdir_p $prefix $pkgdbdir $prefix/sbin
465: mkdir_p $prefix/man/man1 $prefix/man/cat1
466: mkdir_p $prefix/man/man8 $prefix/man/cat8
1.1 grant 467:
468: # bootstrap make and *.mk files
1.4 sketch 469: mkdir_p $prefix/share/mk $prefix/lib
1.9 grant 470: copy_src bmake bmake
471:
472: (cd ${wrkdir}/bmake/mk;
473: if [ -f ${bootstrapdir}/mods/mk/$opsys.sys.mk ]; then
474: run_cmd "$cpprog ${bootstrapdir}/mods/mk/$opsys.sys.mk $prefix/share/mk/sys.mk"
1.1 grant 475: else
1.9 grant 476: run_cmd "$cpprog ${bootstrapdir}/mods/mk/generic.sys.mk $prefix/share/mk/sys.mk"
1.1 grant 477: fi
478: run_cmd "$cpprog bsd.*.mk $prefix/share/mk")
479:
480: if [ -f mods/mk/$opsys.bsd.lib.mk ] ; then
1.9 grant 481: run_cmd "$cpprog ${wrkdir}/bmake/mk/bsd.lib.mk ${wrkdir}/bmake/mk/bsd.lib.mk.orig"
482: run_cmd "$cpprog mods/mk/$opsys.bsd.lib.mk ${wrkdir}/bmake/mk/bsd.lib.mk"
1.1 grant 483: fi
484:
1.9 grant 485: run_cmd "$cpprog ${wrkdir}/bmake/mk/bsd.man.mk ${wrkdir}/bsd.man.mk.orig"
1.1 grant 486: if [ -f mods/mk/$opsys.bsd.man.mk ] ; then
1.9 grant 487: run_cmd "$cpprog mods/mk/$opsys.bsd.man.mk ${wrkdir}/bsd.man.mk"
1.1 grant 488: run_cmd "$cpprog mods/mk/$opsys.bsd.man.mk $prefix/share/mk/bsd.man.mk"
489: fi
490:
1.11 jmmv 491: own_mk=mods/mk/bsd.own.mk.in
1.3 tv 492: if [ -f mods/mk/$opsys.bsd.own.mk ] ; then
1.11 jmmv 493: own_mk=mods/mk/$opsys.bsd.own.mk.in
1.3 tv 494: fi
1.11 jmmv 495: run_cmd "$sedprog -e 's|@ROOT_GROUP@|'$root_group'|g;s|@ROOT_USER@|'$root_user'|g;s|@SYSCONFDIR@|'$sysconfdir'|g' $own_mk > $prefix/share/mk/bsd.own.mk"
1.3 tv 496:
497: if [ -f mods/mk/$opsys.bsd.prog.mk ] ; then
498: run_cmd "$cpprog mods/mk/$opsys.bsd.prog.mk $prefix/share/mk/bsd.prog.mk"
1.1 grant 499: fi
500:
501: if [ -f mods/mk/$opsys.bsd.sys.mk ]; then
502: run_cmd "$cpprog mods/mk/$opsys.bsd.sys.mk $prefix/share/mk/bsd.sys.mk"
503: fi
504:
505: case "$opsys" in
1.9 grant 506: NetBSD) run_cmd "$cpprog mods/bmake/Makefile.in ${wrkdir}/bmake/Makefile.in"
1.1 grant 507: ;;
508: esac
509:
510: if [ "$need_bsd_install" = "yes" ]; then
511: echo_msg "Installing BSD compatible install script"
512: run_cmd "(cd files; $shprog ./install-sh -c -o $user -g $group -m 755 install-sh $prefix/bin/install-sh)"
513: BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV"
514: fi
515:
516: if [ "$need_fixed_strip" = "yes" ] ; then
517: echo_msg "Installing fixed strip script"
518: run_cmd "(cd files; $shprog ./install-sh -c -o $user -g $group -m 755 strip-sh $prefix/bin/strip)"
519: fi
520:
1.12 heinz 521: if [ "$need_mkdir" = "yes" ]; then
1.13 ! heinz 522: echo_msg "Installing fixed mkdir script \"mkdir-sh\""
! 523: run_cmd "(cd files; $shprog ./install-sh -c -o $user -g $group -m 755 mkdir-sh $prefix/sbin/mkdir-sh)"
1.12 heinz 524: fi
525:
1.1 grant 526: echo_msg "Installing bmake"
1.2 grant 527: run_cmd "(cd $wrkdir/bmake; $shprog ./configure --prefix=$prefix --with-default-sys-path=$prefix/share/mk $configargs && make -f makefile.boot bootstrap && env BINDIR=$prefix/bin MANDIR=$prefix/man $BSTRAP_ENV ./bmake -f Makefile install)"
1.1 grant 528:
529: # build libnbcompat
530: echo_msg "Building libnbcompat"
1.2 grant 531: copy_src ../pkgtools/libnbcompat/files libnbcompat
1.11 jmmv 532: run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure -C --prefix=$prefix --sysconfdir=$sysconfdir && $prefix/bin/bmake)"
1.1 grant 533:
534: # bootstrap tnftp
535: case "$DEBIAN" in
536: yes)
537: LIBS="-lncurses"
538: ;;
539: esac
540: echo_msg "Installing tnftp"
1.2 grant 541: copy_src ../net/tnftp/files tnftp
1.11 jmmv 542: run_cmd "(cd $wrkdir/tnftp; env $BSTRAP_ENV $shprog ./configure --prefix=$prefix --sysconfdir=$sysconfdir && make && (cd src && make install))"
1.1 grant 543: pkg_install_args="$pkg_install_args --with-ftp=$prefix/bin/ftp"
544:
545: FETCH_CMD=$prefix/bin/ftp
546: export FETCH_CMD
1.9 grant 547: echo "FETCH_CMD=$prefix/bin/ftp" >> ${MKCONF_EXAMPLE}
1.1 grant 548:
549: # bootstrap digest
550: echo_msg "Installing digest"
1.2 grant 551: copy_src ../pkgtools/digest/files digest
1.11 jmmv 552: run_cmd "(cd $wrkdir/digest; env $BSTRAP_ENV $shprog ./configure -C --prefix=$prefix --sysconfdir=$sysconfdir && make && make install)"
1.1 grant 553:
554: # create the digest package's meta files
1.2 grant 555: digestversion=digest-`$awkprog -F "'" '/^PACKAGE_VERSION=/ {print $2}' $wrkdir/digest/configure`
556: $lsprog -ld $prefix/bin/digest | $awkprog '{ print $5 }' > $wrkdir/digest/.size
1.1 grant 557: env DIGESTPROG=$prefix/bin/digest PKG_DIGEST=md5 PKG_DBDIR=$pkgdbdir \
1.2 grant 558: $shprog ./pkg.sh create -d $wrkdir/digest/DESCR -O \
1.1 grant 559: -c '-Message digest wrapper utility' -l -p $prefix \
1.2 grant 560: -f $wrkdir/digest/PLIST -s $wrkdir/digest/.size -S $wrkdir/digest/.size $digestversion
1.1 grant 561:
562: # we often need NetBSD's pax as well, nowadays, to make binary packages
563: case "$need_pax" in
564: yes) echo_msg "Installing pax"
1.2 grant 565: copy_src ../archivers/pax/files pax
1.11 jmmv 566: run_cmd "(cd $wrkdir/pax; env $BSTRAP_ENV CPPFLAGS='-I../libnbcompat' LDFLAGS='-L../libnbcompat' LIBS='-lnbcompat' $shprog ./configure -C --prefix=$prefix --sysconfdir=$sysconfdir && $prefix/bin/bmake && $prefix/bin/bmake install)"
1.9 grant 567: echo "PAX=$prefix/bin/pax" >> ${MKCONF_EXAMPLE}
1.1 grant 568: pkg_install_args="$pkg_install_args --with-pax=$prefix/bin/pax --with-tar=$prefix/bin/tar"
569: ;;
570: *)
571: pkg_install_args="$pkg_install_args --with-pax=$paxprog --with-tar=$tarprog"
572: ;;
573: esac
574:
575: # bootstrap mtree if necessary
576: case "$need_mtree" in
577: yes) echo_msg "Installing mtree"
1.2 grant 578: copy_src ../pkgtools/mtree/files mtree
1.11 jmmv 579: run_cmd "(cd $wrkdir/mtree; env $BSTRAP_ENV CPPFLAGS='-I../libnbcompat' LDFLAGS='-L../libnbcompat' LIBS='-lnbcompat' $shprog ./configure -C --prefix=$prefix --sysconfdir=$sysconfdir && $prefix/bin/bmake && $prefix/bin/bmake install)"
1.1 grant 580: pkg_install_args="$pkg_install_args --with-mtree=$prefix/sbin/mtree"
581: ;;
582: *) pkg_install_args="$pkg_install_args --with-mtree=$mtreeprog"
583: ;;
584: esac
585:
586: # bootstrap sed if necessary
587: case "$need_sed" in
588: yes) echo_msg "Installing sed"
1.2 grant 589: copy_src ../textproc/nbsed/files sed
1.11 jmmv 590: run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV $shprog ./configure -C --prefix=$prefix --sysconfdir=$sysconfdir && make && make install)"
1.9 grant 591: echo "SED=$prefix/bin/nbsed" >> ${MKCONF_EXAMPLE}
1.1 grant 592: ;;
593: esac
594:
595: # bootstrap pkg_install
596: echo_msg "Installing pkgtools"
1.2 grant 597: copy_src ../pkgtools/pkg_install/files pkg_install
1.1 grant 598: pkg_install_mandir="$prefix/man"
599: if [ "$prefix" = "/usr" ]; then
600: pkg_install_mandir="$prefix/share/man"
601: fi
1.11 jmmv 602: run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV CPPFLAGS='-I../libnbcompat -I../../libnbcompat' LDFLAGS='-L../libnbcompat -L../../libnbcompat' LIBS='-lnbcompat' $shprog ./configure -C --prefix=$prefix --sysconfdir=$sysconfdir --with-pkgdbdir=$pkgdbdir --mandir=$pkg_install_mandir $pkg_install_args && $prefix/bin/bmake && $prefix/bin/bmake install)"
1.1 grant 603:
604: # all's ready, install the man page
605: echo_msg "Installing packages(7) man page"
606: (cd files; run_cmd "$shprog ./install-sh -c -m 444 packages.cat7 $prefix/man/cat7/packages.0")
607:
608: # opsys specific fiddling
609: opsys_finish
610:
1.9 grant 611: echo "" >> ${MKCONF_EXAMPLE}
612: echo ".endif # end pkgsrc settings" >> ${MKCONF_EXAMPLE}
1.1 grant 613:
614: echo ""
1.9 grant 615: echo "Please remember to add $prefix/bin to your PATH environment variable"
616: echo "and $prefix/man to your MANPATH environment variable, if necessary."
617: echo ""
618: echo "An example mk.conf file \"${MKCONF_EXAMPLE}\" with the settings you"
619: echo "provided to \"bootstrap\" has been created for you."
1.11 jmmv 620: echo "Please copy ${MKCONF_EXAMPLE} to ${sysconfdir}/mk.conf."
1.1 grant 621: echo ""
622: echo "You can find extensive documentation of the NetBSD Packages Collection"
623: echo "in $pkgsrcdir/Packages.txt and packages(7)."
624: echo ""
625: echo "Hopefully everything is now complete."
626: echo "Thank you"
627:
628: echo_msg "bootstrap started: $build_start"
629: echo_msg "bootstrap ended: `date`"
630:
631: exit 0
CVSweb <webmaster@jp.NetBSD.org>